This shows you the differences between two versions of the page.
userspace:fsecureclientmanagement [2013/02/13 12:21] bobzbobz |
userspace:fsecureclientmanagement [2021/08/23 08:37] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== F-Secure Client 9.32 Via Management ====== | ||
- | //Scripts and guide by Soren Birk// | ||
- | This is F-Secure " | ||
- | |||
- | **Tested With:** | ||
- | * OPSI 4.0.2.4 | ||
- | * Winst 4.11.3.3 | ||
- | * Windows 7, 32 and 64-Bit | ||
- | |||
- | Start by setting up the server-side and exporting your preferences to the client install-file (rename and move to CLIENT_DATA). | ||
- | |||
- | I have commented the check exitcode sub-sections, | ||
- | |||
- | The PC will reboot when the package has been uninstalled/ | ||
- | |||
- | **Tree:** | ||
- | < | ||
- | CLIENT_DATA | ||
- | ├ fsecureclient.msi | ||
- | ├ fsecurelogo.png | ||
- | ├ setup32.ins | ||
- | ├ uninstall32.ins | ||
- | └ delsub32.ins | ||
- | </ | ||
- | |||
- | ==== Setup32.ins ==== | ||
- | <code winst> | ||
- | ; Author Soren Birk | ||
- | |||
- | [Actions] | ||
- | requiredWinstVersion >= " | ||
- | |||
- | DefVar $MsiId$ | ||
- | DefVar $LogDir$ | ||
- | DefVar $ProductId$ | ||
- | DefVar $MinimumSpace$ | ||
- | DefVar $InstallDir$ | ||
- | DefVar $ExitCode$ | ||
- | DefVar $LicenseRequired$ | ||
- | DefVar $LicenseKey$ | ||
- | DefVar $LicensePool$ | ||
- | DefVar $RebootFlag$ | ||
- | DefVar $WinstRegKey$ | ||
- | |||
- | Set $LogDir$ = " | ||
- | |||
- | Set $WinstRegKey$ = " | ||
- | Set $RebootFlag$ = GetRegistryStringValue(" | ||
- | |||
- | ; ---------------------------------------------------------------- | ||
- | ; - 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 free space" | ||
- | else | ||
- | comment " | ||
- | ShowBitmap " | ||
- | |||
- | if not (($RebootFlag$ = " | ||
- | |||
- | comment " | ||
- | Set $RebootFlag$ = " | ||
- | Registry_SaveRebootFlag /32Bit | ||
- | |||
- | if FileExists(" | ||
- | comment "Start uninstall sub section" | ||
- | Sub " | ||
- | endif | ||
- | endif | ||
- | |||
- | if ($RebootFlag$ = " | ||
- | Message " | ||
- | |||
- | if $LicenseRequired$ = " | ||
- | comment " | ||
- | Sub_get_licensekey | ||
- | endif | ||
- | |||
- | comment "Start setup-program" | ||
- | ChangeDirectory " | ||
- | Winbatch_install / | ||
- | ; Sub_check_exitcode | ||
- | |||
- | comment " | ||
- | Set $RebootFlag$ = " | ||
- | Registry_SaveRebootFlag /32Bit | ||
- | |||
- | Message " | ||
- | ExitWindows / | ||
- | |||
- | else | ||
- | comment " | ||
- | Set $RebootFlag$ = " | ||
- | Registry_SaveRebootFlag /32Bit | ||
- | endif | ||
- | |||
- | |||
- | endif | ||
- | |||
- | [Winbatch_install] | ||
- | msiexec /i " | ||
- | |||
- | |||
- | [Registry_SaveRebootFlag] | ||
- | openKey [$WinstRegKey$] | ||
- | set " | ||
- | |||
- | |||
- | [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 $MsiId$ | ||
- | DefVar $LogDir$ | ||
- | DefVar $ExitCode$ | ||
- | DefVar $ProductId$ | ||
- | DefVar $InstallDir$ | ||
- | DefVar $LicenseRequired$ | ||
- | DefVar $LicensePool$ | ||
- | DefVar $RebootFlag$ | ||
- | DefVar $WinstRegKey$ | ||
- | |||
- | Set $LogDir$ = " | ||
- | |||
- | Set $WinstRegKey$ = " | ||
- | Set $RebootFlag$ = GetRegistryStringValue(" | ||
- | |||
- | ; ---------------------------------------------------------------- | ||
- | ; - Please edit the following values | ||
- | ; ---------------------------------------------------------------- | ||
- | Set $ProductId$ | ||
- | Set $InstallDir$ | ||
- | Set $LicenseRequired$ = " | ||
- | Set $LicensePool$ | ||
- | ; ---------------------------------------------------------------- | ||
- | |||
- | comment " | ||
- | ShowBitmap " | ||
- | |||
- | Message " | ||
- | if not ($RebootFlag$ = " | ||
- | |||
- | comment " | ||
- | Set $RebootFlag$ = " | ||
- | Registry_SaveRebootFlag /32Bit | ||
- | |||
- | if FileExists(" | ||
- | comment "Start uninstall sub section" | ||
- | Sub " | ||
- | endif | ||
- | |||
- | if $LicenseRequired$ = " | ||
- | comment " | ||
- | Sub_free_license | ||
- | endif | ||
- | else | ||
- | comment " | ||
- | Set $RebootFlag$ = " | ||
- | Registry_SaveRebootFlag /32Bit | ||
- | endif | ||
- | |||
- | |||
- | [Registry_SaveRebootFlag] | ||
- | openKey [$WinstRegKey$] | ||
- | set " | ||
- | |||
- | |||
- | [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 | ||
- | |||
- | Set $MsiId$ = ' | ||
- | |||
- | Message " | ||
- | |||
- | if not (GetRegistryStringValue32(" | ||
- | comment "MSI id " + $MsiId$ + " found in registry, starting msiexec to uninstall" | ||
- | Winbatch_uninstall_msi | ||
- | ; sub_check_exitcode | ||
- | |||
- | comment " | ||
- | Files_uninstall | ||
- | |||
- | Message " | ||
- | ExitWindows / | ||
- | endif | ||
- | |||
- | |||
- | [Winbatch_uninstall_msi] | ||
- | msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress | ||
- | |||
- | |||
- | [Files_uninstall] | ||
- | del -sf " | ||
- | |||
- | |||
- | [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 | ||
- | </ |