[Greater-commits] r370 - trunk/packaging

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jul 7 15:25:47 CEST 2011


Author: aheinecke
Date: 2011-07-07 15:25:47 +0200 (Thu, 07 Jul 2011)
New Revision: 370

Modified:
   trunk/packaging/README-installer
   trunk/packaging/greater-installer.nsi
   trunk/packaging/makeinstaller.py
Log:
Improve section selection and module installation
after the results of testing on a clean system


Modified: trunk/packaging/README-installer
===================================================================
--- trunk/packaging/README-installer	2011-07-07 13:24:51 UTC (rev 369)
+++ trunk/packaging/README-installer	2011-07-07 13:25:47 UTC (rev 370)
@@ -22,7 +22,11 @@
 /greater/packaging
 
 In the packaging directory you have to put external packages like Postgres
-and Python.
+and Python and the redistributable packages of the msvc runtime.
+The redistributable packages should be named:
+vcredist_x86.exe    (For vc9 runtime)
+vcredist-80_x86.exe (For vc8 runtime)
+Both are obtainable from microsoft.com
 
 Then from your
 /greater directory execute:

Modified: trunk/packaging/greater-installer.nsi
===================================================================
--- trunk/packaging/greater-installer.nsi	2011-07-07 13:24:51 UTC (rev 369)
+++ trunk/packaging/greater-installer.nsi	2011-07-07 13:25:47 UTC (rev 370)
@@ -57,13 +57,12 @@
   BrandingText "GREAT-ER III - PostgreSQL"
   ; MUI Settings / Header
   !define MUI_WELCOMEPAGE_TITLE "Welcome to the installation of GREAT-ER III - PostgreSQL"
-  !define MUI_WELCOMEPAGE_TEXT "This Installer will install\r\n\
+  !define MUI_WELCOMEPAGE_TEXT "This Installer will install \r\n\
   The Geo-referenced Regional Exposure Assesment Tool for European Rivers\r\n\
-  using the Postges SQL Database backend."
+  Version ${version_number}-${version_date} using the Postges SQL Database backend."
   !define MUI_HEADERIMAGE
   !define MUI_COMPONENTSPAGE_TEXT_TOP "Please select installation type"
 
-
 ;--------------------------------
 ;Pages
   !define MUI_PAGE_CUSTOMFUNCTION_SHOW PrintNonAdminWarning
@@ -94,29 +93,42 @@
   !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
   ReserveFile "installer-options.ini"
 
-
 ;--------------------------------
 ;Installer Sections
 
 Section "PostgreSQL 9.0.4" SecPostgreSQL
+  Banner::show /NOUNLOAD /set 76 "PostgreSQL" "installing..." "" 
   SetOutPath "$TEMP"
-  File "postgresql-9.0.4-1-windows.exe"
+  File "postgresql-9.0.4-1-windows.exe" ; Should be more generalized
   DetailPrint "Installing PostgreSQL..."
-  ExecWait '"$TEMP\postgresql-9.0.4-1-windows.exe --mode unattended"' $0
+  ExecWait '"$TEMP\postgresql-9.0.4-1-windows.exe" --mode unattended' $0
+  Delete "$TEMP\postgresql-9.0.4-1-windows.exe"
+  banner::destroy
 SectionEnd
 
 Section "Python 2.7.2" SecPython
+  Banner::show /NOUNLOAD /set 76 "Python" "installing..." "" 
   SetOutPath "$TEMP"
-  File "python-2.7.2.msi"
+  File "python-2.7.2.msi" ; Should be more generalized
   DetailPrint "Installing Python..."
-  ExecWait '"msiexec" /i $TEMP\python-2.7.2-msi TARGETDIR=$INSTDIR\Python' $0
+  ExecWait '"msiexec" /i $TEMP\python-2.7.2.msi /quiet' $0
+  Delete "$TEMP\python-2.7.2-msi"
+  banner::destroy
 SectionEnd
+
 ;---------------------------
-; General Section
+; General Section - Included in all installations
 Section ""
   ; Create uninstaller
   WriteUninstaller "$INSTDIR\Uninstall.exe"
 
+  SetOutPath "$TEMP"
+  DetailPrint "Installing Microsoft Visual C Runtime Libraries..."
+  File "vcredist_x86.exe"
+  File "vcredist-80_x86.exe"
+  ExecWait '$TEMP\vcredist_x86.exe /q' $0
+  ExecWait '$TEMP\vcredist-80_x86.exe /q' $0
+
   ; Store installation folder
   WriteRegStr HKLM "Software\${productname_short}" "" $INSTDIR
   ; Create Registry keys
@@ -128,6 +140,9 @@
   WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" "NoRepair" 1
 SectionEnd
 
+;---------------------------
+; Admintool Section
+
 Section "Administration Tool" admin_section_id
   SetOutPath "$INSTDIR"
   !include ${admin-in}
@@ -152,14 +167,15 @@
   IntCmp $R0 0 no_start_menu
   # Create new Start menu entries
   CreateDirectory "$SMPROGRAMS\${productname}"
-  CreateShortCut "$SMPROGRAMS\${productname}\GREAT-ER Administration.lnk" "$INSTDIR\Administration\bin\Administration.exe"
+  CreateShortCut "$SMPROGRAMS\${productname}\GREAT-ER Administration.lnk" "$INSTDIR\Administration\Administration.exe"
   no_start_menu:
   Return
 SectionEnd
 
