[Python-checkins] python/nondist/sandbox/msi msi.py, 1.22, 1.23 sequence.py, 1.1.1.1, 1.2

loewis at users.sourceforge.net loewis at users.sourceforge.net
Sun Aug 1 19:18:18 CEST 2004


Update of /cvsroot/python/python/nondist/sandbox/msi
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28415

Modified Files:
	msi.py sequence.py 
Log Message:
Add support for upgrade installations.

Index: msi.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/msi/msi.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** msi.py	1 Aug 2004 10:45:04 -0000	1.22
--- msi.py	1 Aug 2004 17:18:15 -0000	1.23
***************
*** 160,166 ****
      start = "%s.%s.0" % (major, minor)
      # This requests that feature selection states of an older
!     # installation should be forwarded into this one. It currently
!     # does not work if the older installation was per-machine
!     # and the current installation starts as per-user.
      migrate_features = 1
      # See "Upgrade Table". We remove releases with the same major and
--- 160,166 ----
      start = "%s.%s.0" % (major, minor)
      # This requests that feature selection states of an older
!     # installation should be forwarded into this one. Upgrading
!     # requires that both the old and the new installation are
!     # either both per-machine or per-user.
      migrate_features = 1
      # See "Upgrade Table". We remove releases with the same major and
***************
*** 180,184 ****
              [(upgrade_code, start, current_version,
                None, migrate_features, None, "REMOVEOLDVERSION"),
!              (upgrade_code_snapshot, start, "%s.%s.0" % (major, minor+1),
                None, migrate_features, None, "REMOVEOLDSNAPSHOT")])
          props = "REMOVEOLDSNAPSHOT;REMOVEOLDVERSION"
--- 180,184 ----
              [(upgrade_code, start, current_version,
                None, migrate_features, None, "REMOVEOLDVERSION"),
!              (upgrade_code_snapshot, start, "%s.%d.0" % (major, int(minor)+1),
                None, migrate_features, None, "REMOVEOLDSNAPSHOT")])
          props = "REMOVEOLDSNAPSHOT;REMOVEOLDVERSION"
***************
*** 319,323 ****
      # Numbers indicate sequence; see sequence.py for how these action integrate
      add_data(db, "InstallUISequence",
!              [("PrepareDlg", None, 140),
                ("InitialTargetDir", 'TARGETDIR=""', 750),
                # In the user interface, assume all-users installation if privileged.
--- 319,324 ----
      # Numbers indicate sequence; see sequence.py for how these action integrate
      add_data(db, "InstallUISequence",
!              [("PrepareDlg", "Not Privileged or Windows9x or Installed", 140),
!               ("WhichUsersDlg", "Privileged and not Windows9x and not Installed", 141),
                ("InitialTargetDir", 'TARGETDIR=""', 750),
                # In the user interface, assume all-users installation if privileged.
***************
*** 357,360 ****
--- 358,364 ----
                 "Click the Finish button to exit the Installer.")
      c=fatal.next("Finish", "Cancel", name="Finish")
+     # See "ControlEvent Table". Parameters are the event, the parameter
+     # to the action, and optionally the condition for the event, and the order
+     # of events.
      c.event("EndDialog", "Exit")
      
***************
*** 462,465 ****
--- 466,470 ----
      c.event("SpawnDialog", "CancelDlg")
  
+     #####################################################################
      # Target directory selection
      seldlg = PyDialog(db, "SelectDirectoryDlg", x, y, w, h, modal, title,
***************
*** 472,479 ****
      c = seldlg.next("Next >", "Cancel")
      c.event("DoAction", "CheckDir", "TargetExistsOk<>1", order=1)
!     c.event("SpawnDialog", "ExistingDirectoryDlg", "TargetExists=1", 2)
!     c.event("SetTargetPath", "TARGETDIR", "TargetExists=0", 3)
      c.event("SpawnWaitDialog", "WaitForCostingDlg", "CostingComplete=1", 4)
!     c.event("NewDialog", "SelectFeaturesDlg", "TargetExists=0", 5)
  
      c = seldlg.cancel("Cancel", "DirectoryCombo")
--- 477,488 ----
      c = seldlg.next("Next >", "Cancel")
      c.event("DoAction", "CheckDir", "TargetExistsOk<>1", order=1)
!     # If the target exists, but we found that we are going to remove old versions, don't bother
!     # confirming that the target directory exists. Strictly speaking, we should determine that
!     # the target directory is indeed the target of the product that we are going to remove, but
!     # I don't know how to do that.
!     c.event("SpawnDialog", "ExistingDirectoryDlg", 'TargetExists=1 and REMOVEOLDVERSION="" and REMOVEOLDSNAPSHOT=""', 2)
!     c.event("SetTargetPath", "TARGETDIR", 'TargetExists=0 or REMOVEOLDVERSION<>"" or REMOVEOLDSNAPSHOT<>""', 3)
      c.event("SpawnWaitDialog", "WaitForCostingDlg", "CostingComplete=1", 4)
!     c.event("NewDialog", "SelectFeaturesDlg", 'TargetExists=0 or REMOVEOLDVERSION<>"" or REMOVEOLDSNAPSHOT<>""', 5)
  
      c = seldlg.cancel("Cancel", "DirectoryCombo")
***************
*** 505,511 ****
      c=features.next("Next >", "Cancel")
      c.mapping("SelectionNoItems", "Enabled")
!     c.event("[ALLUSERS]", "2", 'VersionNT and WhichUsers="ALL"', order=1)
!     c.event("SpawnDialog", "DiskCostDlg", "OutOfDiskSpace=1", order=2)
!     c.event("EndDialog", "Return", "OutOfDiskSpace<>1", order=3)
  
      c=features.cancel("Cancel", "Tree")
--- 514,519 ----
      c=features.next("Next >", "Cancel")
      c.mapping("SelectionNoItems", "Enabled")
!     c.event("SpawnDialog", "DiskCostDlg", "OutOfDiskSpace=1", order=1)
!     c.event("EndDialog", "Return", "OutOfDiskSpace<>1", order=2)
  
      c=features.cancel("Cancel", "Tree")
***************
*** 526,532 ****
      c.event("SpawnDialog", "DiskCostDlg")
  
-     c=features.xbutton("Advanced", "Advanced", None, 0.30)
-     c.event("SpawnDialog", "AdvancedDlg")
- 
      c=features.text("ItemDescription", 140, 180, 210, 30, 3,
                    "Multiline description of the currently selected item.")
--- 534,537 ----
***************
*** 556,587 ****
  
      #####################################################################
!     # Advanced Options
!     advanced = PyDialog(db, "AdvancedDlg", x, y, w, h, modal, title,
!                         "OK", "OK", "OK")
!     advanced.title("Advanced Options")
      # A radio group with two options: allusers, justme
!     g = advanced.radiogroup("AdminInstall", 135, 60, 160, 50, 3,
!                             "WhichUsers", "", "OK")
!     # ALLUSERS should not be tempered with on W9x
!     # See "ControlCondition Table"
!     g.condition("Hide", "Windows9x or NOT Privileged") 
      g.add("ALL", 0, 5, 150, 20, "Install for all users")
      g.add("JUSTME", 0, 25, 150, 20, "Install just for me")
  
!     # Alternative texts if privilged install is not available
!     c=advanced.text("Unprivileged", 135, 90, 160, 50, 3,
!                     "Installing Python for all users is not possible, because you lack privileges. Python will be installed for you only.")
!     c.condition("Hide", "Privileged")
!     c=advanced.text("W9X", 135, 80, 160, 90, 3,
!                     "Installing Python for all users is not possible on Windows 9x.")
!     c.condition("Hide", "NOT Windows9x")    
  
!     c = advanced.cancel("Ok", "AdminInstall", name="OK")
!     # See "ControlEvent Table". Parameters are the event, the parameter
!     # to the action, the condition for the event, and optionally the order
!     # of events.
!     c.event("DoAction", "SetDLLDirToTarget", 'WhichUsers="JUSTME"', 1)
!     c.event("DoAction", "SetDLLDirToSystem32", 'WhichUsers="ALL" and (Windows9x or Privileged)', 2)
!     c.event("EndDialog", "Return", order = 3)
                          
      #####################################################################
--- 561,591 ----
  
      #####################################################################
!     # WhichUsers Dialog. Only available on NT, and for privileged users.
!     # This must be run before FindRelatedProducts, because that will
!     # take into account whether the previous installation was per-user
!     # or per-machine. We currently don't support going back to this
!     # dialog after "Next" was selected; to support this, we would need to
!     # find how to reset the ALLUSERS property, and how to re-run
!     # FindRelatedProducts.
!     # On Windows9x, the ALLUSERS property is ignored on the command line
!     # and in the Property table, but installer fails according to the documentation
!     # if a dialog attempts to set ALLUSERS.
!     whichusers = PyDialog(db, "WhichUsersDlg", x, y, w, h, modal, title,
!                         "AdminInstall", "Next", "Cancel")
!     whichusers.title("Select whether to install [ProductName] for all users of this computer.")
      # A radio group with two options: allusers, justme
!     g = whichusers.radiogroup("AdminInstall", 135, 60, 160, 50, 3,
!                               "WhichUsers", "", "Next")
      g.add("ALL", 0, 5, 150, 20, "Install for all users")
      g.add("JUSTME", 0, 25, 150, 20, "Install just for me")
  
!     whichusers.back("Back", None, active=0)    
  
!     c = whichusers.next("Next >", "Cancel")
!     c.event("[ALLUSERS]", "1", 'WhichUsers="ALL"', 1)
!     c.event("EndDialog", "Return", order = 2)
! 
!     c = whichusers.cancel("Cancel", "AdminInstall")
!     c.event("SpawnDialog", "CancelDlg")
                          
      #####################################################################
***************
*** 730,734 ****
          # For releases, the Python DLL has the same version as the
          # installer package.
!         assert pyversion == current_version
      dlldir.add_file("PCBuild/python%s%s.dll" % (major, minor),
                      version=pyversion,
--- 734,738 ----
          # For releases, the Python DLL has the same version as the
          # installer package.
!         assert pyversion.split(".")[:3] == current_version.split(".")
      dlldir.add_file("PCBuild/python%s%s.dll" % (major, minor),
                      version=pyversion,

Index: sequence.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/msi/sequence.py,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** sequence.py	29 Dec 2003 14:04:37 -0000	1.1.1.1
--- sequence.py	1 Aug 2004 17:18:16 -0000	1.2
***************
*** 77,81 ****
  (u'RemoveDuplicateFiles', None, 3400),
  (u'RemoveEnvironmentStrings', None, 3300),
! (u'RemoveExistingProducts', None, 6700),
  (u'RemoveFiles', None, 3500),
  (u'RemoveFolders', None, 3600),
--- 77,85 ----
  (u'RemoveDuplicateFiles', None, 3400),
  (u'RemoveEnvironmentStrings', None, 3300),
! # Microsoft it is best to run removal after the installation is committed, so
! # that only extra files get removed. However, this appears to delete all installed
! # files, so for the moment, we do what Microsoft says is most inefficient.
! #(u'RemoveExistingProducts', None, 6700),
! (u'RemoveExistingProducts', None, 1450),
  (u'RemoveFiles', None, 3500),
  (u'RemoveFolders', None, 3600),



More information about the Python-checkins mailing list