Skip to content

Commit f440b60

Browse files
committed
osgeo4w: backport packaging updates to 1.8.0
1 parent 3d2bcfc commit f440b60

File tree

5 files changed

+89
-63
lines changed

5 files changed

+89
-63
lines changed

ms-windows/QGIS-Installer.nsi

Lines changed: 52 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -119,27 +119,27 @@ ShowUnInstDetails show
119119

120120
;----------------------------------------------------------------------------------------------------------------------------
121121

122-
;.onInit Function (called when the installer is nearly finished initializing)
122+
; .onInit Function (called when the installer is nearly finished initializing)
123123

124-
;Check if QGIS is already installed on the system and, if yes, what version and binary release;
125-
;depending on that, select the install procedure:
124+
; Check if QGIS is already installed on the system and, if yes, what version and binary release;
125+
; depending on that, select the install procedure:
126126

127-
;1. first installation = if QGIS is not already installed
128-
;install QGIS asking for the install PATH
127+
; 1. first installation = if QGIS is not already installed
128+
; install QGIS asking for the install PATH
129129

130-
;2. upgrade installation = if an older release of QGIS is already installed
131-
;call the uninstaller of the currently installed QGIS release
132-
;if the uninstall procedure succeeded, call the current installer without asking for the install PATH
133-
;QGIS will be installed in the same PATH of the previous installation
130+
; 2. upgrade installation = if an older release of QGIS is already installed
131+
; call the uninstaller of the currently installed QGIS release
132+
; if the uninstall procedure succeeded, call the current installer without asking for the install PATH
133+
; QGIS will be installed in the same PATH of the previous installation
134134

135-
;3. downgrade installation = if a newer release of QGIS is already installed
136-
;call the uninstaller of the currently installed QGIS release
137-
;if the uninstall procedure succeeded, call the current installer without asking for the install PATH
138-
;QGIS will be installed in the same PATH of the previous installation
135+
; 3. downgrade installation = if a newer release of QGIS is already installed
136+
; call the uninstaller of the currently installed QGIS release
137+
; if the uninstall procedure succeeded, call the current installer without asking for the install PATH
138+
; QGIS will be installed in the same PATH of the previous installation
139139

140-
;4. repair installation = if the same release of QGIS is already installed
141-
;call the uninstaller of the currently installed QGIS release
142-
;if the uninstall procedure succeeded, call the current installer asking for the install PATH
140+
; 4. repair installation = if the same release of QGIS is already installed
141+
; call the uninstaller of the currently installed QGIS release
142+
; if the uninstall procedure succeeded, call the current installer asking for the install PATH
143143

144144
;the currently installed release of QGIS is defined by the variable $INSTALLED_VERSION = $INSTALLED_SVN_REVISION + $INSTALLED_BINARY_REVISION
145145

@@ -150,20 +150,20 @@ Function .onInit
150150

151151
Var /GLOBAL UNINSTALL_STRING
152152
Var /GLOBAL INSTALL_PATH
153-
153+
154154
Var /GLOBAL INSTALLED_VERSION_NUMBER
155155
Var /GLOBAL INSTALLED_SVN_REVISION
156156
Var /GLOBAL INSTALLED_BINARY_REVISION
157-
157+
158158
Var /GLOBAL INSTALLED_VERSION
159-
159+
160160
Var /GLOBAL DISPLAYED_INSTALLED_VERSION
161-
161+
162162
Var /GLOBAL MESSAGE_0_
163163
Var /GLOBAL MESSAGE_1_
164164
Var /GLOBAL MESSAGE_2_
165165
Var /GLOBAL MESSAGE_3_
166-
166+
167167
ReadRegStr $UNINSTALL_STRING HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${QGIS_BASE}" "UninstallString"
168168
ReadRegStr $INSTALL_PATH HKLM "Software\${QGIS_BASE}" "InstallPath"
169169
ReadRegStr $INSTALLED_VERSION_NUMBER HKLM "Software\${QGIS_BASE}" "VersionNumber"
@@ -174,22 +174,22 @@ Function .onInit
174174
${EndIf}
175175

