Irfanview

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search

This is a silent installer for Irfanview, a freeware (for non-commercial use) image viewer and minor image editor.


Irfanview Versions after 4.41

<?xml version="1.0" encoding="UTF-8"?>
<packages>
<package
    id="IrfanView"
    name="IrfanView"
    revision="%shortversion%0"
    reboot="false"
    priority="50">

        <variable name="version" value="4.42" />
        <variable name="shortversion" value="442" />

        <check type="uninstall" condition="exists" path="IrfanView.+" version="%VERSION%"/>

        <install cmd='%SOFTWARE%\IrfanView\iview%shortversion%_setup.exe /silent /folder="%ProgramFiles%\Irfanview" /desktop=1 /group=1 /allusers=1 /assoc=1' />

         <!-- bring in ANY LANGUAGE FILES AVAILABLE on install directory Languages (see i_view32.ini section about how to translate interface -->
        <install cmd='%COMSPEC% /c copy /y "%SOFTWARE%\irfanview\Help\*.*" "%ProgramFiles%\Irfanview\"' />
        <install cmd='%COMSPEC% /c copy /y "%SOFTWARE%\irfanview\Languages\*.*" "%ProgramFiles%\Irfanview\Languages\"' />

        <!-- bring in our INI file which forces Irfanview settings -->
        <install cmd='%COMSPEC% /c copy /y "%SOFTWARE%\irfanview\i_view32.ini" "%ProgramFiles%\Irfanview\"' />

        <upgrade include="install"/>

        <remove cmd='"%PROGRAMFILES%\IrfanView\iv_uninstall.exe" /silent' />
</package>

</packages>

Irfanview Versions 3.99 - 4.33

<?xml version="1.0" encoding="UTF-8"?>
<packages>
 
<package
    id="irfanview"
    name="IrfanView"
    revision="%shortversion%0"
    reboot="false"
    priority="0">

	<variable name="version" value="4.3.3.0" />
	<variable name="shortversion" value="433" />
	<variable name="exesize" value="546304" />

	<check type="file" condition="versionequalto" path="%PROGRAMFILES%\IrfanView\i_view32.exe" value="%version%" />
	<check type="file" condition="sizeequals" path="%PROGRAMFILES%\IrfanView\i_view32.exe" value="%exesize%" />
 
	<install cmd='%SOFTWARE%\irfanview\iview%shortversion%_setup.exe /silent /folder="%ProgramFiles%\Irfanview" /desktop=1 /group=1 /allusers=1 /assoc=1' />
 
	<!-- bring in our INI file which forces Irfanview to use per-user configurations in %APPDATA% -->
	<install cmd='%COMSPEC% /c copy /y "%SOFTWARE%\irfanview\i_view32.ini" "%ProgramFiles%\Irfanview\"' />
 
	<upgrade cmd='"%PROGRAMFILES%\IrfanView\iv_uninstall.exe" /silent' />
	<upgrade cmd='%SOFTWARE%\irfanview\iview%shortversion%_setup.exe /silent /folder="%ProgramFiles%\Irfanview" /desktop=1 /group=1 /allusers=1 /assoc=1' />
 
	<remove cmd='"%PROGRAMFILES%\IrfanView\iv_uninstall.exe" /silent' />
</package>
 
</packages>

The /silent option for iv_uninstall.exe doesn't work. The remove process stops trying to display a window to confirm uninstall. You can use iv_uninstall.exe from V4.25 to uninstall V4.27 silently. It worked for me.

Since V4.28 iv_uninstall /silent does work once again!

Installation options

See http://www.irfanview.com/faq.htm for a full list of the installer options.

i_view32.exe File Sizes

Irfanview 3.99 didn't bump the version number in the executable, so for some versions of Irvanview (possibly not the most recent versions), when checking for which version is installed you should check the size of i_view32.exe too. The file sizes for some versions are:

  • 4.33: 546304
  • 4.30: 532480
  • 4.28: 505856
  • 4.25: 481792
  • 4.27: 494080
  • 4.28: 505856
  • 3.99: 444928

Configuration

By default Irfanview uses a user configuration file (i_view32.ini) in the Irfanview program directory. This is not appropriate in a multi-user environment. Irfanview can instead use an alternative configuration file if you instruct it to do so. Tell Irfanview to use a configuration file in a user's %APPDATA% directory and each user will be able to have their own configuration. Do this by replacing the default i_view32.ini with the following one.

Save this as i_view32.ini and place it your %PACKAGES%\IrfanView\ directory beside the installer.

[Others]
INI_Folder="%APPDATA%\Irfanview"

This file is also useful to define the default configuration that we wish for the Irfanview installation.

For example, to select the Spanish language and the Grosberg_24 toolbar style you need to add to i_view32.ini:

[Language]
DefaultLang=SPANISH.DLL
Lang=Español
[Toolbar]
Skin=Grosberg_24.png
Size=24

Plugins

<package id="irfanview_plugins" name="Irfanview Plugins" revision="%shortversion%" reboot="false" priority="1">
        <check type="file" condition="exists" path="%PROGRAMFILES%\IrfanView\plugins\IV_player.exe" />
        <depends package-id="irfanview" />

        <variable name="shortversion" value="428" />

        <install cmd='%SOFTWARE%\irfanview\irfanview_plugins_%shortversion%_setup.exe /silent' />
        <upgrade cmd='%SOFTWARE%\irfanview\irfanview_plugins_%shortversion%_setup.exe /silent' />
        <!-- This doesn't remove all plugins. Just ensure a false check for this package.
             Hence, WPKG could mark irfanview_plugins package as removed and this allows
             removing IrfanView main package avoiding this depending package to fail. -->
        <remove cmd='%COMSPEC% /c del "%ProgramFiles%\Irfanview\Plugins\IV_player.exe"' />
</package>

This package has a fake remove operation just to allow removing the main Irfanview package.

Languages

To install the Irfanview language packs is better to copy the required files from the zip. The language installers doesn't has the /silent option.

This is an example package definition to install the Spanish Language package.

<package id="irfanview_es" name="Irfanview Spanish Language" revision="1" reboot="false" priority="1">
        <check type="file" condition="exists" path="%PROGRAMFILES%\IrfanView\Languages\Spanish.dll" />
        <depends package-id="irfanview" />
        <!-- Copy Spanish.dll and IP_Spanish.lng with one command -->
        <install cmd='%COMSPEC% /c copy /y "%SOFTWARE%\irfanview\*Spanish.*" "%ProgramFiles%\Irfanview\Languages\"' />
        <upgrade cmd='%COMSPEC% /c copy /y "%SOFTWARE%\irfanview\*Spanish.*" "%ProgramFiles%\Irfanview\Languages\"' />
        <remove cmd='%COMSPEC% /c del "%ProgramFiles%\Irfanview\Languages\*Spanish.*"' />
</package>