|
@@ -13,12 +13,16 @@ ManifestDPIAware true
|
|
|
!include WordFunc.nsh
|
|
|
!include "utils.nsh"
|
|
|
!include "FileAssociation.nsh"
|
|
|
-!include "StrFunc.nsh"
|
|
|
!include "Win\COM.nsh"
|
|
|
!include "Win\Propkey.nsh"
|
|
|
+!include "StrFunc.nsh"
|
|
|
${StrCase}
|
|
|
${StrLoc}
|
|
|
|
|
|
+{{#if installer_hooks}}
|
|
|
+!include "{{installer_hooks}}"
|
|
|
+{{/if}}
|
|
|
+
|
|
|
!define MANUFACTURER "{{manufacturer}}"
|
|
|
!define PRODUCTNAME "{{product_name}}"
|
|
|
!define VERSION "{{version}}"
|
|
@@ -505,6 +509,10 @@ Section Install
|
|
|
|
|
|
!insertmacro CheckIfAppIsRunning
|
|
|
|
|
|
+ !ifdef NSIS_HOOK_PREINSTALL
|
|
|
+ !insertmacro "${NSIS_HOOK_PREINSTALL}"
|
|
|
+ !endif
|
|
|
+
|
|
|
; Copy main executable
|
|
|
File "${MAINBINARYSRCPATH}"
|
|
|
|
|
@@ -580,6 +588,10 @@ Section Install
|
|
|
${EndIf}
|
|
|
shortcuts_done:
|
|
|
|
|
|
+ !ifdef NSIS_HOOK_POSTINSTALL
|
|
|
+ !insertmacro "${NSIS_HOOK_POSTINSTALL}"
|
|
|
+ !endif
|
|
|
+
|
|
|
; Auto close this page for passive mode
|
|
|
${IfThen} $PassiveMode == 1 ${|} SetAutoClose true ${|}
|
|
|
SectionEnd
|
|
@@ -615,6 +627,10 @@ Section Uninstall
|
|
|
|
|
|
!insertmacro CheckIfAppIsRunning
|
|
|
|
|
|
+ !ifdef NSIS_HOOK_PREUNINSTALL
|
|
|
+ !insertmacro "${NSIS_HOOK_PREUNINSTALL}"
|
|
|
+ !endif
|
|
|
+
|
|
|
; Delete the app directory and its content from disk
|
|
|
; Copy main executable
|
|
|
Delete "$INSTDIR\${MAINBINARYNAME}.exe"
|
|
@@ -688,6 +704,11 @@ Section Uninstall
|
|
|
RmDir /r "$LOCALAPPDATA\${BUNDLEID}"
|
|
|
${EndIf}
|
|
|
|
|
|
+ !ifdef NSIS_HOOK_POSTUNINSTALL
|
|
|
+ !insertmacro "${NSIS_HOOK_POSTUNINSTALL}"
|
|
|
+ !endif
|
|
|
+
|
|
|
+ ; Auto close if passive mode
|
|
|
${GetOptions} $CMDLINE "/P" $R0
|
|
|
IfErrors +2 0
|
|
|
SetAutoClose true
|