Skip to content

Commit 3c31327

Browse files
committedJun 20, 2014
nsis installer: don't override destination path override on x86_64 (/D)
1 parent 8b85fb9 commit 3c31327

File tree

1 file changed

+50
-49
lines changed

1 file changed

+50
-49
lines changed
 

‎ms-windows/QGIS-Installer.nsi

Lines changed: 50 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ Function .onInit
9696
; disable registry redirection (enable access to 64-bit portion of registry)
9797
SetRegView 64
9898
; change install dir
99-
StrCpy $INSTDIR "$PROGRAMFILES64\${QGIS_BASE}"
99+
${If} $INSTDIR == ""
100+
StrCpy $INSTDIR "$PROGRAMFILES64\${QGIS_BASE}"
101+
${EndIf}
100102
${EndIf}
101103
${EndIf}
102104

@@ -148,18 +150,18 @@ Function .onInit
148150
StrCpy $MESSAGE_1_ "$MESSAGE_1_$\r$\n"
149151
StrCpy $MESSAGE_1_ "$MESSAGE_1_Press OK to uninstall QGIS $DISPLAYED_INSTALLED_VERSION"
150152
StrCpy $MESSAGE_1_ "$MESSAGE_1_ and install ${DISPLAYED_NAME} or Cancel to quit."
151-
153+
152154
StrCpy $MESSAGE_2_ "$MESSAGE_0_$\r$\n"
153155
StrCpy $MESSAGE_2_ "$MESSAGE_2_You are going to install an older release of ${QGIS_BASE}$\r$\n"
154156
StrCpy $MESSAGE_2_ "$MESSAGE_2_$\r$\n"
155157
StrCpy $MESSAGE_2_ "$MESSAGE_2_Press OK to uninstall QGIS $DISPLAYED_INSTALLED_VERSION"
156158
StrCpy $MESSAGE_2_ "$MESSAGE_2_ and install ${DISPLAYED_NAME} or Cancel to quit."
157-
159+
158160
StrCpy $MESSAGE_3_ "$MESSAGE_0_$\r$\n"
159161
StrCpy $MESSAGE_3_ "$MESSAGE_3_This is the latest release available.$\r$\n"
160162
StrCpy $MESSAGE_3_ "$MESSAGE_3_$\r$\n"
161163
StrCpy $MESSAGE_3_ "$MESSAGE_3_Press OK to reinstall ${DISPLAYED_NAME} or Cancel to quit."
162-
164+
163165
${If} $INSTALLED_VERSION_INT = 0
164166
${Else}
165167
${If} $INSTALLED_VERSION_INT < ${VERSION_INT}
@@ -188,7 +190,7 @@ Function .onInit
188190
quit_reinstall:
189191
Abort
190192
continue_reinstall:
191-
${EndIf}
193+
${EndIf}
192194

193195
${If} $0 = 0
194196
${Else}
@@ -205,10 +207,10 @@ FunctionEnd
205207

206208
Function CheckUpdate
207209

208-
${If} $ASK_FOR_PATH == "NO"
210+
${If} $ASK_FOR_PATH == "NO"
209211
Abort
210212
${EndIf}
211-
213+
212214
FunctionEnd
213215

214216
;----------------------------------------------------------------------------------------------------------------------------
@@ -263,7 +265,7 @@ FunctionEnd
263265
!insertmacro MUI_LANGUAGE "Dutch"
264266

265267
;----------------------------------------------------------------------------------------------------------------------------
266-
268+
267269
;Installer Sections
268270

269271
;Declares the variables for optional Sample Data Sections
@@ -277,31 +279,30 @@ Var /GLOBAL ARCHIVE_SIZE_MB
277279
Var /GLOBAL DOWNLOAD_MESSAGE_
278280

279281
Section "QGIS" SecQGIS
280-
281282
SectionIn RO
282283

283284
;Added by Tim to set the reg key so we get default plugin loading
284285
!include plugins.nsh
285286
;Added by Tim to set the reg key so we get default python & py plugins
286287
!include python_plugins.nsh
287-
288+
288289
;Set the INSTALL_DIR variable
289290
Var /GLOBAL INSTALL_DIR
290-
291-
${If} $ASK_FOR_PATH == "NO"
291+
292+
${If} $ASK_FOR_PATH == "NO"
292293
StrCpy $INSTALL_DIR "$INSTALL_PATH"
293294
${Else}
294295
StrCpy $INSTALL_DIR "$INSTDIR"
295296
${EndIf}
296-
297+
297298
;Set to try to overwrite existing files
298299
SetOverwrite try
299-
300+
300301
;Set the GIS_DATABASE directory
301302
SetShellVarContext current
302-
Var /GLOBAL GIS_DATABASE
303+
Var /GLOBAL GIS_DATABASE
303304
StrCpy $GIS_DATABASE "$DOCUMENTS\GIS DataBase"
304-
305+
305306
;Create the GIS_DATABASE directory
306307
CreateDirectory "$GIS_DATABASE"
307308

