39
39
StrCpy $0 " $0 --updated"
40
40
${endif}
41
41
42
- ExecWait ' "$PLUGINSDIR\old-uninstaller.exe" /S /KEEP_APP_DATA $0 _?=$R1'
42
+ ExecWait ' "$PLUGINSDIR\old-uninstaller.exe" /S /KEEP_APP_DATA $0 $shortcuts _?=$R1'
43
43
${endif}
44
44
${endif}
45
45
!macroend
@@ -84,6 +84,15 @@ ${IfNot} ${Silent}
84
84
SetDetailsPrint none
85
85
${endif}
86
86
87
+ StrCpy $appExe " $INSTDIR\${APP_EXECUTABLE_FILENAME}"
88
+ Var /GLOBAL shortcuts
89
+ StrCpy $shortcuts " "
90
+ !ifndef allowToChangeInstallationDirectory
91
+ ${if} ${FileExists} " $appExe"
92
+ StrCpy $shortcuts " --keep-shortcuts"
93
+ ${endIf}
94
+ !endif
95
+
87
96
!ifdef ONE_CLICK
88
97
!ifdef HEADER_ICO
89
98
File /oname= $PLUGINSDIR \installerHeaderico.ico " ${HEADER_ICO}"
@@ -102,7 +111,7 @@ ${endif}
102
111
${endif}
103
112
!insertmacro CHECK_APP_RUNNING
104
113
!else
105
- ${IfNot } ${UAC_IsInnerInstance}
114
+ ${ifNot } ${UAC_IsInnerInstance}
106
115
!insertmacro CHECK_APP_RUNNING
107
116
${endif}
108
117
!endif
@@ -168,27 +177,27 @@ SetOutPath $INSTDIR
168
177
169
178
File " /oname=${UNINSTALL_FILENAME}" " ${UNINSTALLER_OUT_FILE}"
170
179
171
- StrCpy $appExe " $INSTDIR\${APP_EXECUTABLE_FILENAME}"
172
180
!insertmacro registryAddInstallInfo
173
-
174
181
!insertmacro setLinkVars
175
182
176
183
!ifdef MENU_FILENAME
177
184
CreateDirectory " $SMPROGRAMS\${MENU_FILENAME}"
178
185
!endif
179
186
180
- # create shortcuts in the start menu and on the desktop
181
- # shortcut for uninstall is bad cause user can choose this by mistake during search, so, we don't add it
182
- CreateShortCut " $startMenuLink" " $appExe" " " " $appExe" 0 " " " " " ${APP_DESCRIPTION}"
183
-
184
- ${GetParameters} $R0
185
- ${GetOptions} $R0 " --no-desktop-shortcut" $R1
186
- ${If} ${Errors}
187
- CreateShortCut " $desktopLink" " $appExe" " " " $appExe" 0 " " " " " ${APP_DESCRIPTION}"
188
- ${EndIf}
189
-
190
- WinShell::SetLnkAUMI " $startMenuLink" " ${APP_ID}"
191
- WinShell::SetLnkAUMI " $desktopLink" " ${APP_ID}"
187
+ ${if} $shortcuts == " "
188
+ # create shortcuts in the start menu and on the desktop
189
+ # shortcut for uninstall is bad cause user can choose this by mistake during search, so, we don't add it
190
+ CreateShortCut " $startMenuLink" " $appExe" " " " $appExe" 0 " " " " " ${APP_DESCRIPTION}"
191
+ WinShell::SetLnkAUMI " $startMenuLink" " ${APP_ID}"
192
+
193
+ ClearErrors
194
+ ${GetParameters} $R0
195
+ ${GetOptions} $R0 " --no-desktop-shortcut" $R1
196
+ ${If} ${Errors}
197
+ CreateShortCut " $desktopLink" " $appExe" " " " $appExe" 0 " " " " " ${APP_DESCRIPTION}"
198
+ WinShell::SetLnkAUMI " $desktopLink" " ${APP_ID}"
199
+ ${endIf}
200
+ ${endif}
192
201
193
202
!ifmacrodef registerFileAssociations
194
203
!insertmacro registerFileAssociations
0 commit comments