comparison packaging/trustbridge.nsi @ 1118:fd85a02d771d

(issue54) Implement a privilege drop to execute the program after installation. This commit is extremly ugly as I accidentally worked in a working tree that was partially merged with default. To review the real change please check the commit that will merge this branch into default.
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 16 Sep 2014 19:45:19 +0200
parents 1c1964c27b39
children fd2194295218
comparison
equal deleted inserted replaced
1117:5b6203f78b4e 1118:fd85a02d771d
25 !define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME "" 25 !define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME ""
26 !define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "Software\${productname_short}" 26 !define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "Software\${productname_short}"
27 !define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME "" 27 !define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME ""
28 !define MULTIUSER_INSTALLMODE_INSTDIR "${productname_short}" 28 !define MULTIUSER_INSTALLMODE_INSTDIR "${productname_short}"
29 29
30 !addplugindir "${plugin_dir}"
31
30 !include "MultiUser.nsh" 32 !include "MultiUser.nsh"
31 !include "MUI2.nsh" 33 !include "MUI2.nsh"
32 !include "FileFunc.nsh" 34 !include "FileFunc.nsh"
33 !include "WinVer.nsh" 35 !include "WinVer.nsh"
34 36
91 !define MUI_FINISHPAGE_TITLE "Die Installation war erfolgreich" 93 !define MUI_FINISHPAGE_TITLE "Die Installation war erfolgreich"
92 !define MUI_FINISHPAGE_TEXT "${productname} wurde auf Ihrem \ 94 !define MUI_FINISHPAGE_TEXT "${productname} wurde auf Ihrem \
93 Computer installliert. $\r$\n$\r$\n\ 95 Computer installliert. $\r$\n$\r$\n\
94 Klicken Sie auf 'Fertig stellen', um den Installations-Assistenten\ 96 Klicken Sie auf 'Fertig stellen', um den Installations-Assistenten\
95 zu schließen." 97 zu schließen."
96 ;!define MUI_FINISHPAGE_RUN $INSTDIR\trustbridge.exe 98 !define MUI_FINISHPAGE_RUN $INSTDIR\trustbridge.exe
97 ;!define MUI_FINISHPAGE_RUN_TEXT "Anwendung starten" 99 !define MUI_FINISHPAGE_RUN_TEXT "Anwendung starten"
98 ;!define MUI_FINISHPAGE_RUN_FUNCTION RunAsUser 100 !define MUI_FINISHPAGE_RUN_FUNCTION RunAsUser
99 !define MUI_FINISHPAGE_LINK "Mehr unter ${info_url}" 101 !define MUI_FINISHPAGE_LINK "Mehr unter ${info_url}"
100 !define MUI_FINISHPAGE_LINK_LOCATION "${info_url}" 102 !define MUI_FINISHPAGE_LINK_LOCATION "${info_url}"
101 103
102 !insertmacro MUI_PAGE_WELCOME 104 !insertmacro MUI_PAGE_WELCOME
103 !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder 105 !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
184 186
185 ; If we run elevated we do not want to run 187 ; If we run elevated we do not want to run
186 ; the UI elevated as this could be a security 188 ; the UI elevated as this could be a security
187 ; problem. 189 ; problem.
188 Function RunAsUser 190 Function RunAsUser
189 ExecShell "" "$INSTDIR\trustbridge.exe" 191 DesktopShellRun::Exec "$INSTDIR\trustbridge.exe"
190 FunctionEnd 192 FunctionEnd
191 193
192 ;-------------------------------- 194 ;--------------------------------
193 ; UnInstall Functions 195 ; UnInstall Functions
194 196
256 CreateDirectory "$SMPROGRAMS\$StartMenuFolder" 258 CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
257 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\${productname}.lnk" "$INSTDIR\trustbridge.exe" 259 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\${productname}.lnk" "$INSTDIR\trustbridge.exe"
258 260
259 !insertmacro MUI_STARTMENU_WRITE_END 261 !insertmacro MUI_STARTMENU_WRITE_END
260 done: 262 done:
263 StrCmp $is_update '1' run_silent dont_run
264 run_silent:
265 dont_run:
261 266
262 SectionEnd 267 SectionEnd
263 268
264 !ifdef WRITE_UNINSTALLER 269 !ifdef WRITE_UNINSTALLER
265 Section "Uninstall" 270 Section "Uninstall"

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