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:08] bobzbobz |
userspace:putty062 [2021/08/23 08:37] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== PuTTY 0.62 ====== | ====== PuTTY 0.62 ====== | ||
| //Scripts and Guide by Soren Birk// | //Scripts and Guide by Soren Birk// | ||
| + | |||
| + | This guide is for PuTTY 0.62. | ||
| + | |||
| + | PuTTY normally saves its sessions to the Registry, but there are too many registry keys to create them directly in the script. | ||
| + | |||
| + | I have therefore downloaded PuTTY Portable from http:// | ||
| + | |||
| + | You need to add some product properties to the control-file, | ||
| **Tested with:** | **Tested with:** | ||
| Line 9: | Line 17: | ||
| **Instructions: | **Instructions: | ||
| * First download putty.exe from this [[http:// | * First download putty.exe from this [[http:// | ||
| - | * Sessions are stored in the Registry, but has a ton of keys, so instead we use PuTTY-portable for the configured versions (download here) | + | * Sessions are stored in the Registry, but has a ton of keys, so instead we use PuTTY-portable for the configured versions ([[http:// |
| + | * Extract to a folder on the desktop - then browse to the subfolder \App\AppInfo\Launcher and delete the " | ||
| + | * Copy, Paste the folder for as many configs as you want (PuTTY_conf1, | ||
| + | * Afterwards copy all the PuTTY_confx folders to CLIENT_DATA. | ||
| **Tree:** | **Tree:** | ||
| Line 27: | Line 38: | ||
| └ PuTTY_conf2 | └ PuTTY_conf2 | ||
| └ <same folder-structure as PuTTY_conf1> | └ <same folder-structure as PuTTY_conf1> | ||
| + | </ | ||
| + | |||
| + | //You should rename the " | ||
| + | |||
| + | ==== 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 ==== | ||
| + | <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 ==== | ||
| + | <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 ==== | ||
| + | <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 | ||
| </ | </ | ||