From 0be36aeaabea69e1a7242cc867338ed4e780b694 Mon Sep 17 00:00:00 2001 From: Dominik Daehn Date: Wed, 19 Jun 2019 07:12:06 +0200 Subject: [PATCH] change LogDir; add ProductProperty desktoplink, custom-post-install, custom-post-uninstall fix incorrect path for the InstallDir --- CLIENT_DATA/delsub32.ins | 20 +++++++++++++++++--- CLIENT_DATA/setup32.ins | 31 +++++++++++++++++++++++++++---- CLIENT_DATA/uninstall32.ins | 4 ++-- OPSI/control | 24 ++++++++++++++++++++++++ 4 files changed, 70 insertions(+), 9 deletions(-) diff --git a/CLIENT_DATA/delsub32.ins b/CLIENT_DATA/delsub32.ins index f680881..3a51f92 100644 --- a/CLIENT_DATA/delsub32.ins +++ b/CLIENT_DATA/delsub32.ins @@ -67,6 +67,17 @@ if $Reboot$="1" ExitWindows /ImmediateReboot endif +DefVar $Property_CustomPostUninstall$ +Set $Property_CustomPostUninstall$ = getProductProperty("custom-post-uninstall","none") +if not ($Property_CustomPostUninstall$ = "none") + comment "Include custom post uninstall file" + if FileExists("%ScriptPath%\custom\" + $Property_CustomPostUninstall$) + sub_CustomPostUninstall + else + LogError "Include script NOT exists (" + $Property_CustomPostUninstall$ +")" + endif +endif + [Winbatch_uninstall_old] "$UninstallProgramOld$" /S @@ -91,9 +102,12 @@ del -sf "$InstallDir$\" ; ; Example of deleting a shortcut from AllUsers desktop: ; -; set_basefolder common_desktopdirectory -; set_subfolder "" -; delete_element $ProductId$ +set_basefolder common_desktopdirectory +set_subfolder "" +delete_element Kleopatra + +[sub_CustomPostUninstall] +include_insert "%ScriptPath%\custom\" + $Property_CustomPostUninstall$ [Sub_check_exitcode] comment "Test for installation success via exit code" diff --git a/CLIENT_DATA/setup32.ins b/CLIENT_DATA/setup32.ins index 6733b49..76c0e6d 100644 --- a/CLIENT_DATA/setup32.ins +++ b/CLIENT_DATA/setup32.ins @@ -20,7 +20,11 @@ DefVar $OLD_CREATOR_TAG$ DefVar $OLD_RELEASE$ DefVar $Reboot$ -Set $LogDir$ = "%SystemDrive%\tmp" +;Property Variables +DefVar $Property_CustomPostInstall$ +DefVar $Property_DesktopLink$ + +Set $LogDir$ = "%opsiLogDir%" ; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh ; and adds the following variables: @@ -40,7 +44,7 @@ Set $LogDir$ = "%SystemDrive%\tmp" ; no white space use '-' as a seperator Set $MinimumSpace$ = "20 MB" ; the path were we find the product after the installation -Set $InstallDir$ = "%ProgramFiles32Dir%\gnu\GnuPG" +Set $InstallDir$ = "%ProgramFiles32Dir%\Gpg4win" ; ---------------------------------------------------------------- Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini" @@ -71,8 +75,21 @@ else comment "Patch Registry" Registry_install /32Bit - comment "Create shortcuts" - LinkFolder_install + Set $Property_DesktopLink$ = GetProductProperty("DesktopLink","false") + if ($Property_DesktopLink$ = "false") + comment "Create shortcuts" + LinkFolder_install + endif + + Set $Property_CustomPostInstall$ = getProductProperty("custom-post-install","none") + if not ($Property_CustomPostInstall$ = "none") + comment "Include custom post install file" + if FileExists("%ScriptPath%\custom\" + $Property_CustomPostInstall$) + sub_CustomPostInstall + else + LogError "Include script NOT exists (" + $Property_CustomPostInstall$ +")" + endif + endif endif @@ -96,6 +113,9 @@ copy "$IniCfgFile$" "$InstallDir$" ; set "name3" = REG_BINARY:00 af 99 cd [LinkFolder_install] +set_basefolder common_desktopdirectory +set_subfolder "" +delete_element Kleopatra ; Example of deleting a folder from AllUsers startmenu: ; ; set_basefolder common_programs @@ -129,6 +149,9 @@ copy "$IniCfgFile$" "$InstallDir$" ; icon_index: 2 ; end_link +[sub_CustomPostInstall] +include_insert "%ScriptPath%\custom\" + $Property_CustomPostInstall$ + [Sub_check_exitcode] comment "Test for installation success via exit code" set $ExitCode$ = getLastExitCode diff --git a/CLIENT_DATA/uninstall32.ins b/CLIENT_DATA/uninstall32.ins index 7af472d..30a09d8 100644 --- a/CLIENT_DATA/uninstall32.ins +++ b/CLIENT_DATA/uninstall32.ins @@ -19,7 +19,7 @@ DefVar $OLD_CREATOR_TAG$ DefVar $OLD_RELEASE$ DefVar $Reboot$ -Set $LogDir$ = "%SystemDrive%\tmp" +Set $LogDir$ = "%opsiLogDir%" ; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh ; and adds the following variables: @@ -34,7 +34,7 @@ Set $LogDir$ = "%SystemDrive%\tmp" ; ---------------------------------------------------------------- ; - Please edit the following values - ; ---------------------------------------------------------------- -Set $InstallDir$ = "%ProgramFiles32Dir%\gnu\GnuPG" +Set $InstallDir$ = "%ProgramFiles32Dir%\Gpg4win" ; ---------------------------------------------------------------- Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini" diff --git a/OPSI/control b/OPSI/control index 0843843..f3b031d 100644 --- a/OPSI/control +++ b/OPSI/control @@ -21,6 +21,30 @@ onceScript: customScript: userLoginScript: +[ProductProperty] +type: bool +name: desktoplink +description: Show Desktop Link on/off +default: False + +[ProductProperty] +type: unicode +name: custom-post-install +multivalue: False +editable: True +description: Define filename for include script in custom directory after installation +values: ["none"] +default: ["none"] + +[ProductProperty] +type: unicode +name: custom-post-uninstall +multivalue: False +editable: True +description: Define filename for include script in custom directory after uninstallation +values: ["none"] +default: ["none"] + [Changelog] gpg4win (2.1.0-5) stable; urgency=low