This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
userspace:putty062 [2013/02/14 12:21] bobzbobz |
userspace:putty062 [2013/02/15 09:18] bobzbobz |
||
---|---|---|---|
Line 6: | Line 6: | ||
PuTTY normally saves its sessions to the Registry, but there are too many registry keys to create them directly in the script. | PuTTY normally saves its sessions to the Registry, but there are too many registry keys to create them directly in the script. | ||
- | I have therefor | + | I have therefore |
You need to add some product properties to the control-file, | You need to add some product properties to the control-file, | ||
Line 39: | Line 39: | ||
└ <same folder-structure as PuTTY_conf1> | └ <same folder-structure as PuTTY_conf1> | ||
</ | </ | ||
+ | |||
+ | //You should rename the " | ||
==== Control file ==== | ==== Control file ==== | ||
< | < | ||
+ | [Package] | ||
+ | version: 1 | ||
+ | depends: | ||
+ | incremental: | ||
+ | [Product] | ||
+ | type: localboot | ||
+ | id: putty | ||
+ | name: PuTTY | ||
+ | description: | ||
+ | advice: | ||
+ | version: 0.62 | ||
+ | priority: 0 | ||
+ | licenseRequired: | ||
+ | productClasses: | ||
+ | setupScript: | ||
+ | uninstallScript: | ||
+ | updateScript: | ||
+ | alwaysScript: | ||
+ | onceScript: | ||
+ | customScript: | ||
+ | userLoginScript: | ||
+ | |||
+ | [ProductProperty] | ||
+ | type: unicode | ||
+ | name: configuration | ||
+ | multivalue: False | ||
+ | editable: True | ||
+ | description: | ||
+ | values: [" | ||
+ | default: [" | ||
</ | </ | ||
==== Setup32.ins ==== | ==== Setup32.ins ==== | ||
<code winst> | <code winst> | ||
+ | ; Author Soren Birk | ||
+ | [Actions] | ||
+ | requiredWinstVersion >= " | ||
+ | |||
+ | DefVar $LogDir$ | ||
+ | DefVar $ProductId$ | ||
+ | DefVar $MinimumSpace$ | ||
+ | DefVar $InstallDir$ | ||
+ | DefVar $ExitCode$ | ||
+ | DefVar $LicenseRequired$ | ||
+ | DefVar $LicenseKey$ | ||
+ | DefVar $LicensePool$ | ||
+ | DefVar $Konfiguration$ | ||
+ | |||
+ | Set $LogDir$ = " | ||
+ | Set $Konfiguration$ = GetProductProperty(" | ||
+ | |||
+ | ; ---------------------------------------------------------------- | ||
+ | ; - Please edit the following values | ||
+ | ; ---------------------------------------------------------------- | ||
+ | Set $ProductId$ | ||
+ | Set $MinimumSpace$ | ||
+ | Set $InstallDir$ | ||
+ | Set $LicenseRequired$ = " | ||
+ | Set $LicensePool$ | ||
+ | ; ---------------------------------------------------------------- | ||
+ | |||
+ | if not(HasMinimumSpace (" | ||
+ | LogError "Not enough space on %SystemDrive%, | ||
+ | isFatalError "Not enough space" | ||
+ | else | ||
+ | comment " | ||
+ | ShowBitmap " | ||
+ | |||
+ | if FileExists(" | ||
+ | comment "Start uninstall sub section" | ||
+ | Sub " | ||
+ | endif | ||
+ | |||
+ | Message " | ||
+ | |||
+ | if $LicenseRequired$ = " | ||
+ | comment " | ||
+ | Sub_get_licensekey | ||
+ | endif | ||
+ | |||
+ | if ($Konfiguration$ = " | ||
+ | comment " | ||
+ | Files_install_unv | ||
+ | |||
+ | comment " | ||
+ | LinkFolder_install_konf | ||
+ | endif | ||
+ | |||
+ | if ($Konfiguration$ = " | ||
+ | comment " | ||
+ | Files_install_adm | ||
+ | |||
+ | comment " | ||
+ | LinkFolder_install_konf | ||
+ | endif | ||
+ | |||
+ | if ($Konfiguration$ = " | ||
+ | comment " | ||
+ | Files_install /32Bit | ||
+ | |||
+ | comment " | ||
+ | LinkFolder_install | ||
+ | endif | ||
+ | endif | ||
+ | |||
+ | [Files_install] | ||
+ | copy -s " | ||
+ | |||
+ | |||
+ | [Files_install_unv] | ||
+ | copy -s " | ||
+ | |||
+ | |||
+ | [Files_install_adm] | ||
+ | copy -s " | ||
+ | |||
+ | |||
+ | [LinkFolder_install] | ||
+ | set_basefolder common_programs | ||
+ | set_subfolder " | ||
+ | |||
+ | set_link | ||
+ | name: " | ||
+ | target: " | ||
+ | parameters: | ||
+ | working_dir: | ||
+ | icon_file: " | ||
+ | icon_index: | ||
+ | end_link | ||
+ | |||
+ | set_basefolder common_desktopdirectory | ||
+ | set_subfolder "" | ||
+ | |||
+ | set_link | ||
+ | name: " | ||
+ | target: " | ||
+ | parameters: | ||
+ | working_dir: | ||
+ | icon_file: " | ||
+ | icon_index: | ||
+ | end_link | ||
+ | |||
+ | |||
+ | [LinkFolder_install_konf] | ||
+ | set_basefolder common_programs | ||
+ | set_subfolder " | ||
+ | |||
+ | set_link | ||
+ | name: " | ||
+ | target: " | ||
+ | parameters: | ||
+ | working_dir: | ||
+ | icon_file: " | ||
+ | icon_index: | ||
+ | end_link | ||
+ | |||
+ | set_basefolder common_desktopdirectory | ||
+ | set_subfolder "" | ||
+ | |||
+ | set_link | ||
+ | name: " | ||
+ | target: " | ||
+ | parameters: | ||
+ | working_dir: | ||
+ | icon_file: " | ||
+ | icon_index: | ||
+ | end_link | ||
+ | |||
+ | |||
+ | [Sub_get_licensekey] | ||
+ | if opsiLicenseManagementEnabled | ||
+ | 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 | ||
+ | else | ||
+ | LogError " | ||
+ | isFatalError | ||
+ | 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 | ||
</ | </ | ||
==== Uninstall32.ins ==== | ==== Uninstall32.ins ==== | ||
<code winst> | <code winst> | ||
+ | ; Author Soren Birk | ||
+ | [Actions] | ||
+ | requiredWinstVersion >= " | ||
+ | |||
+ | DefVar $LogDir$ | ||
+ | DefVar $ExitCode$ | ||
+ | DefVar $ProductId$ | ||
+ | DefVar $InstallDir$ | ||
+ | DefVar $LicenseRequired$ | ||
+ | DefVar $LicensePool$ | ||
+ | |||
+ | Set $LogDir$ = " | ||
+ | |||
+ | ; ---------------------------------------------------------------- | ||
+ | ; - Please edit the following values | ||
+ | ; ---------------------------------------------------------------- | ||
+ | Set $ProductId$ | ||
+ | Set $InstallDir$ | ||
+ | Set $LicenseRequired$ = " | ||
+ | Set $LicensePool$ | ||
+ | ; ---------------------------------------------------------------- | ||
+ | |||
+ | |||
+ | comment " | ||
+ | ShowBitmap " | ||
+ | |||
+ | Message " | ||
+ | |||
+ | if FileExists(" | ||
+ | comment "Start uninstall sub section" | ||
+ | Sub " | ||
+ | endif | ||
+ | |||
+ | if $LicenseRequired$ = " | ||
+ | comment " | ||
+ | Sub_free_license | ||
+ | endif | ||
+ | |||
+ | [Sub_free_license] | ||
+ | comment " | ||
+ | |||
+ | comment " | ||
+ | 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("", | ||
+ | ; | ||
+ | ; 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("", | ||
</ | </ | ||
==== delsub32.ins ==== | ==== delsub32.ins ==== | ||
<code winst> | <code winst> | ||
+ | ; Author Soren Birk | ||
+ | |||
+ | Message " | ||
+ | |||
+ | if FileExists(" | ||
+ | comment " | ||
+ | |||
+ | comment " | ||
+ | LinkFolder_uninstall | ||
+ | |||
+ | comment " | ||
+ | Files_uninstall /32Bit | ||
+ | |||
+ | comment " | ||
+ | Registry_uninstall | ||
+ | endif | ||
+ | |||
+ | |||
+ | [LinkFolder_uninstall] | ||
+ | set_basefolder common_programs | ||
+ | delete_subfolder " | ||
+ | |||
+ | set_basefolder common_desktopdirectory | ||
+ | set_subfolder "" | ||
+ | delete_element " | ||
+ | |||
+ | |||
+ | [Files_uninstall] | ||
+ | del -sf " | ||
+ | |||
+ | |||
+ | [Registry_uninstall] | ||
+ | deletekey [HKCU\Software\SimonTatham] | ||
+ | |||
+ | [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 | ||
</ | </ |