[Python-checkins] python/nondist/sandbox/msi msi.py, 1.23, 1.24 msilib.py, 1.9, 1.10 sequence.py, 1.2, 1.3

loewis at users.sourceforge.net loewis at users.sourceforge.net
Mon Aug 2 00:14:23 CEST 2004


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

Modified Files:
	msi.py msilib.py sequence.py 
Log Message:
Add file hashes to unversioned files.
Remove change to sequence; change sequence when generating the database.
Add API to support sequence changes.

Index: msi.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/msi/msi.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** msi.py	1 Aug 2004 17:18:15 -0000	1.23
--- msi.py	1 Aug 2004 22:14:19 -0000	1.24
***************
*** 144,147 ****
--- 144,153 ----
                    ProductVersion=current_version,
                    Manufacturer=u"Martin v. L\xf6wis")
+     # The default sequencing of the RemoveExistingProducts action causes
+     # removal of files that got just installed. Place it after
+     # InstallInitialize, so we first uninstall everything, but still roll
+     # back in case the installation is interrupted
+     msilib.change_sequence(sequence.InstallExecuteSequence,
+                            "RemoveExistingProducts", 1510)
      msilib.add_tables(db, sequence)
      # We cannot set ALLUSERS in the property table, as this cannot be

Index: msilib.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/msi/msilib.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** msilib.py	27 Jul 2004 16:36:21 -0000	1.9
--- msilib.py	1 Aug 2004 22:14:19 -0000	1.10
***************
*** 241,244 ****
--- 241,255 ----
      f.close()
  
+ class _Unspecified:pass
+ def change_sequence(seq, action, seqno, cond = _Unspecified):
+     "Change the sequence number of an action in a sequence list"
+     for i in range(len(seq)):
+         if seq[i][0] == action:
+             if cond is _Unspecified:
+                 cond = seq[i][1]
+             seq[i] = (action, cond, seqno)
+             return
+     raise ValueError, "Action not found in sequence"
+ 
  def add_data(db, table, values):
      d = MakeInstaller()
***************
*** 494,497 ****
--- 505,515 ----
                          [(logical, self.component, full, filesize, version,
                           language, attributes, sequence)])
+         if not version:
+             # Add hash if the file is not versioned
+             filehash = MakeInstaller().FileHash(absolute, 0)
+             add_data(self.db, "MsiFileHash",
+                      [(logical, 0, filehash.IntegerData(1),
+                        filehash.IntegerData(2), filehash.IntegerData(3),
+                        filehash.IntegerData(4))])
          # Automatically remove .pyc/.pyo files on uninstall (2)
          # XXX: adding so many RemoveFile entries makes installer unbelievably
***************
*** 523,527 ****
          if parent:
              attributes |= 2 # follow parent
! 	    parent = parent.id
          add_data(db, "Feature",
                          [(id, parent, title, desc, display,
--- 541,545 ----
          if parent:
              attributes |= 2 # follow parent
!             parent = parent.id
          add_data(db, "Feature",
                          [(id, parent, title, desc, display,

Index: sequence.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/msi/sequence.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** sequence.py	1 Aug 2004 17:18:16 -0000	1.2
--- sequence.py	1 Aug 2004 22:14:19 -0000	1.3
***************
*** 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),
--- 77,81 ----
  (u'RemoveDuplicateFiles', None, 3400),
  (u'RemoveEnvironmentStrings', None, 3300),
! (u'RemoveExistingProducts', None, 6700),
  (u'RemoveFiles', None, 3500),
  (u'RemoveFolders', None, 3600),



More information about the Python-checkins mailing list