176176
ReadRegStr $INSTALLED_BINARY_REVISION HKLM "Software\${QGIS_BASE}" "BinaryRevision"
177-
177+
178178
StrCpy $MESSAGE_0_ "${CHECK_INSTALL_NAME} is already installed on your system.$\r$\n"
179179
StrCpy $MESSAGE_0_ "$MESSAGE_0_$\r$\n"
180-
181-
!if ${INSTALLER_TYPE} == "Release"
180+
181+
!if ${INSTALLER_TYPE} == "Release"
182182
${If} $INSTALLED_BINARY_REVISION == ""
183183
StrCpy $DISPLAYED_INSTALLED_VERSION "$INSTALLED_VERSION_NUMBER"
184184
${Else}
185185
StrCpy $DISPLAYED_INSTALLED_VERSION "$INSTALLED_VERSION_NUMBER-$INSTALLED_BINARY_REVISION"
186186
${EndIf}
187187
!else
188-
StrCpy $DISPLAYED_INSTALLED_VERSION "$INSTALLED_VERSION_NUMBER-$INSTALLED_SVN_REVISION-$INSTALLED_BINARY_REVISION"
188+
StrCpy $DISPLAYED_INSTALLED_VERSION "$INSTALLED_VERSION_NUMBER-$INSTALLED_BINARY_REVISION"
189189
!endif
190190

191191
StrCpy $MESSAGE_0_ "$MESSAGE_0_The installed release is $DISPLAYED_INSTALLED_VERSION$\r$\n"
192-
192+
193193
StrCpy $MESSAGE_1_ "$MESSAGE_0_$\r$\n"
194194
StrCpy $MESSAGE_1_ "$MESSAGE_1_You are going to install a newer release of ${CHECK_INSTALL_NAME}$\r$\n"
195195
StrCpy $MESSAGE_1_ "$MESSAGE_1_$\r$\n"
@@ -422,6 +422,8 @@ Section "Quantum GIS" SecQGIS
422422
GetFullPathName /SHORT $0 $INSTALL_DIR
423423
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("OSGEO4W_ROOT", "$0").r0'
424424
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("OSGEO4W_STARTMENU", "$SMPROGRAMS\${QGIS_BASE}").r0'
425+
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("OSGEO4W_MENU_LINKS", "1").r0'
426+
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("OSGEO4W_DESKTOP_LINKS", "1").r0'
425427

426428
ReadEnvStr $0 COMSPEC
427429
nsExec::ExecToLog '"$0" /c "$INSTALL_DIR\postinstall.bat"'
@@ -433,13 +435,23 @@ RebootNecessary:
433435
SetRebootFlag true
434436

435437
NoRebootNecessary:
436-
437438
Delete "$DESKTOP\Quantum GIS (${VERSION_NUMBER}).lnk"
438-
CreateShortCut "$DESKTOP\Quantum GIS (${VERSION_NUMBER}).lnk" "$INSTALL_DIR\bin\nircmd.exe" 'exec hide "$INSTALL_DIR\bin\${SHORTNAME}.bat"' \
439+
Delete "$SMPROGRAMS\${QGIS_BASE}\Quantum GIS (${VERSION_NUMBER}).lnk"
440+
441+
Delete "$DESKTOP\Quantum GIS Desktop (${VERSION_NUMBER}).lnk"
442+
CreateShortCut "$DESKTOP\Quantum GIS Desktop (${VERSION_NUMBER}).lnk" "$INSTALL_DIR\bin\nircmd.exe" 'exec hide "$INSTALL_DIR\bin\${SHORTNAME}.bat"' \
439443
"$INSTALL_DIR\icons\QGIS.ico" "" SW_SHOWNORMAL "" "Launch ${COMPLETE_NAME}"
440444

