Tested with opsi 4.0.1
requiredWinstVersion >= 4.10.8.6
Files can be downloaded at http://www.irfanview.com/
By Thomas_H 2011/10/27 16:15
Last Check:
By Thomas_H 2019/05/14 12:10
Tree:
├ delsub.ins
├ i_view32.ini
├ irfanview.jpg
├ irfanview_plugins_4x_setup.exe
├ iview4x_setup.exe
├ setup.ins
└ uninstall.ins
[Initial] LogLevel=9 ; Log Errors in Logfile but don't abort: ExitOnError=false ; Show syntax errors in the script: ScriptErrorMessages=on ; Dont trace step by step through the script: TraceMode=off ; let started programs run in front of the winst window StayOnTop=false [Actions] requiredWinstVersion >= "4.10.8.6" DefVar $MsiId32$ DefVar $UninstallProgram32$ DefVar $MsiId64$ DefVar $UninstallProgram64$ DefVar $LogDir$ DefVar $ProductId$ DefVar $MinimumSpace$ DefVar $InstallDir32$ DefVar $InstallDir64$ DefVar $ExitCode$ DefVar $LicenseRequired$ DefVar $LicenseKey$ DefVar $LicensePool$ DefVar $INST_SystemType$ DefVar $INST_architecture$ DefVar $Version$ DefVar $Inst_Cmd32$ DefVar $Inst_Cmd64$ DefVar $Inst_Prg$ DefVar $Inst_Cmd_Plg$ DefVar $Inst_Prg_Plg$ Set $INST_SystemType$ = GetSystemType set $INST_architecture$ = GetProductProperty("install_architecture","system specific") Set $LogDir$ = "%SystemDrive%\tmp" ; ---------------------------------------------------------------- ; - Please edit the following values - ; ---------------------------------------------------------------- ;$ProductId$ should be the name of the product in opsi ; therefore please: only lower letters, no umlauts, ; no white space use '-' as a seperator Set $ProductId$ = "irfanview" ;Kein Punkt in der Versionsnummer! 4.30 ist 430, 4.40 ist 440 oder 4.51 ist 451! Set $Version$ = "430" Set $MinimumSpace$ = "3 MB" ; the path were we find the product after the installation Set $InstallDir32$ = "%ProgramFiles32Dir%\IrfanView" Set $InstallDir64$ = "%ProgramFiles64Dir%\IrfanView" Set $LicenseRequired$ = "false" Set $LicensePool$ = "p_" + $ProductId$ Set $Inst_Prg$ = ""+"iview"+$Version$+"_setup.exe"+"" Set $Inst_Cmd32$ = ' /silent /folder="'+$InstallDir32$+'" /desktop=1 /allusers=1 /group=1 /assoc=1' Set $Inst_Cmd64$ = ' /silent /folder="'+$InstallDir64$+'" /desktop=1 /allusers=1 /group=1 /assoc=1' Set $Inst_Prg_Plg$ = "irfanview_plugins_"+$Version$+"_setup.exe" Set $Inst_Cmd_Plg$ = ' /silent' ; ---------------------------------------------------------------- if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$)) LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$ isFatalError ; Stop process and set installation status to failed else comment "Show product picture" ShowBitmap "%ScriptPath%\" + $ProductId$ + ".jpg" $ProductId$ if FileExists("%ScriptPath%\delsub.ins") comment "Start uninstall sub section" Sub "%ScriptPath%\delsub.ins" endif if $LicenseRequired$ = "true" comment "Licensing required, reserve license and get license key" Sub_get_licensekey endif comment "installing" if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only") Message "Installing " + $ProductId$ + " 32 Bit..." comment "Start setup program" Winbatch_install_32 if FileExists("%ScriptPath%\"+$Inst_Prg_Plg$) comment "Installing Plugins" Winbatch_Install_Plugins endif comment "Copying ini-File..." Files_install_32 Sub_check_exitcode endif if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only")) Message "Installing " + $ProductId$ + " 64 Bit..." comment "Start setup program" Winbatch_install_64 comment "Installing Plugins" if FileExists("%ScriptPath%\"+$Inst_Prg_plg$) comment "Installing Plugins" Winbatch_Install_Plugins endif comment "Copying ini-File..." Files_install_64 Sub_check_exitcode endif endif [Winbatch_install_32] ; Choose one of the following examples as basis for your installation ; You can use $LicenseKey$ var to pass a license key to the installer ; ; === Nullsoft Scriptable Install System ================================================================ "%ScriptPath%\$Inst_Prg$"+" $Inst_Cmd32$" [Winbatch_install_64] ; Choose one of the following examples as basis for your installation ; You can use $LicenseKey$ var to pass a license key to the installer ; ; === Nullsoft Scriptable Install System ================================================================ "%ScriptPath%\$Inst_Prg$"+" $Inst_Cmd64$" [Winbatch_Install_Plugins] ; Install the addional plugins ; "%ScriptPath%\$Inst_Prg_Plg$"+" $Inst_Cmd_Plg$" [Files_install_32] ; Example of recursively copying some files into the installation directory: ; copy "%ScriptPath%\*.ini" "$InstallDir32$" [Files_install_64] ; Example of recursively copying some files into the installation directory: ; copy "%ScriptPath%\*.ini" "$InstallDir64$" [Sub_check_exitcode] comment "Test for installation success via exit code" set $ExitCode$ = getLastExitCode ; informations to exit codes see ; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx ; http://msdn.microsoft.com/en-us/library/aa368542.aspx if ($ExitCode$ = "0") comment "Looks good: setup program gives exitcode zero" else comment "Setup program gives a exitcode unequal zero: " + $ExitCode$ if ($ExitCode$ = "1605") comment "ERROR_UNKNOWN_PRODUCT 1605 This action is only valid for products that are currently installed." comment "Uninstall of a not installed product failed - no problem" else if ($ExitCode$ = "1641") comment "looks good: setup program gives exitcode 1641" comment "ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success." else if ($ExitCode$ = "3010") comment "looks good: setup program gives exitcode 3010" comment "ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success." else logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$ isFatalError endif endif endif endif
[Initial] LogLevel=9 ; Log Errors in Logfile but don't abort: ExitOnError=false ; Show syntax errors in the script: ScriptErrorMessages=on ; Dont trace step by step through the script: TraceMode=off ; let started programs run in front of the winst window StayOnTop=false [Actions] requiredWinstVersion >= "4.10.8.6" DefVar $UninstallProgram32$ DefVar $UninstallProgram64$ DefVar $LogDir$ DefVar $ExitCode$ DefVar $ProductId$ DefVar $InstallDir32$ DefVar $InstallDir64$ DefVar $LicenseRequired$ DefVar $LicensePool$ DefVar $INST_SystemType$ DefVar $INST_architecture$ DefVar $Inst_Cmd$ DefVar $Inst_Prg$ Set $INST_SystemType$ = GetSystemType set $INST_architecture$ = GetProductProperty("install_architecture","system specific") Set $LogDir$ = "%SystemDrive%\tmp" ; ---------------------------------------------------------------- ; - Please edit the following values - ; ---------------------------------------------------------------- Set $ProductId$ = "Irfan View" Set $InstallDir32$ = "%ProgramFiles32Dir%\IrfanView" Set $InstallDir64$ = "%ProgramFiles64Dir%\IrfanView" Set $LicenseRequired$ = "false" Set $LicensePool$ = "p_" + $ProductId$ Set $Inst_Prg$ = "iv_uninstall.exe" Set $Inst_Cmd$ = "/silent" ; ---------------------------------------------------------------- comment "Show product picture" ShowBitmap "%ScriptPath%\" + $ProductId$ + ".jpg" $ProductId$ Message "Uninstalling " + $ProductId$ + " ..." if FileExists("%ScriptPath%\delsub.ins") comment "Start uninstall sub section" Sub "%ScriptPath%\delsub.ins" endif if $LicenseRequired$ = "true" comment "Licensing required, free license used" Sub_free_license endif [Sub_free_license] comment "License management is enabled and will be used" comment "Trying to free license used for the product" DefVar $result$ Set $result$ = FreeLicense($LicensePool$) ; If there is an assignment of a license pool to the product, it is possible to use ; Set $result$ = FreeLicense("", $ProductId$) ; ; If there is an assignment of a license pool to a windows software id, it is possible to use ; DefVar $WindowsSoftwareId$ ; $WindowsSoftwareId$ = "..." ; set $result$ = FreeLicense("", "", $WindowsSoftwareId$)
Set $UninstallProgram32$ = $InstallDir32$ + "\" +$Inst_Prg$ Set $UninstallProgram64$ = $InstallDir64$ + "\" +$Inst_Prg$ if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only") Message "Uninstalling " + $ProductId$ + " 32 Bit..." if FileExists($UninstallProgram32$) comment "Uninstall program found, starting uninstall" Winbatch_uninstall_32 comment "Removing "+$InstallDir32$ Files_uninstall_32 sub_check_exitcode endif endif if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only")) Message "Uninstalling " + $ProductId$ + " 64 Bit..." if FileExists($UninstallProgram64$) comment "Uninstall program found, starting uninstall" Winbatch_uninstall_64 comment "Removing "+$InstallDir64$ Files_uninstall_64 sub_check_exitcode endif endif [Winbatch_uninstall_32] ; Choose one of the following examples as basis for program uninstall ; ; === Nullsoft Scriptable Install System ================================================================ ; "$UninstallProgram32$" /S ; ; === Inno Setup ======================================================================================== "$UninstallProgram32$" /silent [Winbatch_uninstall_64] ; Choose one of the following examples as basis for program uninstall ; ; === Nullsoft Scriptable Install System ================================================================ ; "$UninstallProgram64$" /S ; ; === Inno Setup ======================================================================================== ; "$UninstallProgram64$" /silent /norestart "$UninstallProgram64$" /silent [Files_uninstall_32] ; Example for recursively deleting the installation directory (don't forget the trailing backslash): ; delete -sf "$InstallDir32$\" [Files_uninstall_64] ; Example for recursively deleting the installation directory (don't forget the trailing backslash): ; delete -sf "$InstallDir64$\" [Sub_check_exitcode] comment "Test for installation success via exit code" set $ExitCode$ = getLastExitCode ; informations to exit codes see ; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx ; http://msdn.microsoft.com/en-us/library/aa368542.aspx if ($ExitCode$ = "0") comment "Looks good: setup program gives exitcode zero" else comment "Setup program gives a exitcode unequal zero: " + $ExitCode$ if ($ExitCode$ = "1605") comment "ERROR_UNKNOWN_PRODUCT 1605 This action is only valid for products that are currently installed." comment "Uninstall of a not installed product failed - no problem" else if ($ExitCode$ = "1641") comment "looks good: setup program gives exitcode 1641" comment "ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success." else if ($ExitCode$ = "3010") comment "looks good: setup program gives exitcode 3010" comment "ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success." else logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$ isFatalError endif endif endif endif
The following i_view32.ini is designed for the language GERMAN! IrfanView will open in full-screen-mode.
[Language] DLL=DEUTSCH.DLL Lang=Deutsch [Toolbar] Skin=Samuel_16.png Size=16 [WinPosition] xKoord=-4 yKoord=-4 Width=499 Height=358 Maximized=1 [Others] Test=1 Unicode=0 PropPage=8