From 942e7778d7668fff61c45a88af9002cd440f97b7 Mon Sep 17 00:00:00 2001 From: Dominik Daehn Date: Wed, 19 Jun 2019 06:54:20 +0200 Subject: [PATCH] change LogDir; add ProductProperty desktoplink, custom-post-install, custom-post-uninstall --- CLIENT_DATA/delsub32.ins | 20 +++++++++++++++++--- CLIENT_DATA/setup32.ins | 26 +++++++++++++++++++++++--- CLIENT_DATA/uninstall32.ins | 2 +- OPSI/control | 24 ++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 7 deletions(-) diff --git a/CLIENT_DATA/delsub32.ins b/CLIENT_DATA/delsub32.ins index 1d695a9..915f69e 100644 --- a/CLIENT_DATA/delsub32.ins +++ b/CLIENT_DATA/delsub32.ins @@ -40,6 +40,17 @@ Registry_uninstall /32Bit comment "Delete program shortcuts" LinkFolder_uninstall +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$" /silent /norestart /SUPPRESSMSGBOXES /nocancel @@ -66,9 +77,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 WinSCP + +[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 5ab26a5..4ff18e1 100644 --- a/CLIENT_DATA/setup32.ins +++ b/CLIENT_DATA/setup32.ins @@ -19,7 +19,11 @@ DefVar $OLD_VERSION$ DefVar $OLD_CREATOR_TAG$ DefVar $OLD_RELEASE$ -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: @@ -70,8 +74,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 @@ -131,6 +148,9 @@ set_basefolder common_desktopdirectory set_subfolder "" delete_element WinSCP +[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 e4a60a7..d5cce84 100644 --- a/CLIENT_DATA/uninstall32.ins +++ b/CLIENT_DATA/uninstall32.ins @@ -18,7 +18,7 @@ DefVar $OLD_VERSION$ DefVar $OLD_CREATOR_TAG$ DefVar $OLD_RELEASE$ -Set $LogDir$ = "%SystemDrive%\tmp" +Set $LogDir$ = "%opsiLogDir%" ; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh ; and adds the following variables: diff --git a/OPSI/control b/OPSI/control index 9f89374..00c0f20 100644 --- a/OPSI/control +++ b/OPSI/control @@ -30,6 +30,30 @@ description: which architecture (32/64 bit) has to be installed values: ["32 only", "64 only", "both", "system specific"] default: ["system specific"] +[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"] + [ProductDependency] action: setup requiredProduct: aio