Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
userspace:irfanview_4.3 [2012/12/12 13:20]
bhubal
userspace:irfanview_4.3 [2012/12/12 13:23] (current)
bhubal
Line 147: Line 147:
  
 </​code>​ </​code>​
 +
 +==== delsub.ins ====
 +
 +<code winst>
 +; Message at install time:
 +Message "​Deinstalling "​+$ProductId$+"​ ..."
 +
 +comment "start uninstall program if exists"​
 +if FileExists($InstallDir$+"​\iv_uninstall.exe"​)
 + Winbatch_uninstall
 + sub_check_exitcode
 +endif 
 +
 +comment "​delete files"
 +Files_uninstall
 +
 +comment "clear start menu"
 +LinkFolder_uninstall
 +
 +[Winbatch_uninstall]
 +"​$InstallDir$\iv_uninstall.exe"​ /silent
 +
 +[Files_uninstall]
 +del -sf "​$InstallDir$\"​
 +
 +[LinkFolder_uninstall]
 +set_basefolder common_programs
 +delete_subfolder $ProductId$
 +
 +[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
 +
 +</​code>​
 +
 +==== uninstall.ins ====
 +
 +<code winst>
 +; Copyright (c) uib gmbh (www.uib.de)
 +; This sourcecode is owned by uib gmbh
 +; and published under the Terms of the General Public License.
 +; credits: http://​www.opsi.org/​credits/​
 +
 +[Actions]
 +requiredWinstVersion >= "​4.11.2.6"​
 +setloglevel = 6
 +
 +DefVar $ProductId$
 +DefVar $InstallDir$
 +DefVar $ExitCode$
 +DefVar $licensepool$
 +
 +; This should be edited
 +set $ProductId$ = "​irfanview"​
 +set $InstallDir$="​%ProgramFiles32Dir%\"​+$ProductId$
 +
 +comment "show product picture"​
 +ShowBitmap "​%scriptpath%\"​+$ProductId$+"​.png"​ $ProductId$
 +
 +if FileExists("​%ScriptPath%\delsub.ins"​)
 +   ​comment ​ "start uninstall sub section"​
 +   sub "​%ScriptPath%\delsub.ins"​
 +endif
 +
 +</​code>​
 +

QR Code
QR Code userspace:irfanview_4.3 (generated for current page)