+;-----------------------------
+; Client section
+
 Section "GREAT-ER Client" client_section_id
-
-
   ; Include the input files
   ; package all files, recursively, preserving attributes
   ; assume files are in the correct places
@@ -188,7 +204,7 @@
   # Create new Start menu entries
   CreateDirectory "$SMPROGRAMS\${productname}"
   CreateShortCut "$SMPROGRAMS\${productname}\${productname_short}.lnk" \
-                  "$INSTDIR\${executable}" "" "$INSTDIR\GREAT-ER\Greater1.ico"
+                 "$INSTDIR\${executable}" "" "$INSTDIR\GREAT-ER\Greater1.ico"
   no_start_menu:
 
   # ** Desktop Icon **
@@ -208,11 +224,20 @@
 
 ;--------------------------------
 ;Install Functions
+
 Function ".onInit"
-  InstTypeSetText 0 "Full Installation"
+  InstTypeSetText 0 "Full Installation (recommended)"
   InstTypeSetText 1 "Client only (no Database)"
   InstTypeSetText 2 "Server only"
   SectionSetInstTypes ${client_section_id} 3
+  SectionSetInstTypes ${SecPostgeSQL} 5
+  SectionSetInstTypes ${SecPython} 3
+  SectionSetInstTypes ${admin_section_id} 5
+  SectionSetFlags ${client_section_id} 1
+  SectionSetFlags ${SecPostgeSQL} 1
+  SectionSetFlags ${SecPython} 1
+  SectionSetFlags ${admin_section_id} 1
+
   SectionSetSize ${SecPostgreSQL} "207330"
   SectionSetSize ${SecPython} "55279"
   !insertmacro MUI_INSTALLOPTIONS_EXTRACT "installer-options.ini"
@@ -296,6 +321,29 @@
     Return
 FunctionEnd
 
+;---------------------
+; Disable the next button on the components page as long as there
+; are no sections selected
+
+Function .onSelChange
+  Push $0
+  Push $1
+  SectionGetFlags ${SecPython} $0
+  IntOp $0 ${SF_SELECTED} & $0
+  SectionGetFlags ${SecPostgreSQL} $1
+  IntOp $1 ${SF_SELECTED} & $1
+  IntOp $0 $1 | $0
+  SectionGetFlags ${client_section_id} $1
+  IntOp $1 ${SF_SELECTED} & $1
+  IntOp $0 $1 | $0
+  SectionGetFlags ${admin_section_id} $1
+  IntOp $1 ${SF_SELECTED} & $1
+  IntOp $0 $1 | $0
+  GetDlgItem $1 $HWNDPARENT 1
+  EnableWindow $1 $0
+  Pop $1
+  Pop $0
+FunctionEnd
 ;--------------------------------
 ;Uninstaller
 
@@ -364,8 +412,13 @@
 
 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
   !insertmacro MUI_DESCRIPTION_TEXT ${SecPostgreSQL} "Installs the PostgreSQL 9.0.4 Database with \
-  basic ${productname_short} datasets."
+    basic ${productname_short} datasets."
   !insertmacro MUI_DESCRIPTION_TEXT ${client_section_id} "Installs the ${productname_short} Client."
+  !insertmacro MUI_DESCRIPTION_TEXT ${admin_section_id} "Installs the Administration tool for the \
+    GREAT-ER Database."
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecPython} "Installs Python Version 2.7.2 necessary for \
+    GREAT-ER"
+
 !insertmacro MUI_FUNCTION_DESCRIPTION_END
 
 # From Function CheckExistingVersion

Modified: trunk/packaging/makeinstaller.py
===================================================================
--- trunk/packaging/makeinstaller.py	2011-07-07 13:24:51 UTC (rev 369)
+++ trunk/packaging/makeinstaller.py	2011-07-07 13:25:47 UTC (rev 370)
@@ -28,7 +28,7 @@
 ADMINTOOL_PATH = "../bin"
 
 INSTALLER_OPTIONS = {
-        "executable" : os.path.join("GREAT-ER", "Greater.pyw"),
+        "executable" : os.path.join("GREAT-ER", "GREAT-ER.pyw"),
         "company" : "Intevation GmbH",
         "productname" : "GREAT-ER III PGSQL",
         "setupname" : "Greater-Installer",
@@ -75,8 +75,12 @@
                 dirlist.insert(0, curoutpath.replace(absdir,
                                                      "$INSTDIR\%s" % dir))
             fptr.write('File "%s"\r\n' % fname)
-            unptr.write('Delete "%s"\r\n' % \
-                    fname.replace(dir, "$INSTDIR%s" % dir))
+            if dir:
+                unptr.write('Delete "%s"\r\n' % \
+                    fname.replace(absdir, "$INSTDIR\%s" % dir))
+            else:
+                unptr.write('Delete "%s"\r\n' % \
+                    fname.replace(absdir, "$INSTDIR"))
     for dir in dirlist:
         unptr.write('RMDir "%s"\r\n' % dir)
     unptr.write('RMDir "$INSTDIR"')



More information about the Greater-commits mailing list