@@ -312,18 +313,18 @@ Section "QGIS" SecQGIS
312313
SetOutPath "$INSTALL_DIR"
313314
File .\Installer-Files\postinstall.bat
314315
File .\Installer-Files\preremove.bat
315-
316+
316317
;add QGIS files
317318
SetOutPath "$INSTALL_DIR"
318319
File /r ${PACKAGE_FOLDER}\*.*
319-
320+
320321
;Create the Uninstaller
321322
WriteUninstaller "$INSTALL_DIR\Uninstall-QGIS.exe"
322-
323+
323324
;Registry Key Entries
324-
325+
325326
;HKEY_LOCAL_MACHINE Install entries
326-
;Set the Name, Version and Revision of QGIS+ PublisherInfo + InstallPath
327+
;Set the Name, Version and Revision of QGIS+ PublisherInfo + InstallPath
327328
WriteRegStr HKLM "Software\${QGIS_BASE}" "Name" "${QGIS_BASE}"
328329
WriteRegStr HKLM "Software\${QGIS_BASE}" "VersionNumber" "${VERSION_NUMBER}"
329330
WriteRegStr HKLM "Software\${QGIS_BASE}" "VersionName" "${VERSION_NAME}"
@@ -332,7 +333,7 @@ Section "QGIS" SecQGIS
332333
WriteRegStr HKLM "Software\${QGIS_BASE}" "Publisher" "${PUBLISHER}"
333334
WriteRegStr HKLM "Software\${QGIS_BASE}" "WebSite" "${WEB_SITE}"
334335
WriteRegStr HKLM "Software\${QGIS_BASE}" "InstallPath" "$INSTALL_DIR"
335-
336+
336337
;HKEY_LOCAL_MACHINE Uninstall entries
337338
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${QGIS_BASE}" "DisplayName" "${COMPLETE_NAME}"
338339
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${QGIS_BASE}" "UninstallString" "$INSTALL_DIR\Uninstall-QGIS.exe"
@@ -341,15 +342,15 @@ Section "QGIS" SecQGIS
341342
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${QGIS_BASE}" "HelpLink" "${WIKI_PAGE}"
342343
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${QGIS_BASE}" "URLInfoAbout" "${WEB_SITE}"
343344
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${QGIS_BASE}" "Publisher" "${PUBLISHER}"
344-
345+
345346
;Create the Desktop Shortcut
346347
SetShellVarContext current
347348

348349
;Create the Windows Start Menu Shortcuts
349350
SetShellVarContext all
350-
351+
351352
CreateDirectory "$SMPROGRAMS\${QGIS_BASE}"
352-
353+
353354
GetFullPathName /SHORT $0 $INSTALL_DIR
354355
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("OSGEO4W_ROOT", "$0").r0'
355356
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("OSGEO4W_STARTMENU", "$SMPROGRAMS\${QGIS_BASE}").r0'
@@ -371,7 +372,7 @@ SectionEnd
371372
Function DownloadDataSet
372373

373374
IntOp $ARCHIVE_SIZE_MB $ARCHIVE_SIZE_KB / 1024
374-
375+
375376
StrCpy $DOWNLOAD_MESSAGE_ "The installer will download the $EXTENDED_ARCHIVE_NAME sample data set.$\r$\n"
376377
StrCpy $DOWNLOAD_MESSAGE_ "$DOWNLOAD_MESSAGE_$\r$\n"
377378
StrCpy $DOWNLOAD_MESSAGE_ "$DOWNLOAD_MESSAGE_The archive is about $ARCHIVE_SIZE_MB MB and may take"
@@ -382,39 +383,39 @@ Function DownloadDataSet
382383
StrCpy $DOWNLOAD_MESSAGE_ "$DOWNLOAD_MESSAGE_$\r$\n"
383384
StrCpy $DOWNLOAD_MESSAGE_ "$DOWNLOAD_MESSAGE_Press OK to continue or Cancel to skip the download and complete the ${QGIS_BASE}"
384385
StrCpy $DOWNLOAD_MESSAGE_ "$DOWNLOAD_MESSAGE_ installation without the $EXTENDED_ARCHIVE_NAME data set.$\r$\n"
385-
386+
386387
MessageBox MB_OKCANCEL "$DOWNLOAD_MESSAGE_" IDOK download IDCANCEL cancel_download
387-
388-
download:
389-
SetShellVarContext current
388+
389+
download:
390+
SetShellVarContext current
390391
InitPluginsDir
391392
NSISdl::download "$HTTP_PATH/$ARCHIVE_NAME" "$TEMP\$ARCHIVE_NAME"
392393
Pop $0
393394
StrCmp $0 "success" download_ok download_failed
394-
395-
download_ok:
395+
396+
download_ok:
396397
InitPluginsDir
397398
untgz::extract "-d" "$GIS_DATABASE" "$TEMP\$ARCHIVE_NAME"
398399
Pop $0
399400
StrCmp $0 "success" untar_ok untar_failed
400-
401+
401402
untar_ok:
402403
Rename "$GIS_DATABASE\$ORIGINAL_UNTAR_FOLDER" "$GIS_DATABASE\$CUSTOM_UNTAR_FOLDER"
403404
Delete "$TEMP\$ARCHIVE_NAME"
404405
Goto end
405-
406+
406407
download_failed:
407408
DetailPrint "$0" ;print error message to log
408409
MessageBox MB_OK "Download Failed.$\r$\n${QGIS_BASE} will be installed without the $EXTENDED_ARCHIVE_NAME sample data set."
409410
Goto end
410-
411+
411412
cancel_download:
412413
MessageBox MB_OK "Download Cancelled.$\r$\n${QGIS_BASE} will be installed without the $EXTENDED_ARCHIVE_NAME sample data set."
413414
Goto end
414-
415+
415416
untar_failed:
416417
DetailPrint "$0" ;print error message to log
417-
418+
418419
end:
419420

