File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ $pp = Get-PackageParameters
77if ($pp [' StartAfterInstall' ]) {
88 $silentArgs += ' /StartAfterInstall'
99}
10+ if ($pp [' DesktopShortcut' ]) {
11+ $silentArgs += ' /DesktopShortcut'
12+ }
13+ if ($pp [' StartMenuShortcut' ]) {
14+ $silentArgs += ' /StartMenuShortcut'
15+ }
1016
1117$packageArgs = @ {
1218 packageName = $env: ChocolateyPackageName
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ UninstPage uninstConfirm
5555UninstPage instfiles
5656
5757
58+ Var Parameters
5859Var StartMenuShortcut
5960Var DesktopShortcut
6061
@@ -81,9 +82,14 @@ Function ShortcutPageLeave
8182FunctionEnd
8283
8384
84- Function checkLaunchParam
85- ${GetParameters} $0
85+ Function getParams
86+ ${GetParameters} $Parameters
8687 ClearErrors
88+ FunctionEnd
89+
90+
91+ Function checkLaunchParam
92+ Call getParams
8793 ${GetOptions} $0 " /StartAfterInstall" $1
8894 ${IfNot} ${Errors}
8995 Exec " $INSTDIR\${PRODUCT}.exe"
@@ -122,12 +128,18 @@ Section "Installer"
122128 ; Run on startup
123129 WriteRegStr HKCU " Software\Microsoft\Windows\CurrentVersion\Run" " RestoreWindowPos" ' "$InstDir\${PRODUCT}.exe"'
124130
131+ Call getParams
132+
125133 ; Add start menu shortcut if option enabled
134+ ${GetOptions} $Parameters " /StartMenuShortcut" $1
126135 ${IF} $StartMenuShortcut <> 0
136+ ${OrIfNot} ${Errors}
127137 createShortCut " $SMPROGRAMS\${PRODUCT}.lnk" " $INSTDIR\${PRODUCT}.exe" " --open-gui" " " " " SW_SHOWNORMAL
128138 ${ENDIF}
129139
140+ ${GetOptions} $Parameters " /DesktopShortcut" $1
130141 ${IF} $DesktopShortcut <> 0
142+ ${OrIfNot} ${Errors}
131143 createShortCut " $DESKTOP\${PRODUCT}.lnk" " $INSTDIR\${PRODUCT}.exe" " --open-gui" " " " " SW_SHOWNORMAL
132144 ${ENDIF}
133145
You can’t perform that action at this time.
0 commit comments