441-
Delete "$SMPROGRAMS\${QGIS_BASE}\Quantum GIS (${VERSION_NUMBER}).lnk"
442-
CreateShortCut "$SMPROGRAMS\${QGIS_BASE}\Quantum GIS (${VERSION_NUMBER}).lnk" "$INSTALL_DIR\bin\nircmd.exe" 'exec hide "$INSTALL_DIR\bin\${SHORTNAME}.bat"' \
445+
Delete "$SMPROGRAMS\${QGIS_BASE}\Quantum GIS Desktop (${VERSION_NUMBER}).lnk"
446+
CreateShortCut "$SMPROGRAMS\${QGIS_BASE}\Quantum GIS Desktop (${VERSION_NUMBER}).lnk" "$INSTALL_DIR\bin\nircmd.exe" 'exec hide "$INSTALL_DIR\bin\${SHORTNAME}.bat"' \
447+
"$INSTALL_DIR\icons\QGIS.ico" "" SW_SHOWNORMAL "" "Launch ${COMPLETE_NAME}"
448+
449+
Delete "$DESKTOP\Quantum GIS Browser (${VERSION_NUMBER}).lnk"
450+
CreateShortCut "$DESKTOP\Quantum GIS Browser (${VERSION_NUMBER}).lnk" "$INSTALL_DIR\bin\nircmd.exe" 'exec hide "$INSTALL_DIR\bin\${SHORTNAME}-browser.bat"' \
451+
"$INSTALL_DIR\icons\QGIS.ico" "" SW_SHOWNORMAL "" "Launch ${COMPLETE_NAME}"
452+
453+
Delete "$SMPROGRAMS\${QGIS_BASE}\Quantum GIS Browser (${VERSION_NUMBER}).lnk"
454+
CreateShortCut "$SMPROGRAMS\${QGIS_BASE}\Quantum GIS Browser (${VERSION_NUMBER}).lnk" "$INSTALL_DIR\bin\nircmd.exe" 'exec hide "$INSTALL_DIR\bin\${SHORTNAME}-browser.bat"' \
443455
"$INSTALL_DIR\icons\QGIS.ico" "" SW_SHOWNORMAL "" "Launch ${COMPLETE_NAME}"
444456
!else
445457
CreateShortCut "$DESKTOP\${QGIS_BASE}.lnk" "$INSTALL_DIR\bin\qgis.exe" ""\
@@ -509,7 +521,7 @@ Section /O "North Carolina Data Set" SecNorthCarolinaSDB
509521
;Set the size (in KB) of the unpacked archive file
510522
AddSize 293314
511523

512-
StrCpy $HTTP_PATH "http://grass.osgeo.org/sampledata"
524+
StrCpy $HTTP_PATH "http://grass.osgeo.org/sampledata"
513525
StrCpy $ARCHIVE_NAME "nc_spm_latest.tar.gz"
514526
StrCpy $EXTENDED_ARCHIVE_NAME "North Carolina"
515527
StrCpy $ORIGINAL_UNTAR_FOLDER "nc_spm_08"
@@ -565,19 +577,18 @@ Section "Uninstall"
565577
GetFullPathName /SHORT $0 $INSTDIR
566578
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("OSGEO4W_ROOT", "$0").r0'
567579
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("OSGEO4W_STARTMENU", "$SMPROGRAMS\${QGIS_BASE}").r0'
580+
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("OSGEO4W_MENU_LINKS", "1").r0'
581+
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("OSGEO4W_DESKTOP_LINKS", "1").r0'
568582

569583
ReadEnvStr $0 COMSPEC
570584
nsExec::ExecToLog '"$0" /c "$INSTALL_DIR\preremove.bat"'
571585

