Skip to content

Commit

Permalink
update osgeo4w version nsis installer
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14717 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 19, 2010
1 parent 119b815 commit b88a693
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 23 deletions.
52 changes: 35 additions & 17 deletions ms-windows/QGIS-Installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RequestExecutionLevel admin

;NSIS Includes

!include "MUI2.nsh"
!include "MUI.nsh"
!include "LogicLib.nsh"

;----------------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -89,6 +89,7 @@ RequestExecutionLevel admin
!define INSTALLER_DISPLAYED_NAME "${DISPLAYED_NAME}"

!addplugindir osgeo4w/untgz
!addplugindir osgeo4w/nsis
!endif

;----------------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -282,6 +283,7 @@ FunctionEnd

;Installer Pages

!define MUI_WELCOMEPAGE_TITLE_3LINES
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE ".\Installer-Files\LICENSE.txt"

Expand All @@ -290,6 +292,7 @@ FunctionEnd

!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_TITLE_3LINES
!insertmacro MUI_PAGE_FINISH

!insertmacro MUI_UNPAGE_WELCOME
Expand All @@ -301,6 +304,19 @@ FunctionEnd

; Language files
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "Japanese"
!insertmacro MUI_LANGUAGE "Italian"
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "PortugueseBR"
!insertmacro MUI_LANGUAGE "Portuguese"
!insertmacro MUI_LANGUAGE "Czech"
!insertmacro MUI_LANGUAGE "Croatian"
!insertmacro MUI_LANGUAGE "Thai"
!insertmacro MUI_LANGUAGE "Dutch"

;----------------------------------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -397,34 +413,34 @@ Section "Quantum GIS" SecQGIS

;Create the Desktop Shortcut
SetShellVarContext current

!if ${INSTALLER_TYPE} == "OSGeo4W"
CreateShortCut "$DESKTOP\${QGIS_BASE}.lnk" "$INSTALL_DIR\bin\nircmd.exe" 'exec hide "$INSTALL_DIR\bin\qgis-dev.bat"' \
"$INSTALL_DIR\icons\QGIS.ico" "" SW_SHOWNORMAL "" "Launch ${COMPLETE_NAME}"
!else
CreateShortCut "$DESKTOP\${QGIS_BASE}.lnk" "$INSTALL_DIR\bin\qgis.exe" ""\
"$INSTALL_DIR\icons\QGIS.ico" "" SW_SHOWNORMAL "" "Launch ${COMPLETE_NAME}"
!endif

;Create the Windows Start Menu Shortcuts
SetShellVarContext all

CreateDirectory "$SMPROGRAMS\${QGIS_BASE}"

!if ${INSTALLER_TYPE} == "OSGeo4W"
CreateShortCut "$SMPROGRAMS\${QGIS_BASE}\${QGIS_BASE}.lnk" "$INSTALL_DIR\bin\nircmd.exe" 'exec hide "$INSTALL_DIR\bin\qgis-dev.bat"' \
"$INSTALL_DIR\icons\QGIS.ico" "" SW_SHOWNORMAL "" "Launch ${COMPLETE_NAME}"
!else
CreateShortCut "$SMPROGRAMS\${QGIS_BASE}\${QGIS_BASE}.lnk" "$INSTALL_DIR\bin\qgis.exe" ""\
"$INSTALL_DIR\icons\QGIS.ico" "" SW_SHOWNORMAL "" "Launch ${COMPLETE_NAME}"
!endif

GetFullPathName /SHORT $0 $INSTALL_DIR
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("OSGEO4W_ROOT", "$0").r0'
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("OSGEO4W_STARTMENU", "$SMPROGRAMS\${QGIS_BASE}").r0'

ReadEnvStr $0 COMSPEC
nsExec::ExecToLog '"$0" /c "$INSTALL_DIR\postinstall.bat"'

!if ${INSTALLER_TYPE} == "OSGeo4W"
Delete "$DESKTOP\Quantum GIS (${VERSION_NUMBER}).lnk"
CreateShortCut "$DESKTOP\Quantum GIS (${VERSION_NUMBER}).lnk" "$INSTALL_DIR\bin\nircmd.exe" 'exec hide "$INSTALL_DIR\bin\qgis.bat"' \
"$INSTALL_DIR\icons\QGIS.ico" "" SW_SHOWNORMAL "" "Launch ${COMPLETE_NAME}"