420421
FunctionEnd
@@ -423,7 +424,7 @@ Section /O "North Carolina Data Set" SecNorthCarolinaSDB
423424

424425
;Set the size (in KB) of the archive file
425426
StrCpy $ARCHIVE_SIZE_KB 138629
426-
427+
427428
;Set the size (in KB) of the unpacked archive file
428429
AddSize 293314
429430

@@ -432,25 +433,25 @@ Section /O "North Carolina Data Set" SecNorthCarolinaSDB
432433
StrCpy $EXTENDED_ARCHIVE_NAME "North Carolina"
433434
StrCpy $ORIGINAL_UNTAR_FOLDER "nc_spm_08"
434435
StrCpy $CUSTOM_UNTAR_FOLDER "North-Carolina"
435-
436-
Call DownloadDataSet
437-
436+
437+
Call DownloadDataSet
438+
438439
SectionEnd
439440

440441
Section /O "South Dakota (Spearfish) Data Set" SecSpearfishSDB
441442

442443
;Set the size (in KB) of the archive file
443444
StrCpy $ARCHIVE_SIZE_KB 20803
444-
445+
445446
;Set the size (in KB) of the unpacked archive file
446447
AddSize 42171
447-
448+
448449
StrCpy $HTTP_PATH "http://grass.osgeo.org/sampledata"
449450
StrCpy $ARCHIVE_NAME "spearfish_grass60data-0.3.tar.gz"
450451
StrCpy $EXTENDED_ARCHIVE_NAME "South Dakota (Spearfish)"
451452
StrCpy $ORIGINAL_UNTAR_FOLDER "spearfish60"
452453
StrCpy $CUSTOM_UNTAR_FOLDER "Spearfish60"
453-
454+
454455
Call DownloadDataSet
455456

456457
SectionEnd
@@ -459,16 +460,16 @@ Section /O "Alaska Data Set" SecAlaskaSDB
459460

460461
;Set the size (in KB) of the archive file
461462
StrCpy $ARCHIVE_SIZE_KB 10253
462-
463+
463464
;Set the size (in KB) of the unpacked archive file
464465
AddSize 33914
465-
466+
466467
StrCpy $HTTP_PATH "http://download.osgeo.org/qgis/data"
467468
StrCpy $ARCHIVE_NAME "qgis_sample_data.tar.gz"
468469
StrCpy $EXTENDED_ARCHIVE_NAME "Alaska"
469470
StrCpy $ORIGINAL_UNTAR_FOLDER "qgis_sample_data"
470471
StrCpy $CUSTOM_UNTAR_FOLDER "Alaska"
471-
472+
472473
Call DownloadDataSet
473474

474475
SectionEnd
@@ -506,13 +507,13 @@ Section "Uninstall"
506507

507508
;if empty, remove the install folder
508509
RMDir "$INSTDIR"
509-
510+
510511
;remove the Desktop ShortCut
511512
SetShellVarContext all
512513
Delete "$DESKTOP\QGIS Desktop (${VERSION_NUMBER}).lnk"
513514
Delete "$DESKTOP\QGIS Browser (${VERSION_NUMBER}).lnk"
514515
Delete "$DESKTOP\OSGeo4W.lnk"
515-
516+
516517
;remove the Programs Start ShortCut
517518
SetShellVarContext all
518519
RMDir /r "$SMPROGRAMS\${QGIS_BASE}"

0 commit comments

Comments
 (0)
Please sign in to comment.