comparison 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
comparison
equal deleted inserted replaced
830:344d15e23f6c 831:747a48996c1f
99 !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder 99 !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
100 !insertmacro MUI_PAGE_DIRECTORY 100 !insertmacro MUI_PAGE_DIRECTORY
101 !insertmacro MUI_PAGE_INSTFILES 101 !insertmacro MUI_PAGE_INSTFILES
102 !insertmacro MUI_PAGE_FINISH 102 !insertmacro MUI_PAGE_FINISH
103 103
104 !insertmacro MUI_UNPAGE_CONFIRM 104 !ifdef WRITE_UNINSTALLER
105 !insertmacro MUI_UNPAGE_INSTFILES 105 !insertmacro MUI_UNPAGE_CONFIRM
106 106 !insertmacro MUI_UNPAGE_INSTFILES
107 !endif
107 108
108 !insertmacro MUI_LANGUAGE "German" 109 !insertmacro MUI_LANGUAGE "German"
109 110
110 111
111 ;-------------------------------- 112 ;--------------------------------
112 ; Install Functions 113 ; Install Functions
113 114
114 Function ".onInit" 115 Function ".onInit"
116 !ifdef WRITE_UNINSTALLER
117 SetOutPath "c:\tmp-uninstaller"
118 WriteUninstaller "c:\tmp-uninstaller\Uninstall.exe"
119 Quit
120 !endif
121
115 ${IfNot} ${AtLeastWinVista} 122 ${IfNot} ${AtLeastWinVista}
116 MessageBox MB_OK "Windows XP und ältere Windows Versionen werden von dieser Anwendung nicht unterstützt." 123 MessageBox MB_OK "Windows XP und ältere Windows Versionen werden von dieser Anwendung nicht unterstützt."
117 Quit 124 Quit
118 ${Endif} 125 ${Endif}
119 126
155 ; The actual installation 162 ; The actual installation
156 SetOutPath "$INSTDIR" 163 SetOutPath "$INSTDIR"
157 !include "filelist.nsh" 164 !include "filelist.nsh"
158 165
159 ;Create uninstaller 166 ;Create uninstaller
160 WriteUninstaller "$INSTDIR\Uninstall.exe" 167 !ifndef WRITE_UNINSTALLER
168 File "${files_dir}${path_sep}Uninstall.exe"
169 !endif
161 170
162 ; Code below is not run on updates 171 ; Code below is not run on updates
163 StrCmp $is_update '1' done 172 StrCmp $is_update '1' done
164 173
165 WriteRegStr SHCTX "Software\${productname_short}" "" $INSTDIR 174 WriteRegStr SHCTX "Software\${productname_short}" "" $INSTDIR
203 !insertmacro MUI_STARTMENU_WRITE_END 212 !insertmacro MUI_STARTMENU_WRITE_END
204 done: 213 done:
205 214
206 SectionEnd 215 SectionEnd
207 216
217 !ifdef WRITE_UNINSTALLER
208 Section "Uninstall" 218 Section "Uninstall"
209 RMDir /r "$INSTDIR" ; TODO include uninstall files 219 RMDir /r "$INSTDIR" ; TODO include uninstall files
210 ; !include "filelist-un.nsh" 220 ; !include "filelist-un.nsh"
211 ; Delete "$INSTDIR\Uninstall.exe" 221 ; Delete "$INSTDIR\Uninstall.exe"
212 ; RMDir "$INSTDIR" 222 ; RMDir "$INSTDIR"
222 DeleteRegKey SHCTX "System\CurrentControlSet\services\eventlog\Application\${productname_short}" 232 DeleteRegKey SHCTX "System\CurrentControlSet\services\eventlog\Application\${productname_short}"
223 233
224 ; Remove uninstaller 234 ; Remove uninstaller
225 DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" 235 DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}"
226 SectionEnd 236 SectionEnd
237 !endif

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