Commits

Anthony Tuininga committed 0660af7

Added support for adding arbitrary data to the MSI.

Comments (0)

Files changed (1)

cx_Freeze/windist.py

         ('upgrade-code=', None, 'upgrade code to use'),
         ('initial-target-dir=', None, 'initial target directory'),
         ('target-name=', None, 'name of the file to create'),
-        ('directories=', None, 'list of 3-tuples of directories to create')
+        ('directories=', None, 'list of 3-tuples of directories to create'),
+        ('data=', None, 'dictionary of data indexed by table name')
     ]
     x = y = 50
     width = 370
                                 executable.shortcutName, "TARGETDIR",
                                 "[TARGETDIR]%s" % baseName, None, None, None,
                                 None, None, None, None)])
+        for tableName, data in self.data.items():
+            msilib.add_data(self.db, tableName, data)
 
     def add_cancel_dialog(self):
         dialog = msilib.Dialog(self.db, "CancelDlg", 50, 10, 260, 85, 3,
             self.target_name = os.path.join(self.dist_dir, self.target_name)
         if self.directories is None:
             self.directories = []
+        if self.data is None:
+            self.data = {}
 
     def initialize_options(self):
         distutils.command.bdist_msi.bdist_msi.initialize_options(self)
         self.initial_target_dir = None
         self.target_name = None
         self.directories = None
+        self.data = None
 
     def run(self):
         if not self.skip_build: