[Greater-commits] r3713 - in trunk/packaging: . defaultdata

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Jul 27 16:18:46 CEST 2011


Author: aheinecke
Date: 2011-07-27 16:18:46 +0200 (Wed, 27 Jul 2011)
New Revision: 3713

Modified:
   trunk/packaging/defaultdata/README
   trunk/packaging/greater-installer.nsi
   trunk/packaging/makeinstaller.py
Log:
Add packaging capatibility for greater sediment


Modified: trunk/packaging/defaultdata/README
===================================================================
--- trunk/packaging/defaultdata/README	2011-07-27 14:04:26 UTC (rev 3712)
+++ trunk/packaging/defaultdata/README	2011-07-27 14:18:46 UTC (rev 3713)
@@ -26,3 +26,7 @@
 Afterwards create a backup dump of the database and put it into the defaultdata
 folder with the name defaultdb.backup
 
+For the sediment extentision import this database into a new database
+called greater-sediment, execute the upgrate process as documented
+in branches/greater_sediment for this db.
+Finally create a dump of this db also and place it into sedimentdb.backup

Modified: trunk/packaging/greater-installer.nsi
===================================================================
--- trunk/packaging/greater-installer.nsi	2011-07-27 14:04:26 UTC (rev 3712)
+++ trunk/packaging/greater-installer.nsi	2011-07-27 14:18:46 UTC (rev 3713)
@@ -28,6 +28,7 @@
 ;--------------------------------
 ; Variable declarations
   Var POSTGRESQL_INSTALLED
+  Var PYTHON_PATH
 ;--------------------------------
 ;Version Information (for installer file properties)
 
@@ -143,6 +144,7 @@
   DetailPrint "Installing Python..."
   ExecWait '"msiexec" /i $TEMP\python-2.7.2.msi /quiet TARGETDIR="$INSTDIR\Python2.7"' $0
   Delete "$TEMP\python-2.7.2.msi"
+  StrCpy $PYTHON_PATH '"$INSTDIR\Python2.7"'
   banner::destroy
 SectionEnd
 
@@ -198,14 +200,63 @@
   IntCmp $R0 0 no_start_menu
   # Create new Start menu entries
   CreateDirectory "$SMPROGRAMS\${productname}"
-  CreateShortCut "$SMPROGRAMS\${productname}\GREAT-ER Administration.lnk" "$INSTDIR\Administration\Administration.exe"
+  CreateShortCut "$SMPROGRAMS\${productname}\GREAT-ER Administration.lnk" '"$INSTDIR\Administration\Administration.exe"'
   no_start_menu:
   Return
 SectionEnd
 
 ;-----------------------------
-; Client section
+; Client sections
+Section "Client (Lakes/Metal Models)" usf_section_id
+;  !include ${usf-in}
+  
+SectionEnd
 
+Section "Client (Sediment Model)" sediment_section_id
+  !include ${sediment-in}
+
+  ; Set Path to $PROFILE
+  SetOutPath "%HOMEDRIVE%%HOMEPATH%"
+
+  # 'all users' shell folder is used (for $DESKTOP, $SMPROGRAMS, $QUICKLAUNCH,...)
+  !insertmacro MUI_INSTALLOPTIONS_READ $R0 "installer-options.ini" \
+    "Field 4" "State"
+  SetShellVarContext all
+  IntCmp $R0 0 just_current_user all_users
+  just_current_user:
+      SetShellVarContext current
+  all_users:
+
+  # ** Start menu **
+  # Delete old Start menu entries.
+  RMDir /R  "$SMPROGRAMS\${productname_short} ${version_number}"
+  # Check if the start menu entries where requested.
+  !insertmacro MUI_INSTALLOPTIONS_READ $R0 "installer-options.ini" \
+    "Field 2" "State"
+  IntCmp $R0 0 no_start_menu
+  # Create new Start menu entries
+  CreateDirectory "$SMPROGRAMS\${productname}"
+  CreateShortCut "$SMPROGRAMS\${productname}\${productname_short} Sediment.lnk" \
+                 "$INSTDIR\GREAT-ER-Sediment\${executable}" "greater/greater at greater-sediment" \
+                 "$INSTDIR\GREAT-ER\Resources\greater2.ico"
+  no_start_menu:
+
+  # ** Desktop Icon **
+  # Delete old Desktop link
+  Delete "$DESKTOP\${productname_short}.lnk"
+  # Check if the desktop entries where requested.
+  !insertmacro MUI_INSTALLOPTIONS_READ $R0 "installer-options.ini" \
+     "Field 3" "State"
+  IntCmp $R0 0 no_desktop
+  # Create new Desktop link
+  CreateShortCut "$DESKTOP\${productname_short} Sediment.lnk" \
+                 "$INSTDIR\GREAT-ER-Sediment\${executable}" \
+                 "greater/greater at greater-sediment" "$INSTDIR\GREAT-ER\Resources\greater2.ico"
+  no_desktop:
+
+  Return
+SectionEnd
+
 Section "GREAT-ER Desktop" client_section_id
   ; Include the input files
   ; package all files, recursively, preserving attributes
@@ -235,7 +286,7 @@
   # Create new Start menu entries
   CreateDirectory "$SMPROGRAMS\${productname}"
   CreateShortCut "$SMPROGRAMS\${productname}\${productname_short}.lnk" \
-                 "$INSTDIR\${executable}" "greater/greater at greater" \
+                 "$PYTHON_PATH" '"$INSTDIR\GREAT-ER\${executable}" greater/greater at greater' \
                  "$INSTDIR\GREAT-ER\Resources\greater2.ico"
   no_start_menu:
 
@@ -247,8 +298,9 @@
      "Field 3" "State"
   IntCmp $R0 0 no_desktop
   # Create new Desktop link