Delete "$SMPROGRAMS\${QGIS_BASE}\Quantum GIS (${VERSION_NUMBER}).lnk"
CreateShortCut "$SMPROGRAMS\${QGIS_BASE}\Quantum GIS (${VERSION_NUMBER}).lnk" "$INSTALL_DIR\bin\nircmd.exe" 'exec hide "$INSTALL_DIR\bin\qgis.bat"' \
"$INSTALL_DIR\icons\QGIS.ico" "" SW_SHOWNORMAL "" "Launch ${COMPLETE_NAME}"
!else
CreateShortCut "$DESKTOP\${QGIS_BASE}.lnk" "$INSTALL_DIR\bin\qgis.exe" ""\
"$INSTALL_DIR\icons\QGIS.ico" "" SW_SHOWNORMAL "" "Launch ${COMPLETE_NAME}"
CreateShortCut "$SMPROGRAMS\${QGIS_BASE}\${QGIS_BASE}.lnk" "$INSTALL_DIR\bin\qgis.exe" ""\
"$INSTALL_DIR\icons\QGIS.ico" "" SW_SHOWNORMAL "" "Launch ${COMPLETE_NAME}"
!endif

SectionEnd

Function DownloadDataSet
Expand Down Expand Up @@ -554,6 +570,7 @@ Section "Uninstall"
Delete "$INSTDIR\preremove.bat.done"
Delete "$INSTDIR\preremove.bat"
Delete "$INSTDIR\preremove.log"
Delete "$INSTDIR\*.txt"

RMDir /r "$INSTDIR\bin"
RMDir /r "$INSTDIR\apps"
Expand All @@ -562,6 +579,7 @@ Section "Uninstall"
RMDir /r "$INSTDIR\lib"
RMDir /r "$INSTDIR\share"
RMDir /r "$INSTDIR\icons"

!else
;remove files
Delete "$INSTDIR\Uninstall-QGIS.exe"
Expand Down
21 changes: 15 additions & 6 deletions ms-windows/osgeo4w/creatensis.pl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
# Download OSGeo4W packages
#

unless(-f "nsis/System.dll") {
mkdir "nsis", 0755 unless -d "nsis";
system "wget -q -Onsis/System.dll http://qgis.org/downloads/System.dll";
}

mkdir "packages", 0755 unless -d "packages";
chdir "packages";

Expand Down Expand Up @@ -52,16 +57,16 @@ sub getDeps {
}
}

getDeps("qgis-dev");
getDeps("qgis");

if(-f "../addons/bin/NCSEcw.dll") {
if(-f "../addons/bin/NCSEcw4_RO.dll") {
print "Enabling ECW support...\n";
getDeps("gdal16-ecw")
getDeps("gdal17-ecw")
}

if(-f "../addons/bin/lti_dsdk_dll.dll") {
print "Enabling MrSID support...\n";
getDeps("gdal16-mrsid")
getDeps("gdal17-mrsid")
}


Expand Down Expand Up @@ -104,7 +109,7 @@ sub getDeps {

system "cd apps/nircmd; unzip ../../../packages/nircmd.zip && mv nircmd.exe ../../bin";

system "tar -C ../addons -cf . | tar -xf -" if -d "../addons";
system "tar -C ../addons -cf - . | tar -xf -" if -d "../addons";

chdir "..";
}
Expand Down Expand Up @@ -193,6 +198,10 @@ sub getDeps {
$revision =~ s/\D+$//g;
close F;

$revision = 14615 unless $revision =~ /^\d+$/;

system "unzip packages/Untgz.zip" unless -d "untgz";

chdir "..";

my $cmd = "makensis";
Expand All @@ -201,7 +210,7 @@ sub getDeps {
$cmd .= " -DSVN_REVISION='$revision'";
$cmd .= " -DQGIS_BASE='Quantum GIS $release'";
$cmd .= " -DINSTALLER_NAME='QGIS-OSGeo4W-$major.$minor.$patch-$revision-Setup.exe'";
$cmd .= " -DDISPLAYED_NAME='Quantum GIS OSGeo4W ($release)'";
$cmd .= " -DDISPLAYED_NAME='Quantum GIS \'$release\' ($major.$minor.$patch)'";
$cmd .= " -DBINARY_REVISION=1";
$cmd .= " -DINSTALLER_TYPE=OSGeo4W";
$cmd .= " -DPACKAGE_FOLDER=osgeo4w/unpacked";
Expand Down

0 comments on commit b88a693

Please sign in to comment.