This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
userspace:f-secure_workstation [2013/10/24 08:34] bobzbobz created |
userspace:f-secure_workstation [2021/08/23 08:37] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== F-Secure Workstation (Exported from Management Console) ====== | ====== F-Secure Workstation (Exported from Management Console) ====== | ||
| + | //Scripts and Guide by Soren Birk. Credits to forum-user [[https:// | ||
| + | This package installs F-Secure Workstation. | ||
| + | |||
| + | Since updates are critical to an Anti-Virus, a ini-file is created to keep track of older Msi ID' | ||
| + | |||
| + | //Please note that I am refering to major releases, as definition-updates should come from the Management Server automatically.// | ||
| + | |||
| + | **Tested With:** | ||
| + | * OPSI 4.0.3.1 | ||
| + | * Winst 4.11.3.6 | ||
| + | * Windows 7, 64-Bit | ||
| + | |||
| + | **Instructions: | ||
| + | * Start off by creating a policy that matches your company' | ||
| + | * Bind this policy to the Workstation-package and export it as a .msi-file. | ||
| + | |||
| + | **Tree:** | ||
| + | < | ||
| + | CLIENT_DATA | ||
| + | ├ setup.ins | ||
| + | ├ uninstall.ins | ||
| + | ├ delsub.ins | ||
| + | ├ fsecurelogo.png | ||
| + | └ wworkstationsXXXX-exported.msi | ||
| + | </ | ||
| + | |||
| + | //Use Microsoft Orca to get the msi ID for the setup- and uninstall-script.// | ||
| + | |||
| + | ==== setup.ins ==== | ||
| + | <code winst> | ||
| + | ; Author Soren Birk | ||
| + | |||
| + | [Actions] | ||
| + | requiredWinstVersion >= " | ||
| + | |||
| + | DefVar $MsiId$ | ||
| + | DefVar $old_MsiId$ | ||
| + | DefVar $OpsiIni$ | ||
| + | DefVar $LogDir$ | ||
| + | DefVar $ProductId$ | ||
| + | DefVar $MinimumSpace$ | ||
| + | DefVar $InstallDir$ | ||
| + | DefVar $ExitCode$ | ||
| + | |||
| + | ; Determines if an uninstall has been run during execution of the setup-script | ||
| + | DefVar $UninstHasBeenRun$ | ||
| + | Set $UninstHasBeenRun$ = " | ||
| + | |||
| + | Set $OpsiIni$ | ||
| + | Set $old_MsiId$ | ||
| + | |||
| + | Set $MsiId$ = ' | ||
| + | |||
| + | Set $LogDir$ = " | ||
| + | |||
| + | ; ---------------------------------------------------------------- | ||
| + | ; - Please edit the following values | ||
| + | ; ---------------------------------------------------------------- | ||
| + | Set $ProductId$ | ||
| + | Set $MinimumSpace$ | ||
| + | Set $InstallDir$ | ||
| + | ; ---------------------------------------------------------------- | ||
| + | |||
| + | if not(HasMinimumSpace (" | ||
| + | LogError "Not enough free space on %SystemDrive%, | ||
| + | isFatalError "Not enough free space" | ||
| + | ; Stop the process and set installationstatus as failed | ||
| + | else | ||
| + | |||
| + | comment "Show product logo" | ||
| + | ShowBitmap " | ||
| + | |||
| + | if FileExists(" | ||
| + | comment "Start uninstall sub section" | ||
| + | Sub " | ||
| + | |||
| + | if $UninstHasBeenRun$ = " | ||
| + | Set $UninstHasBeenRun$ = " | ||
| + | ExitWindows / | ||
| + | endif | ||
| + | endif | ||
| + | |||
| + | Message " | ||
| + | |||
| + | comment "Start setup-program" | ||
| + | ChangeDirectory " | ||
| + | Winbatch_install | ||
| + | Sub_check_exitcode | ||
| + | |||
| + | comment " | ||
| + | Patches_majversion $InstallDir$+" | ||
| + | |||
| + | ExitWindows /Reboot | ||
| + | endif | ||
| + | |||
| + | |||
| + | [Winbatch_install] | ||
| + | msiexec /i " | ||
| + | |||
| + | [Patches_majversion] | ||
| + | set [version] msiid=$MsiId$ | ||
| + | |||
| + | [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 | ||
| + | </ | ||
| + | |||
| + | ==== uninstall.ins ==== | ||
| + | <code winst> | ||
| + | ; Author Soren Birk | ||
| + | |||
| + | [Actions] | ||
| + | requiredWinstVersion >= " | ||
| + | |||
| + | DefVar $MsiId$ | ||
| + | DefVar $old_MsiId$ | ||
| + | DefVar $OpsiIni$ | ||
| + | DefVar $LogDir$ | ||
| + | DefVar $ExitCode$ | ||
| + | DefVar $ProductId$ | ||
| + | DefVar $InstallDir$ | ||
| + | DefVar $UninstHasBeenRun$ | ||
| + | |||
| + | Set $LogDir$ = " | ||
| + | |||
| + | Set $OpsiIni$ | ||
| + | Set $old_MsiId$ | ||
| + | |||
| + | Set $MsiId$ = ' | ||
| + | |||
| + | ; ---------------------------------------------------------------- | ||
| + | ; - Please edit the following values | ||
| + | ; ---------------------------------------------------------------- | ||
| + | Set $ProductId$ | ||
| + | Set $InstallDir$ | ||
| + | ; ---------------------------------------------------------------- | ||
| + | |||
| + | |||
| + | comment "Show product logo" | ||
| + | ShowBitmap " | ||
| + | |||
| + | Message " | ||
| + | |||
| + | if FileExists(" | ||
| + | comment "Start uninstall sub section" | ||
| + | Sub " | ||
| + | |||
| + | ExitWindows /Reboot | ||
| + | endif | ||
| + | </ | ||
| + | |||
| + | ==== delsub.ins ==== | ||
| + | <code winst> | ||
| + | ; Author Soren Birk | ||
| + | |||
| + | Message " | ||
| + | |||
| + | if FileExists($OpsiIni$) and not (GetRegistryStringValue32(" | ||
| + | comment "Old MSI id " + $old_MsiId$ + " found in registry, starting uninstallation" | ||
| + | Winbatch_uninstall_oldmsi | ||
| + | sub_check_exitcode | ||
| + | |||
| + | comment " | ||
| + | Files_uninstall | ||
| + | |||
| + | Set $UninstHasBeenRun$ = " | ||
| + | else | ||
| + | if not (GetRegistryStringValue32(" | ||
| + | comment "MSI id " + $MsiId$ + " found in registry, starting uninstallation" | ||
| + | Winbatch_uninstall_msi | ||
| + | sub_check_exitcode | ||
| + | |||
| + | comment " | ||
| + | Files_uninstall | ||
| + | |||
| + | Set $UninstHasBeenRun$ = " | ||
| + | endif | ||
| + | endif | ||
| + | |||
| + | |||
| + | [Winbatch_uninstall_msi] | ||
| + | msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress | ||
| + | |||
| + | [Winbatch_uninstall_oldmsi] | ||
| + | msiexec /x $old_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 | ||
| + | </ | ||