Commits

Anthony Tuininga committed 0e6fbcf

Override the code in the builtin add_files() which tries to add code for each
supported Python version as well in Python 2.7.

Comments (0)

Files changed (1)

cx_Freeze/windist.py

 import distutils.command.bdist_msi
+import distutils.errors
 import distutils.util
 import msilib
 import os
         button = dialog.next("Finish", "Cancel", name = "Finish")
         button.event("EndDialog", "Exit")
 
+    def add_files(self):
+        db = self.db
+        cab = msilib.CAB("distfiles")
+        f = msilib.Feature(db, "default", "Default Feature", "Everything", 1,
+                directory="TARGETDIR")
+        f.set_current()
+        rootdir = os.path.abspath(self.bdist_dir)
+        root = msilib.Directory(db, cab, None, rootdir, "TARGETDIR",
+                "SourceDir")
+        db.Commit()
+        todo = [root]
+        while todo:
+            dir = todo.pop()
+            for file in os.listdir(dir.absolute):
+                if os.path.isdir(os.path.join(dir.absolute, file)):
+                    newDir = msilib.Directory(db, cab, dir, file, file,
+                            "%s|%s" % (dir.make_short(file), file))
+                    todo.append(newDir)
+                else:
+                    dir.add_file(file)
+        cab.commit(db)
+
     def add_files_in_use_dialog(self):
         dialog = distutils.command.bdist_msi.PyDialog(self.db, "FilesInUse",
                 self.x, self.y, self.width, self.height, 19, self.title,
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.