572586
Delete "$INSTDIR\Uninstall-QGIS.exe"
573-
Delete "$INSTDIR\postinstall.bat.done"
574-
Delete "$INSTDIR\postinstall.bat"
575-
Delete "$INSTDIR\postinstall.log"
576-
577-
Delete "$INSTDIR\preremove.bat.done"
578-
Delete "$INSTDIR\preremove.bat"
579-
Delete "$INSTDIR\preremove.log"
587+
Delete "$INSTDIR\*.bat.done"
588+
Delete "$INSTDIR\*.log"
580589
Delete "$INSTDIR\*.txt"
590+
Delete "$INSTDIR\*.ico"
591+
Delete "$INSTDIR\*.bat"
581592

582593
RMDir /r "$INSTDIR\bin"
583594
RMDir /r "$INSTDIR\apps"
@@ -632,7 +643,10 @@ Section "Uninstall"
632643

633644
;remove the Desktop ShortCut
634645
SetShellVarContext all
646+
Delete "$DESKTOP\Quantum GIS Desktop (${VERSION_NUMBER}).lnk"
647+
Delete "$DESKTOP\Quantum GIS Browser (${VERSION_NUMBER}).lnk"
635648
Delete "$DESKTOP\Quantum GIS (${VERSION_NUMBER}).lnk"
649+
Delete "$DESKTOP\OSGeo4W.lnk"
636650

637651
;remove the Programs Start ShortCut
638652
SetShellVarContext all

ms-windows/osgeo4w/creatensis.pl

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,19 @@
2525
my $releasename;
2626
my $shortname;
2727
my $version;
28-
my $revision;
28+
my $binary;
29+
my $ininame = "setup.ini";
2930
my $help;
3031

3132
my $result = GetOptions(
3233
"verbose+" => \$verbose,
3334
"keep" => \$keep,
3435
"releasename=s" => \$releasename,
3536
"version=s" => \$version,
36-
"revision=s" => \$revision,
37+
"binary=i" => \$binary,
3738
"packagename=s" => \$packagename,
3839
"shortname=s" => \$shortname,
40+
"ininame=s" => \$ininame,
3941
"help" => \$help
4042
);
4143

@@ -62,7 +64,7 @@
6264
my %file;
6365
my $package;
6466

