This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
winsttest2 [2011/09/28 12:14] ueluekmen |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | TEST10 | ||
- | <code winst> | ||
- | |||
- | inivar test | ||
- | ; Copyright (c) uib gmbh (www.uib.de) | ||
- | ; This sourcecode is owned by uib | ||
- | ; and published under the Terms of the General Public License. | ||
- | ; credits: http:// | ||
- | |||
- | [actions] | ||
- | requiredWinstVersion >= " | ||
- | |||
- | 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$ | ||
- | |||
- | Set $INST_SystemType$ = GetSystemType | ||
- | set $INST_architecture$ = GetProductProperty(" | ||
- | |||
- | |||
- | Set $LogDir$ = " | ||
- | |||
- | ; ---------------------------------------------------------------- | ||
- | ; - Please edit the following values | ||
- | ; ---------------------------------------------------------------- | ||
- | ; | ||
- | ; therefore please: only lower letters, no umlauts, | ||
- | ; no white space use ' | ||
- | Set $ProductId$ | ||
- | Set $MinimumSpace$ | ||
- | ; the path were we find the product after the installation | ||
- | Set $InstallDir32$ | ||
- | Set $InstallDir64$ | ||
- | Set $LicenseRequired$ = " | ||
- | Set $LicensePool$ | ||
- | ; ---------------------------------------------------------------- | ||
- | |||
- | if not(HasMinimumSpace (" | ||
- | LogError "Not enough space on %SystemDrive%, | ||
- | isFatalError | ||
- | ; Stop process and set installation status to failed | ||
- | else | ||
- | comment "Show product picture" | ||
- | ShowBitmap " | ||
- | |||
- | if FileExists(" | ||
- | comment "Start uninstall sub section" | ||
- | Sub " | ||
- | endif | ||
- | |||
- | if $LicenseRequired$ = " | ||
- | comment " | ||
- | Sub_get_licensekey | ||
- | endif | ||
- | |||
- | comment " | ||
- | |||
- | if (($INST_SystemType$ = "x86 System" | ||
- | Message " | ||
- | comment "Start setup program" | ||
- | Winbatch_install_32 | ||
- | Sub_check_exitcode | ||
- | comment "Copy files" | ||
- | Files_install_32 /32Bit | ||
- | comment "Patch Registry" | ||
- | Registry_install /32Bit | ||
- | comment " | ||
- | LinkFolder_install | ||
- | endif | ||
- | |||
- | if ($INST_SystemType$ = "64 Bit System" | ||
- | Message " | ||
- | comment "Start setup program" | ||
- | Winbatch_install_64 | ||
- | Sub_check_exitcode | ||
- | comment "Copy files" | ||
- | Files_install_64 /64Bit | ||
- | comment "Patch Registry" | ||
- | Registry_install /64Bit | ||
- | comment " | ||
- | LinkFolder_install | ||
- | 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 ================================================================ | ||
- | ; " | ||
- | ; | ||
- | ; === MSI package ======================================================================================= | ||
- | ; You may use the parameter PIDKEY=$Licensekey$ | ||
- | ; msiexec /i " | ||
- | ; | ||
- | ; === InstallShield + MSI===================================================================================== | ||
- | ; Attention: The path to the log file should not contain any whitespaces | ||
- | ; " | ||
- | ; " | ||
- | ; | ||
- | ; === InstallShield ===================================================================================== | ||
- | ; Create setup.iss answer file by running: setup.exe /r / | ||
- | ; " | ||
- | ; | ||
- | ; === Inno Setup ======================================================================================== | ||
- | ; http:// | ||
- | ; You may create setup answer file by: setup.exe / | ||
- | ; You may use an answer file by the parameter / | ||
- | " | ||
- | |||
- | [Files_install_32] | ||
- | ; Example of recursively copying some files into the installation directory: | ||
- | ; | ||
- | ; copy -s " | ||
- | |||
- | [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 ================================================================ | ||
- | ; " | ||
- | ; | ||
- | ; === MSI package ======================================================================================= | ||
- | ; You may use the parameter PIDKEY=$Licensekey$ | ||
- | ; msiexec /i " | ||
- | ; | ||
- | ; === InstallShield + MSI===================================================================================== | ||
- | ; Attention: The path to the log file should not contain any whitespaces | ||
- | ; " | ||
- | ; " | ||
- | ; | ||
- | ; === InstallShield ===================================================================================== | ||
- | ; Create setup.iss answer file by running: setup.exe /r / | ||
- | ; " | ||
- | ; | ||
- | ; === Inno Setup ======================================================================================== | ||
- | ; http:// | ||
- | ; You may create setup answer file by: setup.exe / | ||
- | ; You may use an answer file by the parameter / | ||
- | ; " | ||
- | |||
- | [Files_install_64] | ||
- | ; Example of recursively copying some files into the installation directory: | ||
- | ; | ||
- | ; copy -s " | ||
- | |||
- | [Registry_install] | ||
- | ; Example of setting some values of an registry key: | ||
- | ; | ||
- | | ||
- | set " | ||
- | set " | ||
- | set " | ||
- | |||
- | [LinkFolder_install] | ||
- | | ||
- | |||
- | | ||
- | | ||
- | |||
- | | ||
- | |||
- | | ||
- | | ||
- | |||
- | | ||
- | name: $ProductId$ | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | |||
- | ; Example of creating an shortcut to the installed exe on AllUsers desktop: | ||
- | ; | ||
- | | ||
- | | ||
- | |||
- | | ||
- | name: $ProductId$ | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | |||
- | [Sub_get_licensekey] | ||
- | comment " | ||
- | |||
- | comment " | ||
- | Set $LicenseKey$ = demandLicenseKey ($LicensePool$) | ||
- | ; If there is an assignment of exactly one licensepool to the product the following call is possible: | ||
- | ; Set $LicenseKey$ = demandLicenseKey ("", | ||
- | ; | ||
- | ; If there is an assignment of a license pool to a windows software id, it is possible to use: | ||
- | ; DefVar $WindowsSoftwareId$ | ||
- | ; $WindowsSoftwareId$ = " | ||
- | ; Set $LicenseKey$ = demandLicenseKey ("", | ||
- | |||
- | DefVar $ServiceErrorClass$ | ||
- | set $ServiceErrorClass$ = getLastServiceErrorClass | ||
- | comment "Error class: " + $ServiceErrorClass$ | ||
- | |||
- | if $ServiceErrorClass$ = " | ||
- | comment " | ||
- | else | ||
- | if $ServiceErrorClass$ = " | ||
- | LogError " | ||
- | LogError getLastServiceErrorMessage | ||
- | isFatalError | ||
- | else | ||
- | if $ServiceErrorClass$ = " | ||
- | LogError " | ||
- | isFatalError | ||
- | endif | ||
- | endif | ||
- | endif | ||
- | |||
- | [Sub_check_exitcode] | ||
- | comment "Test for installation success via exit code" | ||
- | set $ExitCode$ = getLastExitCode | ||
- | ; informations to exit codes see | ||
- | ; http:// | ||
- | ; http:// | ||
- | if ($ExitCode$ = " | ||
- | comment "Looks good: setup program gives exitcode zero" | ||
- | else | ||
- | comment "Setup program gives a exitcode unequal zero: " + $ExitCode$ | ||
- | if ($ExitCode$ = " | ||
- | comment " | ||
- | comment " | ||
- | else | ||
- | if ($ExitCode$ = " | ||
- | comment "looks good: setup program gives exitcode 1641" | ||
- | comment " | ||
- | else | ||
- | if ($ExitCode$ = " | ||
- | comment "looks good: setup program gives exitcode 3010" | ||
- | comment " | ||
- | else | ||
- | logError " | ||
- | isFatalError | ||
- | endif | ||
- | endif | ||
- | endif | ||
- | endif | ||
- | </ |