|
@@ -9,7 +9,7 @@ ManifestDPIAwareness PerMonitorV2
|
|
!if "{{compression}}" == "none"
|
|
!if "{{compression}}" == "none"
|
|
SetCompress off
|
|
SetCompress off
|
|
!else
|
|
!else
|
|
- ; Set the compression algorithm. Default is LZMA.
|
|
|
|
|
|
+ ; Set the compression algorithm. We default to LZMA.
|
|
SetCompressor /SOLID "{{compression}}"
|
|
SetCompressor /SOLID "{{compression}}"
|
|
!endif
|
|
!endif
|
|
|
|
|
|
@@ -57,6 +57,7 @@ ${StrLoc}
|
|
!define MANUPRODUCTKEY "Software\${MANUFACTURER}\${PRODUCTNAME}"
|
|
!define MANUPRODUCTKEY "Software\${MANUFACTURER}\${PRODUCTNAME}"
|
|
!define UNINSTALLERSIGNCOMMAND "{{uninstaller_sign_cmd}}"
|
|
!define UNINSTALLERSIGNCOMMAND "{{uninstaller_sign_cmd}}"
|
|
!define ESTIMATEDSIZE "{{estimated_size}}"
|
|
!define ESTIMATEDSIZE "{{estimated_size}}"
|
|
|
|
+!define STARTMENUFOLDER "{{start_menu_folder}}"
|
|
|
|
|
|
Var PassiveMode
|
|
Var PassiveMode
|
|
Var UpdateMode
|
|
Var UpdateMode
|
|
@@ -337,7 +338,12 @@ FunctionEnd
|
|
|
|
|
|
; 6. Start menu shortcut page
|
|
; 6. Start menu shortcut page
|
|
Var AppStartMenuFolder
|
|
Var AppStartMenuFolder
|
|
-!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfPassive
|
|
|
|
|
|
+!if "${STARTMENUFOLDER}" != ""
|
|
|
|
+ !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfPassive
|
|
|
|
+ !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${STARTMENUFOLDER}"
|
|
|
|
+!else
|
|
|
|
+ !define MUI_PAGE_CUSTOMFUNCTION_PRE Skip
|
|
|
|
+!endif
|
|
!insertmacro MUI_PAGE_STARTMENU Application $AppStartMenuFolder
|
|
!insertmacro MUI_PAGE_STARTMENU Application $AppStartMenuFolder
|
|
|
|
|
|
; 7. Installation page
|
|
; 7. Installation page
|
|
@@ -722,13 +728,27 @@ Section Uninstall
|
|
|
|
|
|
; Remove start menu shortcut
|
|
; Remove start menu shortcut
|
|
!insertmacro MUI_STARTMENU_GETFOLDER Application $AppStartMenuFolder
|
|
!insertmacro MUI_STARTMENU_GETFOLDER Application $AppStartMenuFolder
|
|
- !insertmacro UnpinShortcut "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk"
|
|
|
|
- Delete "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk"
|
|
|
|
- RMDir "$SMPROGRAMS\$AppStartMenuFolder"
|
|
|
|
|
|
+ !insertmacro IsShortcutTarget "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
|
|
|
|
+ Pop $0
|
|
|
|
+ ${If} $0 = 1
|
|
|
|
+ !insertmacro UnpinShortcut "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk"
|
|
|
|
+ Delete "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk"
|
|
|
|
+ RMDir "$SMPROGRAMS\$AppStartMenuFolder"
|
|
|
|
+ ${EndIf}
|
|
|
|
+ !insertmacro IsShortcutTarget "$SMPROGRAMS\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
|
|
|
|
+ Pop $0
|
|
|
|
+ ${If} $0 = 1
|
|
|
|
+ !insertmacro UnpinShortcut "$SMPROGRAMS\${PRODUCTNAME}.lnk"
|
|
|
|
+ Delete "$SMPROGRAMS\${PRODUCTNAME}.lnk"
|
|
|
|
+ ${EndIf}
|
|
|
|
|
|
; Remove desktop shortcuts
|
|
; Remove desktop shortcuts
|
|
- !insertmacro UnpinShortcut "$DESKTOP\${PRODUCTNAME}.lnk"
|
|
|
|
- Delete "$DESKTOP\${PRODUCTNAME}.lnk"
|
|
|
|
|
|
+ !insertmacro IsShortcutTarget "$DESKTOP\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
|
|
|
|
+ Pop $0
|
|
|
|
+ ${If} $0 = 1
|
|
|
|
+ !insertmacro UnpinShortcut "$DESKTOP\${PRODUCTNAME}.lnk"
|
|
|
|
+ Delete "$DESKTOP\${PRODUCTNAME}.lnk"
|
|
|
|
+ ${EndIf}
|
|
${EndIf}
|
|
${EndIf}
|
|
|
|
|
|
; Remove registry information for add/remove programs
|
|
; Remove registry information for add/remove programs
|
|
@@ -767,6 +787,10 @@ Function RestorePreviousInstallLocation
|
|
StrCpy $INSTDIR $4
|
|
StrCpy $INSTDIR $4
|
|
FunctionEnd
|
|
FunctionEnd
|
|
|
|
|
|
|
|
+Function Skip
|
|
|
|
+ Abort
|
|
|
|
+FunctionEnd
|
|
|
|
+
|
|
Function SkipIfPassive
|
|
Function SkipIfPassive
|
|
${IfThen} $PassiveMode = 1 ${|} Abort ${|}
|
|
${IfThen} $PassiveMode = 1 ${|} Abort ${|}
|
|
FunctionEnd
|
|
FunctionEnd
|
|
@@ -774,8 +798,23 @@ FunctionEnd
|
|
Function CreateOrUpdateStartMenuShortcut
|
|
Function CreateOrUpdateStartMenuShortcut
|
|
; We used to use product name as MAINBINARYNAME
|
|
; We used to use product name as MAINBINARYNAME
|
|
; migrate old shortcuts to target the new MAINBINARYNAME
|
|
; migrate old shortcuts to target the new MAINBINARYNAME
|
|
- ${If} ${FileExists} "$DESKTOP\${PRODUCTNAME}.lnk"
|
|
|
|
- !insertmacro SetShortcutTarget "$DESKTOP\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
|
|
|
|
|
|
+ StrCpy $R0 0
|
|
|
|
+
|
|
|
|
+ !insertmacro IsShortcutTarget "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCTNAME}.exe"
|
|
|
|
+ Pop $0
|
|
|
|
+ ${If} $0 = 1
|
|
|
|
+ !insertmacro SetShortcutTarget "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
|
|
|
|
+ StrCpy $R0 1
|
|
|
|
+ ${EndIf}
|
|
|
|
+
|
|
|
|
+ !insertmacro IsShortcutTarget "$SMPROGRAMS\${PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCTNAME}.exe"
|
|
|
|
+ Pop $0
|
|
|
|
+ ${If} $0 = 1
|
|
|
|
+ !insertmacro SetShortcutTarget "$SMPROGRAMS\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
|
|
|
|
+ StrCpy $R0 1
|
|
|
|
+ ${EndIf}
|
|
|
|
+
|
|
|
|
+ ${If} $R0 = 1
|
|
Return
|
|
Return
|
|
${EndIf}
|
|
${EndIf}
|
|
|
|
|
|
@@ -785,16 +824,23 @@ Function CreateOrUpdateStartMenuShortcut
|
|
Return
|
|
Return
|
|
${EndIf}
|
|
${EndIf}
|
|
|
|
|
|
- CreateDirectory "$SMPROGRAMS\$AppStartMenuFolder"
|
|
|
|
- CreateShortcut "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
|
|
|
|
- !insertmacro SetLnkAppUserModelId "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk"
|
|
|
|
|
|
+ !if "${STARTMENUFOLDER}" != ""
|
|
|
|
+ CreateDirectory "$SMPROGRAMS\$AppStartMenuFolder"
|
|
|
|
+ CreateShortcut "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
|
|
|
|
+ !insertmacro SetLnkAppUserModelId "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk"
|
|
|
|
+ !else
|
|
|
|
+ CreateShortcut "$SMPROGRAMS\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
|
|
|
|
+ !insertmacro SetLnkAppUserModelId "$SMPROGRAMS\${PRODUCTNAME}.lnk"
|
|
|
|
+ !endif
|
|
FunctionEnd
|
|
FunctionEnd
|
|
|
|
|
|
Function CreateOrUpdateDesktopShortcut
|
|
Function CreateOrUpdateDesktopShortcut
|
|
; We used to use product name as MAINBINARYNAME
|
|
; We used to use product name as MAINBINARYNAME
|
|
; migrate old shortcuts to target the new MAINBINARYNAME
|
|
; migrate old shortcuts to target the new MAINBINARYNAME
|
|
- ${If} ${FileExists} "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk"
|
|
|
|
- !insertmacro SetShortcutTarget "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
|
|
|
|
|
|
+ !insertmacro IsShortcutTarget "$DESKTOP\${PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCTNAME}.exe"
|
|
|
|
+ Pop $0
|
|
|
|
+ ${If} $0 = 1
|
|
|
|
+ !insertmacro SetShortcutTarget "$DESKTOP\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
|
|
Return
|
|
Return
|
|
${EndIf}
|
|
${EndIf}
|
|
|
|
|