add ProductProperty DesktopLink, CustomPostInstall, CustomPostUninstall

This commit is contained in:
Dominik Daehn
2019-10-18 10:03:51 +02:00
parent 015472abcf
commit ab8035806c
8 changed files with 227 additions and 0 deletions

View File

@@ -44,6 +44,10 @@ set $languageInfo$ = getLocaleInfoMap
DefVar $LanguageId$
set $LanguageId$ = getValue("default_language_id_decimal", $languageInfo$)
;Property Variables
DefVar $Property_CustomPostInstall$
DefVar $Property_DesktopLink$
Set $LogDir$ = "%opsiLogDir%"
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
@@ -127,6 +131,10 @@ else
Registry_install /32Bit
comment "Create shortcuts"
LinkFolder_install_32
Set $Property_DesktopLink$ = GetProductProperty("DesktopLink","false")
if ($Property_DesktopLink$ = "true")
LinkFolder_install_DesktopLink_32
endif
comment "File Type Association"
DosInAnIcon_FileTypeAssoc_install
endif
@@ -151,10 +159,24 @@ else
Registry_install /64Bit
comment "Create shortcuts"
LinkFolder_install_64
Set $Property_DesktopLink$ = GetProductProperty("DesktopLink","false")
if ($Property_DesktopLink$ = "true")
LinkFolder_install_DesktopLink_64
endif
comment "File Type Association"
DosInAnIcon_FileTypeAssoc_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
[Winbatch_install_32]
@@ -335,6 +357,38 @@ delete_element "$NAME$"
; icon_index: 2
; end_link
[LinkFolder_install_DesktopLink_32]
;
; Example of creating an shortcut to the installed exe on AllUsers desktop:
;
set_basefolder common_desktopdirectory
set_subfolder ""
;
set_link
name: $NAME$
target: "$InstallDir32$\$ProgramExecutable32$"
parameters:
working_dir: $InstallDir32$
icon_file:
icon_index:
end_link
[LinkFolder_install_DesktopLink_64]
;
; Example of creating an shortcut to the installed exe on AllUsers desktop:
;
set_basefolder common_desktopdirectory
set_subfolder ""
;
set_link
name: $NAME$
target: "$InstallDir64$\$ProgramExecutable64$"
parameters:
working_dir: $InstallDir64$
icon_file:
icon_index:
end_link
[DosInAnIcon_FileTypeAssoc_install]
; Requires danysys.sfta
; Sample Usage:
@@ -346,6 +400,9 @@ delete_element "$NAME$"
;
; SFTA Applications\SumatraPDF.exe .pdf
[sub_CustomPostInstall]
include_insert "%ScriptPath%\custom\" + $Property_CustomPostInstall$
[Sub_get_licensekey]
comment "License management is enabled and will be used"