@@ -96,7 +96,9 @@ Function .onInit
96
96
; disable registry redirection (enable access to 64-bit portion of registry)
97
97
SetRegView 64
98
98
; change install dir
99
- StrCpy $INSTDIR " $PROGRAMFILES64\${QGIS_BASE}"
99
+ ${If} $INSTDIR == " "
100
+ StrCpy $INSTDIR " $PROGRAMFILES64\${QGIS_BASE}"
101
+ ${EndIf}
100
102
${EndIf}
101
103
${EndIf}
102
104
@@ -148,18 +150,18 @@ Function .onInit
148
150
StrCpy $MESSAGE_1_ " $MESSAGE_1_$\r$\n "
149
151
StrCpy $MESSAGE_1_ " $MESSAGE_1_Press OK to uninstall QGIS $DISPLAYED_INSTALLED_VERSION"
150
152
StrCpy $MESSAGE_1_ " $MESSAGE_1_ and install ${DISPLAYED_NAME} or Cancel to quit."
151
-
153
+
152
154
StrCpy $MESSAGE_2_ " $MESSAGE_0_$\r$\n "
153
155
StrCpy $MESSAGE_2_ " $MESSAGE_2_You are going to install an older release of ${QGIS_BASE}$\r$\n "
154
156
StrCpy $MESSAGE_2_ " $MESSAGE_2_$\r$\n "
155
157
StrCpy $MESSAGE_2_ " $MESSAGE_2_Press OK to uninstall QGIS $DISPLAYED_INSTALLED_VERSION"
156
158
StrCpy $MESSAGE_2_ " $MESSAGE_2_ and install ${DISPLAYED_NAME} or Cancel to quit."
157
-
159
+
158
160
StrCpy $MESSAGE_3_ " $MESSAGE_0_$\r$\n "
159
161
StrCpy $MESSAGE_3_ " $MESSAGE_3_This is the latest release available.$\r$\n "
160
162
StrCpy $MESSAGE_3_ " $MESSAGE_3_$\r$\n "
161
163
StrCpy $MESSAGE_3_ " $MESSAGE_3_Press OK to reinstall ${DISPLAYED_NAME} or Cancel to quit."
162
-
164
+
163
165
${If} $INSTALLED_VERSION_INT = 0
164
166
${Else}
165
167
${If} $INSTALLED_VERSION_INT < ${VERSION_INT}
@@ -188,7 +190,7 @@ Function .onInit
188
190
quit_reinstall:
189
191
Abort
190
192
continue_reinstall:
191
- ${EndIf}
193
+ ${EndIf}
192
194
193
195
${If} $0 = 0
194
196
${Else}
@@ -205,10 +207,10 @@ FunctionEnd
205
207
206
208
Function CheckUpdate
207
209
208
- ${If} $ASK_FOR_PATH == " NO"
210
+ ${If} $ASK_FOR_PATH == " NO"
209
211
Abort
210
212
${EndIf}
211
-
213
+
212
214
FunctionEnd
213
215
214
216
; ----------------------------------------------------------------------------------------------------------------------------
@@ -263,7 +265,7 @@ FunctionEnd
263
265
!insertmacro MUI_LANGUAGE " Dutch"
264
266
265
267
; ----------------------------------------------------------------------------------------------------------------------------
266
-
268
+
267
269
; Installer Sections
268
270
269
271
; Declares the variables for optional Sample Data Sections
@@ -277,31 +279,30 @@ Var /GLOBAL ARCHIVE_SIZE_MB
277
279
Var /GLOBAL DOWNLOAD_MESSAGE_
278
280
279
281
Section " QGIS" SecQGIS
280
-
281
282
SectionIn RO
282
283
283
284
; Added by Tim to set the reg key so we get default plugin loading
284
285
!include plugins.nsh
285
286
; Added by Tim to set the reg key so we get default python & py plugins
286
287
!include python_plugins.nsh
287
-
288
+
288
289
; Set the INSTALL_DIR variable
289
290
Var /GLOBAL INSTALL_DIR
290
-
291
- ${If} $ASK_FOR_PATH == " NO"
291
+
292
+ ${If} $ASK_FOR_PATH == " NO"
292
293
StrCpy $INSTALL_DIR " $INSTALL_PATH"
293
294
${Else}
294
295
StrCpy $INSTALL_DIR " $INSTDIR"
295
296
${EndIf}
296
-
297
+
297
298
; Set to try to overwrite existing files
298
299
SetOverwrite try
299
-
300
+
300
301
; Set the GIS_DATABASE directory
301
302
SetShellVarContext current
302
- Var /GLOBAL GIS_DATABASE
303
+ Var /GLOBAL GIS_DATABASE
303
304
StrCpy $GIS_DATABASE " $DOCUMENTS\GIS DataBase"
304
-
305
+
305
306
; Create the GIS_DATABASE directory
306
307
CreateDirectory " $GIS_DATABASE"
307
308
@@ -312,18 +313,18 @@ Section "QGIS" SecQGIS
312
313
SetOutPath " $INSTALL_DIR"
313
314
File .\Installer-Files\postinstall.bat
314
315
File .\Installer-Files\preremove.bat
315
-
316
+
316
317
; add QGIS files
317
318
SetOutPath " $INSTALL_DIR"
318
319
File /r ${PACKAGE_FOLDER} \*.*
319
-
320
+
320
321
; Create the Uninstaller
321
322
WriteUninstaller " $INSTALL_DIR\Uninstall-QGIS.exe"
322
-
323
+
323
324
; Registry Key Entries
324
-
325
+
325
326
; 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
327
328
WriteRegStr HKLM " Software\${QGIS_BASE}" " Name" " ${QGIS_BASE}"
328
329
WriteRegStr HKLM " Software\${QGIS_BASE}" " VersionNumber" " ${VERSION_NUMBER}"
329
330
WriteRegStr HKLM " Software\${QGIS_BASE}" " VersionName" " ${VERSION_NAME}"
@@ -332,7 +333,7 @@ Section "QGIS" SecQGIS
332
333
WriteRegStr HKLM " Software\${QGIS_BASE}" " Publisher" " ${PUBLISHER}"
333
334
WriteRegStr HKLM " Software\${QGIS_BASE}" " WebSite" " ${WEB_SITE}"
334
335
WriteRegStr HKLM " Software\${QGIS_BASE}" " InstallPath" " $INSTALL_DIR"
335
-
336
+
336
337
; HKEY_LOCAL_MACHINE Uninstall entries
337
338
WriteRegStr HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${QGIS_BASE}" " DisplayName" " ${COMPLETE_NAME}"
338
339
WriteRegStr HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${QGIS_BASE}" " UninstallString" " $INSTALL_DIR\Uninstall-QGIS.exe"
@@ -341,15 +342,15 @@ Section "QGIS" SecQGIS
341
342
WriteRegStr HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${QGIS_BASE}" " HelpLink" " ${WIKI_PAGE}"
342
343
WriteRegStr HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${QGIS_BASE}" " URLInfoAbout" " ${WEB_SITE}"
343
344
WriteRegStr HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${QGIS_BASE}" " Publisher" " ${PUBLISHER}"
344
-
345
+
345
346
; Create the Desktop Shortcut
346
347
SetShellVarContext current
347
348
348
349
; Create the Windows Start Menu Shortcuts
349
350
SetShellVarContext all
350
-
351
+
351
352
CreateDirectory " $SMPROGRAMS\${QGIS_BASE}"
352
-
353
+
353
354
GetFullPathName /SHORT $0 $INSTALL_DIR
354
355
System::Call ' Kernel32::SetEnvironmentVariableA(t, t) i("OSGEO4W_ROOT", "$0").r0'
355
356
System::Call ' Kernel32::SetEnvironmentVariableA(t, t) i("OSGEO4W_STARTMENU", "$SMPROGRAMS\${QGIS_BASE}").r0'
@@ -371,7 +372,7 @@ SectionEnd
371
372
Function DownloadDataSet
372
373
373
374
IntOp $ARCHIVE_SIZE_MB $ARCHIVE_SIZE_KB / 1024
374
-
375
+
375
376
StrCpy $DOWNLOAD_MESSAGE_ " The installer will download the $EXTENDED_ARCHIVE_NAME sample data set.$\r$\n "
376
377
StrCpy $DOWNLOAD_MESSAGE_ " $DOWNLOAD_MESSAGE_$\r$\n "
377
378
StrCpy $DOWNLOAD_MESSAGE_ " $DOWNLOAD_MESSAGE_The archive is about $ARCHIVE_SIZE_MB MB and may take"
@@ -382,39 +383,39 @@ Function DownloadDataSet
382
383
StrCpy $DOWNLOAD_MESSAGE_ " $DOWNLOAD_MESSAGE_$\r$\n "
383
384
StrCpy $DOWNLOAD_MESSAGE_ " $DOWNLOAD_MESSAGE_Press OK to continue or Cancel to skip the download and complete the ${QGIS_BASE}"
384
385
StrCpy $DOWNLOAD_MESSAGE_ " $DOWNLOAD_MESSAGE_ installation without the $EXTENDED_ARCHIVE_NAME data set.$\r$\n "
385
-
386
+
386
387
MessageBox MB_OKCANCEL " $DOWNLOAD_MESSAGE_" IDOK download IDCANCEL cancel_download
387
-
388
- download:
389
- SetShellVarContext current
388
+
389
+ download:
390
+ SetShellVarContext current
390
391
InitPluginsDir
391
392
NSISdl::download " $HTTP_PATH/$ARCHIVE_NAME" " $TEMP\$ARCHIVE_NAME"
392
393
Pop $0
393
394
StrCmp $0 " success" download_ok download_failed
394
-
395
- download_ok:
395
+
396
+ download_ok:
396
397
InitPluginsDir
397
398
untgz::extract " -d" " $GIS_DATABASE" " $TEMP\$ARCHIVE_NAME"
398
399
Pop $0
399
400
StrCmp $0 " success" untar_ok untar_failed
400
-
401
+
401
402
untar_ok:
402
403
Rename " $GIS_DATABASE\$ORIGINAL_UNTAR_FOLDER" " $GIS_DATABASE\$CUSTOM_UNTAR_FOLDER"
403
404
Delete " $TEMP\$ARCHIVE_NAME"
404
405
Goto end
405
-
406
+
406
407
download_failed:
407
408
DetailPrint " $0" ; print error message to log
408
409
MessageBox MB_OK " Download Failed.$\r$\n ${QGIS_BASE} will be installed without the $EXTENDED_ARCHIVE_NAME sample data set."
409
410
Goto end
410
-
411
+
411
412
cancel_download:
412
413
MessageBox MB_OK " Download Cancelled.$\r$\n ${QGIS_BASE} will be installed without the $EXTENDED_ARCHIVE_NAME sample data set."
413
414
Goto end
414
-
415
+
415
416
untar_failed:
416
417
DetailPrint " $0" ; print error message to log
417
-
418
+
418
419
end:
419
420
420
421
FunctionEnd
@@ -423,7 +424,7 @@ Section /O "North Carolina Data Set" SecNorthCarolinaSDB
423
424
424
425
; Set the size (in KB) of the archive file
425
426
StrCpy $ARCHIVE_SIZE_KB 138629
426
-
427
+
427
428
; Set the size (in KB) of the unpacked archive file
428
429
AddSize 293314
429
430
@@ -432,25 +433,25 @@ Section /O "North Carolina Data Set" SecNorthCarolinaSDB
432
433
StrCpy $EXTENDED_ARCHIVE_NAME " North Carolina"
433
434
StrCpy $ORIGINAL_UNTAR_FOLDER " nc_spm_08"
434
435
StrCpy $CUSTOM_UNTAR_FOLDER " North-Carolina"
435
-
436
- Call DownloadDataSet
437
-
436
+
437
+ Call DownloadDataSet
438
+
438
439
SectionEnd
439
440
440
441
Section /O " South Dakota (Spearfish) Data Set" SecSpearfishSDB
441
442
442
443
; Set the size (in KB) of the archive file
443
444
StrCpy $ARCHIVE_SIZE_KB 20803
444
-
445
+
445
446
; Set the size (in KB) of the unpacked archive file
446
447
AddSize 42171
447
-
448
+
448
449
StrCpy $HTTP_PATH " http://grass.osgeo.org/sampledata"
449
450
StrCpy $ARCHIVE_NAME " spearfish_grass60data-0.3.tar.gz"
450
451
StrCpy $EXTENDED_ARCHIVE_NAME " South Dakota (Spearfish)"
451
452
StrCpy $ORIGINAL_UNTAR_FOLDER " spearfish60"
452
453
StrCpy $CUSTOM_UNTAR_FOLDER " Spearfish60"
453
-
454
+
454
455
Call DownloadDataSet
455
456
456
457
SectionEnd
@@ -459,16 +460,16 @@ Section /O "Alaska Data Set" SecAlaskaSDB
459
460
460
461
; Set the size (in KB) of the archive file
461
462
StrCpy $ARCHIVE_SIZE_KB 10253
462
-
463
+
463
464
; Set the size (in KB) of the unpacked archive file
464
465
AddSize 33914
465
-
466
+
466
467
StrCpy $HTTP_PATH " http://download.osgeo.org/qgis/data"
467
468
StrCpy $ARCHIVE_NAME " qgis_sample_data.tar.gz"
468
469
StrCpy $EXTENDED_ARCHIVE_NAME " Alaska"
469
470
StrCpy $ORIGINAL_UNTAR_FOLDER " qgis_sample_data"
470
471
StrCpy $CUSTOM_UNTAR_FOLDER " Alaska"
471
-
472
+
472
473
Call DownloadDataSet
473
474
474
475
SectionEnd
@@ -506,13 +507,13 @@ Section "Uninstall"
506
507
507
508
; if empty, remove the install folder
508
509
RMDir " $INSTDIR"
509
-
510
+
510
511
; remove the Desktop ShortCut
511
512
SetShellVarContext all
512
513
Delete " $DESKTOP\QGIS Desktop (${VERSION_NUMBER}).lnk"
513
514
Delete " $DESKTOP\QGIS Browser (${VERSION_NUMBER}).lnk"
514
515
Delete " $DESKTOP\OSGeo4W.lnk"
515
-
516
+
516
517
; remove the Programs Start ShortCut
517
518
SetShellVarContext all
518
519
RMDir /r " $SMPROGRAMS\${QGIS_BASE}"
0 commit comments