Skip to content

Commit 56ba1d7

Browse files
committedSep 3, 2013
nsis: add 64 support
1 parent c8d1a0c commit 56ba1d7

File tree

3 files changed

+68
-23
lines changed

3 files changed

+68
-23
lines changed
 

‎ms-windows/QGIS-Installer.nsi

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ RequestExecutionLevel admin
2727

2828
;NSIS Includes
2929

30+
!include "x64.nsh"
3031
!include "MUI.nsh"
3132
!include "LogicLib.nsh"
3233

@@ -60,6 +61,14 @@ OutFile "${INSTALLER_NAME}"
6061
;Define installation folder
6162
InstallDir "$PROGRAMFILES\${QGIS_BASE}"
6263

64+
${If} ${RunningX64}
65+
DetailPrint "Installer running on 64-bit host"
66+
; disable registry redirection (enable access to 64-bit portion of registry)
67+
SetRegView 64
68+
; change install dir
69+
StrCpy $INSTDIR "$PROGRAMFILES64\${QGIS_BASE}"
70+
${EndIf}
71+
6372
;Tell the installer to show Install and Uninstall details as default
6473
ShowInstDetails show
6574
ShowUnInstDetails show
@@ -270,7 +279,7 @@ Section "QGIS" SecQGIS
270279

271280
SectionIn RO
272281

273-
;Added by Tim to set the reg key so we get default plugin loading
282+
;Added by Tim to set the reg key so we get default plugin loading
274283
!include plugins.nsh
275284
;Added by Tim to set the reg key so we get default python & py plugins
276285
!include python_plugins.nsh
@@ -334,7 +343,7 @@ Section "QGIS" SecQGIS
334343

335344
;Create the Desktop Shortcut
336345
SetShellVarContext current
337-
346+
338347
;Create the Windows Start Menu Shortcuts
339348
SetShellVarContext all
340349

@@ -355,24 +364,6 @@ RebootNecessary:
355364
SetRebootFlag true
356365

357366
NoRebootNecessary:
358-
Delete "$DESKTOP\QGIS (${VERSION_NUMBER}).lnk"
359-
Delete "$SMPROGRAMS\${QGIS_BASE}\QGIS (${VERSION_NUMBER}).lnk"
360-
361-
Delete "$DESKTOP\QGIS Desktop (${VERSION_NUMBER}).lnk"
362-
CreateShortCut "$DESKTOP\QGIS Desktop (${VERSION_NUMBER}).lnk" "$INSTALL_DIR\bin\nircmd.exe" 'exec hide "$INSTALL_DIR\bin\${SHORTNAME}.bat"' \
363-
"$INSTALL_DIR\icons\QGIS.ico" "" SW_SHOWNORMAL "" "Launch ${COMPLETE_NAME}"
364-
365-
Delete "$SMPROGRAMS\${QGIS_BASE}\QGIS Desktop (${VERSION_NUMBER}).lnk"
366-
CreateShortCut "$SMPROGRAMS\${QGIS_BASE}\QGIS Desktop (${VERSION_NUMBER}).lnk" "$INSTALL_DIR\bin\nircmd.exe" 'exec hide "$INSTALL_DIR\bin\${SHORTNAME}.bat"' \
367-
"$INSTALL_DIR\icons\QGIS.ico" "" SW_SHOWNORMAL "" "Launch ${COMPLETE_NAME}"
368-
369-
Delete "$DESKTOP\QGIS Browser (${VERSION_NUMBER}).lnk"
370-
CreateShortCut "$DESKTOP\QGIS Browser (${VERSION_NUMBER}).lnk" "$INSTALL_DIR\bin\nircmd.exe" 'exec hide "$INSTALL_DIR\bin\${SHORTNAME}-browser.bat"' \
371-
"$INSTALL_DIR\icons\QGIS.ico" "" SW_SHOWNORMAL "" "Launch ${COMPLETE_NAME}"
372-
373-
Delete "$SMPROGRAMS\${QGIS_BASE}\QGIS Browser (${VERSION_NUMBER}).lnk"
374-
CreateShortCut "$SMPROGRAMS\${QGIS_BASE}\QGIS Browser (${VERSION_NUMBER}).lnk" "$INSTALL_DIR\bin\nircmd.exe" 'exec hide "$INSTALL_DIR\bin\${SHORTNAME}-browser.bat"' \
375-
"$INSTALL_DIR\icons\QGIS.ico" "" SW_SHOWNORMAL "" "Launch ${COMPLETE_NAME}"
376367