-  CreateShortCut "$DESKTOP\${productname_short}.lnk" "$INSTDIR\${executable}" \
-                 "greater/greater at greater" "$INSTDIR\GREAT-ER\Resources\greater2.ico"
+  CreateShortCut "$DESKTOP\${productname_short}.lnk" \
+                 "$PYTHON_PATH" '"$INSTDIR\GREAT-ER\${executable}" greater/greater at greater' \
+                 "$INSTDIR\GREAT-ER\Resources\greater2.ico"
   no_desktop:
 
   Return
@@ -262,6 +314,8 @@
   InstTypeSetText 0 "Full (recommended)"
   InstTypeSetText 1 "Client only (no Database)"
   InstTypeSetText 2 "Server only"
+  SectionSetInstTypes ${usf_section_id} 1
+  SectionSetInstTypes ${sediment_section_id} 1
   SectionSetInstTypes ${client_section_id} 3
   SectionSetInstTypes ${SecPostgeSQL} 5
   SectionSetInstTypes ${SecPython} 3
@@ -270,6 +324,8 @@
   SectionSetFlags ${SecPostgeSQL} 1
   SectionSetFlags ${SecPython} 1
   SectionSetFlags ${admin_section_id} 1
+  SectionSetFlags ${usf_section_id} 1
+  SectionSetFlags ${sediment_section_id} 1
 
   SectionSetSize ${SecPostgreSQL} "207330"
   SectionSetSize ${SecPython} "55279"
@@ -358,14 +414,34 @@
 ; Disable the next button on the components page as long as there
 ; are no sections selected
 
+; Also make sure that the greater desktop is enabled as soon as
+; at least sediment or usf is enabled
 Function .onSelChange
   Push $0
   Push $1
+  SectionGetFlags ${sediment_section_id} $1
+  IntOp $1 ${SF_SELECTED} & $1
+  IntOp $0 $1 | $0
+  SectionGetFlags ${usf_section_id} $1
+  IntOp $1 ${SF_SELECTED} & $1
+  IntOp $0 $1 | $0
+  SectionSetFlags ${client_section_id} $0
+  Pop $1
+  Pop $0
+
+  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 ${sediment_section_id} $1
+  IntOp $1 ${SF_SELECTED} & $1
+  IntOp $0 $1 | $0
+  SectionGetFlags ${usf_section_id} $1
+  IntOp $1 ${SF_SELECTED} & $1
+  IntOp $0 $1 | $0
   SectionGetFlags ${client_section_id} $1
   IntOp $1 ${SF_SELECTED} & $1
   IntOp $0 $1 | $0
@@ -468,7 +544,12 @@
 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
   !insertmacro MUI_DESCRIPTION_TEXT ${SecPostgreSQL} "Installs the PostgreSQL 9.0.4 Database with \
     basic ${productname_short} datasets."
-  !insertmacro MUI_DESCRIPTION_TEXT ${client_section_id} "Installs the ${productname_short} Client."
+  !insertmacro MUI_DESCRIPTION_TEXT ${client_section_id} "Installs the ${productname_short} \
+      client. \r\n With the CEFIC approved models from GREAT-ER II \r\n"
+  !insertmacro MUI_DESCRIPTION_TEXT ${usf_section_id} "Installs the client together with \
+      additional Models:\r\n Lakes \r\n Metals"
+  !insertmacro MUI_DESCRIPTION_TEXT ${sediment_section_id} "Installs the client together with \
+      additional Models:\r\n Sediment"
   !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 \

Modified: trunk/packaging/makeinstaller.py
===================================================================
--- trunk/packaging/makeinstaller.py	2011-07-27 14:04:26 UTC (rev 3712)
+++ trunk/packaging/makeinstaller.py	2011-07-27 14:18:46 UTC (rev 3713)
@@ -29,7 +29,7 @@
 ADMINTOOL_PATH = "../bin"
 
 INSTALLER_OPTIONS = {
-        "executable" : os.path.join("GREAT-ER", "GREAT-ER.pyw"),
+        "executable" : "GREAT-ER.pyw",
         "company" : "Intevation GmbH",
         "productname" : "GREAT-ER",
         "setupname" : "Greater-Installer",
@@ -139,15 +139,37 @@
         return True
     return generate_files(instdirs, "client-in.nsi", "client-un.nsi", whitelist)
 
+def generate_sediment():
+    instdirs = ["GREAT-ER-Sediment", "SciParam", "Lib", "GREAT-ER-DB"]
+    for idir in instdirs:
+        compileall.compile_dir(idir, quiet = True)
+    def whitelist(f):
+        for bad in [".svn", "test_", ".log"]:
+            if bad in f:
+                return False
+        if os.path.basename(f).startswith("."):
+            return False
+        if "GREAT-ER-DB" in f and not "GreaterDB" in f:
+            return False
+        return True
+    return generate_files(instdirs, "client-in.nsi", "client-un.nsi", whitelist)
+
 def generate_serverfiles():
 
     pass
 
+def generate_usf():
+    pass
+
 def main():
     (INSTALLER_OPTIONS["client-in"],
      INSTALLER_OPTIONS["client-un"]) = generate_clientfiles()
     (INSTALLER_OPTIONS["admin-in"],
      INSTALLER_OPTIONS["admin-un"]) = generate_administration()
+    (INSTALLER_OPTIONS["sediment-in"],
+     INSTALLER_OPTIONS["sediment-un"]) = generate_sediment()
+    (INSTALLER_OPTIONS["sediment-in"],
+     INSTALLER_OPTIONS["sediment-un"]) = generate_usf()
 #    INSTALLER_OPTIONS["allfiles"],
 #    INSTALLER_OPTIONS["un-allfiles"] = generate_allfiles()
 



More information about the Greater-commits mailing list