change LogDir; add ProductProperty desktoplink, custom-post-install, custom-post-uninstall

fix incorrect path for the InstallDir64
fix 64 Bit System uninstall - change to GetRegistryStringValue32
This commit is contained in:
Dominik Daehn 2019-06-19 07:04:17 +02:00
parent 8695210183
commit 463933f9fe
4 changed files with 78 additions and 19 deletions

View File

@ -21,6 +21,7 @@ if FileExists($IniFile$)
comment "Uninstall program found, starting uninstall" comment "Uninstall program found, starting uninstall"
Winbatch_uninstall_old Winbatch_uninstall_old
sub_check_exitcode sub_check_exitcode
sleepSeconds 1
endif endif
endif endif
if FileExists($UninstallProgram$) if FileExists($UninstallProgram$)
@ -38,6 +39,17 @@ Registry_uninstall /64Bit
comment "Delete program shortcuts" comment "Delete program shortcuts"
LinkFolder_uninstall 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] [Winbatch_uninstall_old]
"$UninstallProgramOld$" /silent /norestart /SUPPRESSMSGBOXES /nocancel "$UninstallProgramOld$" /silent /norestart /SUPPRESSMSGBOXES /nocancel
@ -64,9 +76,12 @@ del -sf "$InstallDir$\"
; ;
; Example of deleting a shortcut from AllUsers desktop: ; Example of deleting a shortcut from AllUsers desktop:
; ;
; set_basefolder common_desktopdirectory set_basefolder common_desktopdirectory
; set_subfolder "" set_subfolder ""
; delete_element $ProductId$ delete_element $NAME$
[sub_CustomPostUninstall]
include_insert "%ScriptPath%\custom\" + $Property_CustomPostUninstall$
[Sub_check_exitcode] [Sub_check_exitcode]
comment "Test for installation success via exit code" comment "Test for installation success via exit code"

View File

@ -19,7 +19,11 @@ DefVar $OLD_VERSION$
DefVar $OLD_CREATOR_TAG$ DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$ 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 ; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
; and adds the following variables: ; and adds the following variables:
@ -39,7 +43,7 @@ Set $LogDir$ = "%SystemDrive%\tmp"
; no white space use '-' as a seperator ; no white space use '-' as a seperator
Set $MinimumSpace$ = "20 MB" Set $MinimumSpace$ = "20 MB"
; the path were we find the product after the installation ; the path were we find the product after the installation
Set $InstallDir$ = "%ProgramFiles64Dir%\BlueGriffon" Set $InstallDir$ = "%ProgramFiles32Dir%\BlueGriffon"
; ---------------------------------------------------------------- ; ----------------------------------------------------------------
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini" Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
@ -70,8 +74,21 @@ else
comment "Patch Registry" comment "Patch Registry"
Registry_install /64Bit Registry_install /64Bit
comment "Create shortcuts" Set $Property_DesktopLink$ = GetProductProperty("DesktopLink","false")
LinkFolder_install if ($Property_DesktopLink$ = "true")
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 endif
@ -116,17 +133,20 @@ copy "$IniCfgFile$" "$InstallDir$"
; ;
; Example of creating an shortcut to the installed exe on AllUsers desktop: ; Example of creating an shortcut to the installed exe on AllUsers desktop:
; ;
; set_basefolder common_desktopdirectory set_basefolder common_desktopdirectory
; set_subfolder "" set_subfolder ""
; ;
; set_link set_link
; name: $ProductId$ name: $NAME$
; target: <path to the program> target: "$InstallDir$\bluegriffon.exe"
; parameters: <some_param> parameters:
; working_dir: $InstallDir$ working_dir: $InstallDir$
; icon_file: <path to icon file> icon_file:
; icon_index: 2 icon_index:
; end_link end_link
[sub_CustomPostInstall]
include_insert "%ScriptPath%\custom\" + $Property_CustomPostInstall$
[Sub_check_exitcode] [Sub_check_exitcode]
comment "Test for installation success via exit code" comment "Test for installation success via exit code"

View File

@ -18,7 +18,7 @@ DefVar $OLD_VERSION$
DefVar $OLD_CREATOR_TAG$ DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$ DefVar $OLD_RELEASE$
Set $LogDir$ = "%SystemDrive%\tmp" Set $LogDir$ = "%opsiLogDir%"
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh ; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
; and adds the following variables: ; and adds the following variables:
@ -33,7 +33,7 @@ Set $LogDir$ = "%SystemDrive%\tmp"
; ---------------------------------------------------------------- ; ----------------------------------------------------------------
; - Please edit the following values - ; - Please edit the following values -
; ---------------------------------------------------------------- ; ----------------------------------------------------------------
Set $InstallDir$ = "%ProgramFiles64Dir%\BlueGriffon" Set $InstallDir$ = "%ProgramFiles32Dir%\BlueGriffon"
; ---------------------------------------------------------------- ; ----------------------------------------------------------------
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini" Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"

View File

@ -21,6 +21,30 @@ onceScript:
customScript: customScript:
userLoginScript: 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"]
[ProductDependency] [ProductDependency]
action: setup action: setup
requiredProduct: sereby.aio requiredProduct: sereby.aio