comparison packaging/trustbridge.nsi @ 588:a4e75d90d3f6

Use latin1 in NSIS (fixes encoding errors) Fix command line installation dir.
author Andre Heinecke <aheinecke@intevation.de>
date Tue, 27 May 2014 17:27:33 +0000
parents bfcfbae151ab
children 9a18f096129d
comparison
equal deleted inserted replaced
587:02a89710a7cd 588:a4e75d90d3f6
1 ; Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik 1 ; Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
2 ; Software engineering by Intevation GmbH 2 ; Software engineering by Intevation GmbH
3 ; 3 ;
4 ; This file is Free Software under the GNU GPL (v>=2) 4 ; This file is Free Software under the GNU GPL (v>=2)
5 ; and comes with ABSOLUTELY NO WARRANTY! 5 ; and comes with ABSOLUTELY NO WARRANTY!
6 ; See LICENSE.txt for details. 6 ; See LICENSE.txt for details.
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 !include "MultiUser.nsh" 30 !include "MultiUser.nsh"
31 !include "MUI2.nsh" 31 !include "MUI2.nsh"
32 !include "FileFunc.nsh"
32 33
33 ;-------------------------------- 34 ;--------------------------------
34 ;Version Information (for installer file properties) 35 ;Version Information (for installer file properties)
35 36
36 ;VIProductVersion "${version_number}" ;needs integer format: x.x.x.x 37 ;VIProductVersion "${version_number}" ;needs integer format: x.x.x.x
64 !define MUI_UNWELCOMEFINISHPAGE_BITMAP "resources\wizard-uninstall.bmp" 65 !define MUI_UNWELCOMEFINISHPAGE_BITMAP "resources\wizard-uninstall.bmp"
65 !define MUI_ICON "resources\install.ico" 66 !define MUI_ICON "resources\install.ico"
66 !define MUI_UNICON "resources\uninstall.ico" 67 !define MUI_UNICON "resources\uninstall.ico"
67 68
68 ; MUI welcome page text 69 ; MUI welcome page text
69 !define MUI_WELCOMEPAGE_TITLE "Willkommen bei der Installation des ${productname}" 70 !define MUI_WELCOMEPAGE_TITLE "Willkommen bei der Installation von ${productname}"
70 !define MUI_WELCOMEPAGE_TEXT "Dieser Assistent wird Sie durch die Installation von \ 71 !define MUI_WELCOMEPAGE_TEXT "Dieser Assistent wird Sie durch die Installation von \
71 ${productname} begleiten. $\r$\n$\r$\n\ 72 ${productname} begleiten. $\r$\n$\r$\n\
72 ${productname} ist eine Anwendung um Wurzelzertifikate auf ihrem System \ 73 ${productname} ist eine Anwendung um Wurzelzertifikate auf ihrem System \
73 zu installieren und aktuell zu halten. $\r$\n$\r$\n\ 74 zu installieren und aktuell zu halten. $\r$\n$\r$\n\
74 Klicken Sie auf Weiter, um fortzufahren." 75 Klicken Sie auf Weiter, um fortzufahren."
86 87
87 !define MUI_FINISHPAGE_TITLE "Die Installation war erfolgreich" 88 !define MUI_FINISHPAGE_TITLE "Die Installation war erfolgreich"
88 !define MUI_FINISHPAGE_TEXT "${productname} wurde auf Ihrem \ 89 !define MUI_FINISHPAGE_TEXT "${productname} wurde auf Ihrem \
89 Computer installliert. $\r$\n$\r$\n\ 90 Computer installliert. $\r$\n$\r$\n\
90 Klicken Sie auf 'Fertig stellen', um den Installations-Assistenten\ 91 Klicken Sie auf 'Fertig stellen', um den Installations-Assistenten\
91 zu schließen." 92 zu schließen."
92 !define MUI_FINISHPAGE_RUN $INSTDIR\trustbridge.exe 93 ;!define MUI_FINISHPAGE_RUN $INSTDIR\trustbridge.exe
93 !define MUI_FINISHPAGE_RUN_TEXT "Anwendung starten" 94 ;!define MUI_FINISHPAGE_RUN_TEXT "Anwendung starten"
94 !define MUI_FINISHPAGE_RUN_FUNCTION RunAsUser 95 ;!define MUI_FINISHPAGE_RUN_FUNCTION RunAsUser
95 !define MUI_FINISHPAGE_LINK "Mehr unter http://www.bsi.bund.de" 96 !define MUI_FINISHPAGE_LINK "Mehr unter http://www.bsi.bund.de"
96 !define MUI_FINISHPAGE_LINK_LOCATION "http://www.bsi.bund.de" 97 !define MUI_FINISHPAGE_LINK_LOCATION "http://www.bsi.bund.de"
97 98
98 !insertmacro MUI_PAGE_WELCOME 99 !insertmacro MUI_PAGE_WELCOME
99 !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder 100 !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
110 111
111 ;-------------------------------- 112 ;--------------------------------
112 ; Install Functions 113 ; Install Functions
113 114
114 Function ".onInit" 115 Function ".onInit"
116 Var /GLOBAL is_update
117 Var /GLOBAL changed_dir
118 ${GetParameters} $R0
119 ClearErrors
120 ${GetOptions} $R0 /UPDATE= $is_update
121
122 ; Check if the install directory was modified on the command line
123 StrCmp "$INSTDIR" "$PROGRAMFILES\${productname_short}" unmodified 0
124 ; It is modified. Save that value.
125 StrCpy $changed_dir "$INSTDIR"
126
127 ; MULITUSER_INIT overwrites directory setting from command line
115 !insertmacro MULTIUSER_INIT 128 !insertmacro MULTIUSER_INIT
129 StrCpy $INSTDIR "$changed_dir"
130 goto initDone
131 unmodified:
132 !insertmacro MULTIUSER_INIT
133 initDone:
116 FunctionEnd 134 FunctionEnd
117 135
118 ; If we run elevated we do not want to run 136 ; If we run elevated we do not want to run
119 ; the UI elevated as this could be a security 137 ; the UI elevated as this could be a security
120 ; problem. 138 ; problem.
132 Section "" 150 Section ""
133 ; The actual installation 151 ; The actual installation
134 SetOutPath "$INSTDIR" 152 SetOutPath "$INSTDIR"
135 !include "filelist.nsh" 153 !include "filelist.nsh"
136 154
155 ;Create uninstaller
156 WriteUninstaller "$INSTDIR\Uninstall.exe"
157
158 ; Code below is not run on updates
159 StrCmp $is_update '1' done
160
137 WriteRegStr SHCTX "Software\${productname_short}" "" $INSTDIR 161 WriteRegStr SHCTX "Software\${productname_short}" "" $INSTDIR
138 162
139 ; Set up autostart 163 ; Set up autostart
140 WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Run" "TrustBridge" "$INSTDIR\trustbridge.exe --tray" 164 WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Run" "TrustBridge" "$INSTDIR\trustbridge.exe --tray"
141
142 ;Create uninstaller
143 WriteUninstaller "$INSTDIR\Uninstall.exe"
144 165
145 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application 166 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
146 167
147 ;Create shortcuts 168 ;Create shortcuts
148 CreateDirectory "$SMPROGRAMS\$StartMenuFolder" 169 CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
149 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\${productname}.lnk" "$INSTDIR\trustbridge.exe" 170 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\${productname}.lnk" "$INSTDIR\trustbridge.exe"
150 171
151 !insertmacro MUI_STARTMENU_WRITE_END 172 !insertmacro MUI_STARTMENU_WRITE_END
173 done:
152 174
153 SectionEnd 175 SectionEnd
154 176
155 Section "Uninstall" 177 Section "Uninstall"
156 RMDir /r "$INSTDIR" ; TODO include uninstall files 178 RMDir /r "$INSTDIR" ; TODO include uninstall files

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