diff packaging/trustbridge.nsi @ 831:747a48996c1f

(Issue13) Precompile uninstaller Create-dist-packge now creates a temporary installer that only writes the uninstaller. Then it excutes this installer (using wine) to create the uninstaller. That uninstaller is then packaged normaly and packaged instead of the written uninstaller.
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 24 Jul 2014 15:59:00 +0200
parents 95e14add5c50
children bd9d07c301fd
line wrap: on
line diff
--- a/packaging/trustbridge.nsi	Thu Jul 24 12:09:28 2014 +0200
+++ b/packaging/trustbridge.nsi	Thu Jul 24 15:59:00 2014 +0200
@@ -101,9 +101,10 @@
 !insertmacro MUI_PAGE_INSTFILES
 !insertmacro MUI_PAGE_FINISH
 
-!insertmacro MUI_UNPAGE_CONFIRM
-!insertmacro MUI_UNPAGE_INSTFILES
-
+!ifdef WRITE_UNINSTALLER
+  !insertmacro MUI_UNPAGE_CONFIRM
+  !insertmacro MUI_UNPAGE_INSTFILES
+!endif
 
 !insertmacro MUI_LANGUAGE "German"
 
@@ -112,6 +113,12 @@
 ; Install Functions
 
 Function ".onInit"
+  !ifdef WRITE_UNINSTALLER
+  SetOutPath "c:\tmp-uninstaller"
+  WriteUninstaller "c:\tmp-uninstaller\Uninstall.exe"
+  Quit
+  !endif
+
   ${IfNot} ${AtLeastWinVista}
     MessageBox MB_OK "Windows XP und ältere Windows Versionen werden von dieser Anwendung nicht unterstützt."
     Quit
@@ -157,7 +164,9 @@
   !include "filelist.nsh"
 
 ;Create uninstaller
-  WriteUninstaller "$INSTDIR\Uninstall.exe"
+!ifndef WRITE_UNINSTALLER
+  File "${files_dir}${path_sep}Uninstall.exe"
+!endif
 
 ; Code below is not run on updates
   StrCmp $is_update '1' done
@@ -205,6 +214,7 @@
 
 SectionEnd
 
+!ifdef WRITE_UNINSTALLER
 Section "Uninstall"
   RMDir /r "$INSTDIR" ; TODO include uninstall files
 ; !include "filelist-un.nsh"
@@ -224,3 +234,4 @@
 ; Remove uninstaller
   DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}"
 SectionEnd
+!endif

http://wald.intevation.org/projects/trustbridge/