377368
SectionEnd
378369

@@ -406,7 +397,7 @@ Function DownloadDataSet
406397
Pop $0
407398
StrCmp $0 "success" untar_ok untar_failed
408399

409-
untar_ok:
400+
untar_ok:
410401
Rename "$GIS_DATABASE\$ORIGINAL_UNTAR_FOLDER" "$GIS_DATABASE\$CUSTOM_UNTAR_FOLDER"
411402
Delete "$TEMP\$ARCHIVE_NAME"
412403
Goto end
@@ -434,7 +425,7 @@ Section /O "North Carolina Data Set" SecNorthCarolinaSDB
434425

435426
;Set the size (in KB) of the unpacked archive file
436427
AddSize 293314
437-
428+
438429
StrCpy $HTTP_PATH "http://grass.osgeo.org/sampledata"
439430
StrCpy $ARCHIVE_NAME "nc_spm_latest.tar.gz"
440431
StrCpy $EXTENDED_ARCHIVE_NAME "North Carolina"

‎ms-windows/osgeo4w/creatensis.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ sub getDeps {
155155
if( -d $unpacked ) {
156156
unless( $keep ) {
157157
print "Removing $unpacked directory\n" if $verbose;
158-
system "echo rm -rf $unpacked";
158+
system "rm -rf $unpacked";
159159
} else {
160160
print "Keeping $unpacked directory\n" if $verbose;
161161
}

‎ms-windows/x64.nsh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
; ---------------------
2+
; x64.nsh
3+
; ---------------------
4+
;
5+
; A few simple macros to handle installations on x64 machines.
6+
;
7+
; RunningX64 checks if the installer is running on x64.
8+
;
9+
; ${If} ${RunningX64}
10+
; MessageBox MB_OK "running on x64"
11+
; ${EndIf}
12+
;
13+
; DisableX64FSRedirection disables file system redirection.
14+
; EnableX64FSRedirection enables file system redirection.
15+
;
16+
; SetOutPath $SYSDIR
17+
; ${DisableX64FSRedirection}
18+
; File some.dll # extracts to C:\Windows\System32
19+
; ${EnableX64FSRedirection}
20+
; File some.dll # extracts to C:\Windows\SysWOW64
21+
;
22+
23+
!ifndef ___X64__NSH___
24+
!define ___X64__NSH___
25+
26+
!include LogicLib.nsh
27+
28+
!macro _RunningX64 _a _b _t _f
29+
!insertmacro _LOGICLIB_TEMP
30+
System::Call kernel32::GetCurrentProcess()i.s
31+
System::Call kernel32::IsWow64Process(is,*i.s)
32+
Pop $_LOGICLIB_TEMP
33+
!insertmacro _!= $_LOGICLIB_TEMP 0 `${_t}` `${_f}`
34+
!macroend
35+
36+
!define RunningX64 `"" RunningX64 ""`
37+
38+
!macro DisableX64FSRedirection
39+
40+
System::Call kernel32::Wow64EnableWow64FsRedirection(i0)
41+
42+
!macroend
43+
44+
!define DisableX64FSRedirection "!insertmacro DisableX64FSRedirection"
45+
46+
!macro EnableX64FSRedirection
47+
48+
System::Call kernel32::Wow64EnableWow64FsRedirection(i1)
49+
50+
!macroend
51+
52+
!define EnableX64FSRedirection "!insertmacro EnableX64FSRedirection"
53+
54+
!endif # !___X64__NSH___

0 commit comments

Comments
 (0)
Please sign in to comment.