~stomato463/+junk/nvdajp

« back to all changes in this revision

Viewing changes to installer/nvda.nsi

  • Committer: Masataka Shinke
  • Date: 2011-10-25 12:35:26 UTC
  • mfrom: (4185 jpmain)
  • mto: This revision was merged to the branch mainline in revision 4211.
  • Revision ID: mshinke@users.sourceforge.jp-20111025123526-ze527a2rl3z0g2ky
lp:~nishimotz/nvdajp/main : 4185 をマージ

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
;Settings
16
16
 
17
17
;defines for product info and paths
18
 
!define VERSION "main-3493j_installer"
19
18
!define PRODUCT "NVDA"  ; Don't change this for no reason, other instructions depend on this constant
20
 
!define PUBLISHER "unknown"
21
19
!define WEBSITE "www.nvda-project.org"
22
20
!define NVDAWindowClass "wxWindowClassNR"
23
21
!define NVDAWindowTitle "NVDA"
24
22
!define NVDAApp "nvda.exe"
25
23
!define NVDATempDir "_nvda_temp_"
26
 
!define NVDASourceDir "..\source\dist"
27
24
!define SNDLogo "nvda_logo.wav"
28
25
!define INSTDIR_REG_ROOT "HKLM"
29
26
!define INSTDIR_REG_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}"
42
39
!define MUI_UNINSTALLER ;We want an uninstaller to be generated
43
40
 
44
41
;product branding
45
 
OutFile "${PRODUCT}_${VERSION}.exe"
46
42
InstallDir "$PROGRAMFILES\${PRODUCT}"
47
43
InstallDirRegKey ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "InstallDir"
48
44
Name "NVDA"
49
45
VIProductVersion "0.0.0.0" ;Needs to be here so other version info shows up
50
46
VIAddVersionKey "ProductName" "${PRODUCT}"
51
 
VIAddVersionKey "LegalCopyright" "Copyright 2006 - 2010 NVDA Contributors"
 
47
VIAddVersionKey "LegalCopyright" "Copyright 2006 - 2011 NVDA Contributors"
52
48
VIAddVersionKey "FileDescription" "NVDA installer file"
53
49
VIAddVersionKey "ProductVersion" "${VERSION}"
54
50
 
134
130
!insertmacro MUI_LANGUAGE "Galician"
135
131
!insertmacro MUI_LANGUAGE "Dutch"
136
132
!insertmacro MUI_LANGUAGE "Arabic"
 
133
!insertmacro MUI_LANGUAGE "Danish"
 
134
!insertmacro MUI_LANGUAGE "Icelandic"
 
135
!insertmacro MUI_LANGUAGE "Serbian"
 
136
!insertmacro MUI_LANGUAGE "Turkish"
 
137
!insertmacro MUI_LANGUAGE "Albanian"
 
138
!insertmacro MUI_LANGUAGE "Bulgarian"
137
139
 
138
140
;Include installer specific language strings
139
141
!include "locale\ar\langstrings.txt"
 
142
!include "locale\bg\langstrings.txt"
140
143
!include "locale\cs\langstrings.txt"
 
144
!include "locale\da\langstrings.txt"
141
145
!include "locale\de\langstrings.txt"
142
146
!include "locale\en\langstrings.txt"
143
147
!include "locale\es_es\langstrings.txt"
147
151
!include "locale\gl\langstrings.txt"
148
152
!include "locale\hu\langstrings.txt"
149
153
!include "locale\hr\langstrings.txt"
 
154
!include "locale\is\langstrings.txt"
150
155
!include "locale\it\langstrings.txt"
151
156
!include "locale\ja\langstrings.txt"
152
157
!include "locale\nl\langstrings.txt"
154
159
!include "locale\pt_pt\langstrings.txt"
155
160
!include "locale\pt_br\langstrings.txt"
156
161
!include "locale\ru\langstrings.txt"
157
 
;!include "locale\se\langstrings.txt"
 
162
;!include "locale\sv\langstrings.txt"
158
163
!include "locale\sk\langstrings.txt"
 
164
!include "locale\sr\langstrings.txt"
 
165
!include "locale\sq\langstrings.txt"
 
166
!include "locale\tr\langstrings.txt"
159
167
!include "locale\zh\langstrings.txt"
160
168
!include "locale\zh_tw\langstrings.txt"
161
169
 
176
184
;-----
177
185
;Global variables
178
186
 
179
 