65-
system "wget $wgetopt -c $root/setup.ini";
67+
system "wget $wgetopt -O setup.ini -c $root/$ininame";
6668
open F, "setup.ini" || die "setup.ini not found";
6769
while(<F>) {
6870
chop;
@@ -83,7 +85,7 @@ sub getDeps {
8385

8486
return if exists $pkgs{$pkg};
8587

86-
print " Including package $pkg" if $verbose;
88+
print " Including package $pkg\n" if $verbose;
8789
$pkgs{$pkg} = 1;
8890

8991
foreach my $p ( @{ $dep{$pkg} } ) {
@@ -137,7 +139,9 @@ sub getDeps {
137139
unless(-d "unpacked") {
138140
mkdir "unpacked", 0755;
139141

140-
for my $p (<packages/*.tar.bz2>) {
142+
foreach my $p ( keys %pkgs ) {
143+
$p = $file{$p};
144+
$p =~ s#^.*/#packages/#;
141145

142146
print "Unpacking $p...\n" if $verbose;
143147
system "tar $taropt -C unpacked -xjf $p";
@@ -152,7 +156,7 @@ sub getDeps {
152156
system "cd apps/nircmd; unzip ../../../packages/nircmd.zip && mv nircmd.exe ../../bin";
153157

154158
if( -d "../addons" ) {
155-
print " Including addons..." if $verbose;
159+
print " Including addons...\n" if $verbose;
156160
system "tar -C ../addons -cf - . | tar $taropt -xf -";
157161
}
158162

@@ -221,7 +225,6 @@ sub getDeps {
221225

222226
open F, "../../CMakeLists.txt";
223227
while(<F>) {
224-
print;
225228
if(/SET\(CPACK_PACKAGE_VERSION_MAJOR "(\d+)"\)/) {
226229
$major = $1;
227230
} elsif(/SET\(CPACK_PACKAGE_VERSION_MINOR "(\d+)"\)/) {
@@ -236,15 +239,17 @@ sub getDeps {
236239

237240
$version = "$major.$minor.$patch" unless defined $version;
238241

239-
unless( defined $revision ) {
240-
open F, "svnversion|";
241-
$revision = <F>;
242-
$revision =~ s/\D+$//g;
243-
close F;
242+
unless( defined $binary ) {
243+
if( -f "binary-$version" ) {
244+
open P, "binary-$version";
245+
$binary = <P>;
246+
close P;
247+
$binary++;
248+
} else {
249+
$binary = 1;
250+
}
244251
}
245252

246-
$revision = 14615 unless $revision =~ /^\d+$/;
247-
248253
system "unzip packages/Untgz.zip" unless -d "untgz";
249254

250255
chdir "..";
@@ -254,20 +259,25 @@ sub getDeps {
254259

255260
my $cmd = "makensis";
256261
$cmd .= " -V$verbose";
257-
$cmd .= " -DVERSION_NUMBER='$version'";
258262
$cmd .= " -DVERSION_NAME='$releasename'";
259-
$cmd .= " -DSVN_REVISION='$revision'";
263+
$cmd .= " -DVERSION_NUMBER='$version'";
264+
$cmd .= " -DBINARY_REVISION=$binary";
265+
$cmd .= sprintf( " -DVERSION_INT='%d%02d%02d%02d'", $major, $minor, $patch, $binary );
260266
$cmd .= " -DQGIS_BASE='$packagename $releasename'";
261-
$cmd .= " -DINSTALLER_NAME='QGIS-OSGeo4W-$version-$revision-Setup.exe'";
267+
$cmd .= " -DINSTALLER_NAME='QGIS-OSGeo4W-$version-$binary-Setup.exe'";
262268
$cmd .= " -DDISPLAYED_NAME='$packagename \'$releasename\' ($version)'";
263-
$cmd .= " -DBINARY_REVISION=1";
264269
$cmd .= " -DSHORTNAME='$shortname'";
265270
$cmd .= " -DINSTALLER_TYPE=OSGeo4W";
266271
$cmd .= " -DPACKAGE_FOLDER=osgeo4w/unpacked";
267272
$cmd .= " QGIS-Installer.nsi";
268273

269274
system $cmd;
270275

276+
open P, ">osgeo4w/binary-$version";
277+
print P $binary;
278+
close P;
279+
280+
271281
__END__
272282
273283
=head1 NAME
@@ -283,7 +293,8 @@ =head1 SYNOPSIS
283293
-releasename=name name of release (defaults to CMakeLists.txt setting)
284294
-keep don't start with a fresh unpacked directory
285295
-version=m.m.p package version (defaults to CMakeLists.txt setting)
286-
-revision=rNNNNN svn revision of package (determined by svnversion if not given)
296+
-binary=b binary version of package
297+
-ininame=filename name of the setup.ini (defaults to setup.ini)
287298
-packagename=s name of package (defaults to 'Quantum GIS')
288299
-shortname=s shortname used for batch file (defaults to 'qgis')
289300
-help this help

ms-windows/osgeo4w/package.cmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@echo off
2-
set GRASS_VERSION=6.4.3RC1
2+
set GRASS_VERSION=6.4.3RC2
33

44
set BUILDDIR=%CD%\build
55
REM set BUILDDIR=%TEMP%\qgis_unstable
@@ -86,6 +86,7 @@ if errorlevel 1 goto error
8686

8787
set LIB=%LIB%;%OSGEO4W_ROOT%\lib
8888
set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\include
89+
set GRASS_PREFIX=%O4W_ROOT%/apps/grass/grass-%GRASS_VERSION%
8990

9091
cmake -G "Visual Studio 9 2008" ^
9192
-D PEDANTIC=TRUE ^
@@ -94,14 +95,13 @@ cmake -G "Visual Studio 9 2008" ^
9495
-D WITH_GLOBE=TRUE ^
9596
-D CMAKE_BUILD_TYPE=%BUILDCONF% ^
9697
-D CMAKE_CONFIGURATION_TYPES=%BUILDCONF% ^
97-
-D GEOS_LIBRARY=%O4W_ROOT%/lib/geos_c_i.lib ^
98+
-D GEOS_LIBRARY=%O4W_ROOT%/lib/geos_c.lib ^
9899
-D SQLITE3_LIBRARY=%O4W_ROOT%/lib/sqlite3_i.lib ^
99100
-D SPATIALITE_LIBRARY=%O4W_ROOT%/lib/spatialite_i.lib ^
100101
-D PYTHON_EXECUTABLE=%O4W_ROOT%/bin/python.exe ^
101102
-D PYTHON_INCLUDE_PATH=%O4W_ROOT%/apps/Python27/include ^
102103
-D PYTHON_LIBRARY=%O4W_ROOT%/apps/Python27/libs/python27.lib ^
103104
-D SIP_BINARY_PATH=%O4W_ROOT%/apps/Python27/sip.exe ^
104-
-D GRASS_PREFIX=%O4W_ROOT%/apps/grass/grass-%GRASS_VERSION% ^
105105
-D QT_BINARY_DIR=%O4W_ROOT%/bin ^
106106
-D QT_LIBRARY_DIR=%O4W_ROOT%/lib ^
107107
-D QT_HEADERS_DIR=%O4W_ROOT%/include/qt4 ^
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
call "%OSGEO4W_ROOT%"\bin\o4w_env.bat
22
path %PATH%;%OSGEO4W_ROOT%\apps\@package@\bin
3-
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT%\apps\@package@
4-
%OSGEO4W_ROOT%\apps\@package@\crssync
3+
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT:\=/%/apps/@package@
4+
"%OSGEO4W_ROOT%"\apps\@package@\crssync

ms-windows/osgeo4w/postinstall-desktop.bat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ textreplace -std -t bin\@package@-browser.bat
33

44
mkdir "%OSGEO4W_STARTMENU%"
55
xxmklink "%OSGEO4W_STARTMENU%\Quantum GIS Desktop (@version@).lnk" "%OSGEO4W_ROOT%\bin\@package@.bat" " " \ "Quantum GIS - Desktop GIS (@version@)" 1 "%OSGEO4W_ROOT%\apps\@package@\icons\QGIS.ico"
6-
xxmklink "%ALLUSERSPROFILE%\Desktop\Quantum GIS Desktop (@version@).lnk" "%OSGEO4W_ROOT%\bin\@package@.bat" " " \ "Quantum GIS - Desktop GIS (@version@)" 1 "%OSGEO4W_ROOT%\apps\@package@\icons\QGIS.ico"
76
xxmklink "%OSGEO4W_STARTMENU%\Quantum GIS Browser (@version@).lnk" "%OSGEO4W_ROOT%\bin\@package@-browser.bat" " " \ "Quantum GIS - Desktop GIS (@version@)" 1 "%OSGEO4W_ROOT%\apps\@package@\icons\QGIS.ico"
7+
8+
xxmklink "%ALLUSERSPROFILE%\Desktop\Quantum GIS Desktop (@version@).lnk" "%OSGEO4W_ROOT%\bin\@package@.bat" " " \ "Quantum GIS - Desktop GIS (@version@)" 1 "%OSGEO4W_ROOT%\apps\@package@\icons\QGIS.ico"
89
xxmklink "%ALLUSERSPROFILE%\Desktop\Quantum GIS Browser (@version@).lnk" "%OSGEO4W_ROOT%\bin\@package@-browser.bat" " " \ "Quantum GIS - Desktop GIS (@version@)" 1 "%OSGEO4W_ROOT%\apps\@package@\icons\QGIS.ico"
910

1011
set O4W_ROOT=%OSGEO4W_ROOT%

0 commit comments

Comments
 (0)