Var oldNVDAWindowHandle
180
187
var runAppOnInstSuccess
181
188
var hmci
182
189
var prevUninstallChoice
216
223
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\${PRODUCT}.lnk" "$INSTDIR\${PRODUCT}.exe" "" "$INSTDIR\${PRODUCT}.exe" 0 SW_SHOWNORMAL
217
224
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(shortcut_exploreUserConfigDir).lnk" "$INSTDIR\nvda_slave.exe" "explore_userConfigPath" "" 0 SW_SHOWNORMAL
218
225
CreateDirectory "$SMPROGRAMS\$StartMenuFolder\$(docFolder)"
219
 
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(docFolder)\$(shortcut_readme).lnk" "$INSTDIR\documentation\$(path_readmefile)" "" "$INSTDIR\documentation\$(path_readmefile)" 0 SW_SHOWMAXIMIZED
220
226
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(docFolder)\$(shortcut_keycom).lnk" "$INSTDIR\documentation\$(path_keycomfile)" "" "$INSTDIR\documentation\$(path_keycomfile)" 0 SW_SHOWMAXIMIZED
221
227
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(docFolder)\$(shortcut_userguide).lnk" "$INSTDIR\documentation\$(path_userguide)" "" "$INSTDIR\documentation\$(path_userguide)" 0 SW_SHOWMAXIMIZED
222
228
WriteIniStr "$INSTDIR\${PRODUCT}.url" "InternetShortcut" "URL" "${WEBSITE}"
227
233
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "InstallDir" "$INSTDIR"
228
234
WriteRegStr ${INSTDIR_REG_ROOT} ${INSTDIR_REG_KEY} "DisplayName" "${PRODUCT} ${VERSION}"
229
235
WriteRegStr ${INSTDIR_REG_ROOT} ${INSTDIR_REG_KEY} "DisplayVersion" "${VERSION}"
230
 
WriteRegStr ${INSTDIR_REG_ROOT} ${INSTDIR_REG_KEY} "DisplayIcon" "$INSTDIR\images\nvda.ico"
 
236
WriteRegStr ${INSTDIR_REG_ROOT} ${INSTDIR_REG_KEY} "DisplayIcon" "$INSTDIR\images\nvdajp.ico"
231
237
WriteRegStr ${INSTDIR_REG_ROOT} ${INSTDIR_REG_KEY} "URLInfoAbout" "http://www.nvda-project.org/"
232
238
WriteRegStr ${INSTDIR_REG_ROOT} ${INSTDIR_REG_KEY} "Publisher" "${PUBLISHER}"
233
239
WriteRegStr ${INSTDIR_REG_ROOT} ${INSTDIR_REG_KEY} "UninstallString" "$INSTDIR\Uninstall.exe"
240
246
SectionEnd
241
247
 
242
248
section "$(section_desktopShortcut)"
243
 
CreateShortCut "$DESKTOP\${PRODUCT}.lnk" "$INSTDIR\${PRODUCT}.exe" "" "$INSTDIR\${PRODUCT}.exe" 0 SW_SHOWNORMAL \
 
249
CreateShortCut "$DESKTOP\${PRODUCT}.lnk" "$INSTDIR\nvda_slave.exe" "launchNVDA -r" "$INSTDIR\${PRODUCT}.exe" 0 SW_SHOWNORMAL \
244
250
 CONTROL|ALT|N "Shortcut Ctrl+Alt+N"
245
251
SectionEnd
246
252
 
289
295
Delete "$PROGRAMFILES\NVDA"
290
296
; Get the locale language ID from kernel32.dll and dynamically change language of the installer
291
297
System::Call 'kernel32::GetUserDefaultUILanguage() i .r0'
 
298
;Force zh-HK to zh-TW as zh-HK uses wrong encoding on Vista/7 #1596 
 
299
StrCmp $0 "3076" 0 +2
 
300
StrCpy $0 "1028"
292
301
StrCpy $LANGUAGE $0
293
302
 
294
303
;prepare log always within .onInit function
308
317
Call PlaySound
309
318
 
310
319
File /r "${NVDASourceDir}\"
311
 
;If NVDA is already running, kill it first before starting a new copy
312
 
call isNVDARunning
313
 
pop $1  ; TRUE or FALSE
314
 
pop $oldNVDAWindowHandle
315
 
; Shut down NVDA
316
 
IntCmp $1 1 +1 Continue
317
 
MessageBox MB_OK $(msg_NVDARunning)
318
 
Continue:
319
320
IfFileExists "$APPDATA\nvda\nvda.ini" +1 +4
320
321
GetFullPathName /SHORT $0 "$APPDATA\nvda"
321
322
ExecShell "open" "$PLUGINSDIR\${NVDATempDir}\${NVDAApp}" "-r -m -c $0" SW_SHOWNORMAL
380
381
pop $1
381
382
pop $2
382
383
intcmp $1 1 +1 End
383
 
intcmp $2 $oldNVDAWindowHandle End +1
384
384
System::Call 'user32.dll::GetWindowThreadProcessId(i r2, *i .r3) i .r4'
385
385
System::Call 'kernel32.dll::OpenProcess(i 1048576, i 0, i r3) i .r4'
386
386
System::Call 'user32.dll::PostMessage(i r2, i ${WM_QUIT}, i 0, i 0)'
423
423
;!insertmacro MUI_UNGETLANGUAGE
424
424
; Get the locale language ID from kernel32.dll and dynamically change language of the installer
425
425
System::Call 'kernel32::GetUserDefaultUILanguage() i .r0'
 
426
;Force zh-HK to zh-TW as zh-HK uses wrong encoding on Vista/7 #1596 
 
427
StrCmp $0 "3076" 0 +2
 
428
StrCpy $0 "1028"
426
429
StrCpy $LANGUAGE $0
427
430
 
428
431
; Start uninstalling with a log