当前位置: 首页>>代码示例>>Python>>正文


Python msilib.add_data函数代码示例

本文整理汇总了Python中msilib.add_data函数的典型用法代码示例。如果您正苦于以下问题:Python add_data函数的具体用法?Python add_data怎么用?Python add_data使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了add_data函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: add_config

 def add_config(self, fullname):
     # Hardwired b/c there is only one Executable() above
     index = 0
     baseName = os.path.basename(self.distribution.executables[index].targetName)
     # http://stackoverflow.com/questions/24195311/how-to-set-shortcut-working-directory-in-cx-freeze-msi-bundle
     msilib.add_data(
         self.db,
         "Shortcut",
         [
             (
                 "S_APP_%s" % index,
                 "DesktopFolder",
                 "QWeb",
                 "TARGETDIR",
                 "[TARGETDIR]%s" % baseName,
                 None,
                 None,
                 None,
                 None,
                 None,
                 None,
                 "TARGETDIR",
             )
         ],
     )
     cx_Freeze.bdist_msi.add_config(self, fullname)
开发者ID:lynch829,项目名称:radtrack,代码行数:26,代码来源:cx_freeze_win32.py

示例2: add_find_python

 def add_find_python(self):
     """Adds code to the installer to compute the location of Python.
     Properties PYTHON.MACHINE, PYTHON.USER, PYTHONDIR and PYTHON will be set
     in both the execute and UI sequences; PYTHONDIR will be set from
     PYTHON.USER if defined, else from PYTHON.MACHINE.
     PYTHON is PYTHONDIR\python.exe"""
     install_path = r"SOFTWARE\Python\PythonCore\%s\InstallPath" % self.target_version
     add_data(self.db, "RegLocator",
             [("python.machine", 2, install_path, None, 2),
              ("python.user", 1, install_path, None, 2)])
     add_data(self.db, "AppSearch",
             [("PYTHON.MACHINE", "python.machine"),
              ("PYTHON.USER", "python.user")])
     add_data(self.db, "CustomAction",
             [("PythonFromMachine", 51+256, "PYTHONDIR", "[PYTHON.MACHINE]"),
              ("PythonFromUser", 51+256, "PYTHONDIR", "[PYTHON.USER]"),
              ("PythonExe", 51+256, "PYTHON", "[PYTHONDIR]\\python.exe"),
              ("InitialTargetDir", 51+256, "TARGETDIR", "[PYTHONDIR]")])
     add_data(self.db, "InstallExecuteSequence",
             [("PythonFromMachine", "PYTHON.MACHINE", 401),
              ("PythonFromUser", "PYTHON.USER", 402),
              ("PythonExe", None, 403),
              ("InitialTargetDir", 'TARGETDIR=""', 404),
             ])
     add_data(self.db, "InstallUISequence",
             [("PythonFromMachine", "PYTHON.MACHINE", 401),
              ("PythonFromUser", "PYTHON.USER", 402),
              ("PythonExe", None, 403),
              ("InitialTargetDir", 'TARGETDIR=""', 404),
             ])
开发者ID:CaoYouXin,项目名称:myfirstapicloudapp,代码行数:30,代码来源:bdist_msi.py

示例3: control_service

		def control_service(service):
			start_on = service.control.get('start_on', 0)
			stop_on = service.control.get('stop_on', 0)
			remove_on = service.control.get('remove_on', 0)

			if not (start_on or stop_on or remove_on):
				log.warn('skipping controller for %s service, no events specified', service.name)
			else:
				log.info('adding controller for %s service', service.name)

			comp_id = get_service_comp(service)

			event = (
			(Service._msidbServiceControlEventStart if start_on & Service.INSTALL else 0) |
			(Service._msidbServiceControlEventStop if stop_on & Service.INSTALL else 0) |
			(Service._msidbServiceControlEventDelete if remove_on & Service.INSTALL else 0) |
			(Service._msidbServiceControlEventUninstallStart if start_on & Service.UNINSTALL else 0) |
			(Service._msidbServiceControlEventUninstallStop if stop_on & Service.UNINSTALL else 0) |
			(Service._msidbServiceControlEventUninstallDelete if remove_on & Service.UNINSTALL else 0))

			msilib.add_data(self.db, 'ServiceControl', [(
				comp_id,  # ServiceControl
				service.name,  # Name
				event,  # Event
				'~'.join(service.control.get('args', [])),  # Arguments
				1 if service.control.get('wait', True) else 0,  # Wait
				comp_id  # Component_
			)])
开发者ID:clach04,项目名称:py2exe2msi,代码行数:28,代码来源:command.py

示例4: add_scripts

 def add_scripts(self):
     if self.install_script:
         start = 6800
         for ver in self.versions + [self.other_version]:
             install_action = "install_script." + ver
             exe_prop = "PYTHON" + ver
             add_data(self.db, "CustomAction", [(install_action, 50, exe_prop, self.install_script_key)])
             add_data(self.db, "InstallExecuteSequence", [(install_action, "&Python%s=3" % ver, start)])
             start += 1
     # XXX pre-install scripts are currently refused in finalize_options()
     #     but if this feature is completed, it will also need to add
     #     entries for each version as the above code does
     if self.pre_install_script:
         scriptfn = os.path.join(self.bdist_dir, "preinstall.bat")
         f = open(scriptfn, "w")
         # The batch file will be executed with [PYTHON], so that %1
         # is the path to the Python interpreter; %0 will be the path
         # of the batch file.
         # rem ="""
         # %1 %0
         # exit
         # """
         # <actual script>
         f.write('rem ="""\n%1 %0\nexit\n"""\n')
         f.write(open(self.pre_install_script).read())
         f.close()
         add_data(self.db, "Binary", [("PreInstall", msilib.Binary(scriptfn))])
         add_data(self.db, "CustomAction", [("PreInstall", 2, "PreInstall", None)])
         add_data(self.db, "InstallExecuteSequence", [("PreInstall", "NOT Installed", 450)])
开发者ID:469306621,项目名称:Languages,代码行数:29,代码来源:bdist_msi.py

示例5: add_scripts

 def add_scripts(self):
     if self.install_script:
         add_data(self.db, "CustomAction",
                 [("install_script", 50, "PYTHON", self.install_script_key)])
         add_data(self.db, "InstallExecuteSequence",
                 [("install_script", "NOT Installed", 6800)])
     if self.pre_install_script:
         scriptfn = os.path.join(self.bdist_dir, "preinstall.bat")
         f = open(scriptfn, "w")
         # The batch file will be executed with [PYTHON], so that %1
         # is the path to the Python interpreter; %0 will be the path
         # of the batch file.
         # rem ="""
         # %1 %0
         # exit
         # """
         # <actual script>
         f.write('rem ="""\n%1 %0\nexit\n"""\n')
         f.write(open(self.pre_install_script).read())
         f.close()
         add_data(self.db, "Binary",
             [("PreInstall", msilib.Binary(scriptfn))
             ])
         add_data(self.db, "CustomAction",
             [("PreInstall", 2, "PreInstall", None)
             ])
         add_data(self.db, "InstallExecuteSequence",
                 [("PreInstall", "NOT Installed", 450)])
开发者ID:CaoYouXin,项目名称:myfirstapicloudapp,代码行数:28,代码来源:bdist_msi.py

示例6: add_exit_dialog

        def add_exit_dialog(self):
            # Add the license screen
            if self.get_licence() is not None:
                self.add_licence_dialog()

            # Allow to customize the MSI
            if hasattr(self.attribs, 'customize_msi'):
                self.attribs.customize_msi(self.db)

            # Add the product icon in control panel Install/Remove softwares
            icon_file = os.path.join(self.attribs.get_icons_home(),
                                     self.attribs.get_win_icon())
            if os.path.exists(icon_file):
                msilib.add_data(self.db, 'Property', [
                    ('ARPPRODUCTICON', 'InstallIcon'),
                ])
                msilib.add_data(self.db, 'Icon', [(
                    'InstallIcon', msilib.Binary(icon_file))])

            # Copy/paste from parent's method
            dialog = distutils.command.bdist_msi.PyDialog(
                self.db, 'ExitDialog',
                self.x, self.y, self.width, self.height, self.modal,
                self.title, 'Finish', 'Finish', 'Finish')
            dialog.title('Completing the [ProductName]')
            dialog.back('< Back', 'Finish', active=False)
            dialog.cancel('Cancel', 'Back', active=False)
            dialog.text(
                'Description', 15, 235, 320, 20, 0x30003,
                'Click the Finish button to exit the installer.')
            button = dialog.next('Finish', 'Cancel', name='Finish')
            button.event('EndDialog', 'Return')

            """
开发者ID:ssdi-drive,项目名称:nuxeo-drive,代码行数:34,代码来源:__init__.py

示例7: add_text_styles

 def add_text_styles(self):
     msilib.add_data(self.db, 'TextStyle',
             [("DlgFont8", "Tahoma", 9, None, 0),
              ("DlgFontBold8", "Tahoma", 8, None, 1),
              ("VerdanaBold10", "Verdana", 10, None, 1),
              ("VerdanaRed9", "Verdana", 9, 255, 0)
             ])
开发者ID:Active8-BV,项目名称:cryptobox_app,代码行数:7,代码来源:windist.py

示例8: merge

def merge(msi, feature, rootdir, modules):
    cab_and_filecount = []
    # Step 1: Merge databases, extract cabfiles
    m = msilib.MakeMerge2()
    m.OpenLog("merge.log")
    print "Opened Log"
    m.OpenDatabase(msi)
    print "Opened DB"
    for module in modules:
        print module
        m.OpenModule(module, 0)
        print "Opened Module", module
        m.Merge(feature, rootdir)
        print "Errors:"
        for e in m.Errors:
            print e.Type, e.ModuleTable, e.DatabaseTable
            print "   Modkeys:",
            for s in e.ModuleKeys:
                print s,
            print
            print "   DBKeys:",
            for s in e.DatabaseKeys:
                print s,
            print
        cabname = tempfile.mktemp(suffix=".cab")
        m.ExtractCAB(cabname)
        cab_and_filecount.append((cabname, len(m.ModuleFiles)))
        m.CloseModule()
    m.CloseDatabase(True)
    m.CloseLog()

    # Step 2: Add CAB files
    i = msilib.MakeInstaller()
    db = i.OpenDatabase(msi, win32com.client.constants.msiOpenDatabaseModeTransact)

    v = db.OpenView("SELECT LastSequence FROM Media")
    v.Execute(None)
    maxmedia = -1
    while 1:
        r = v.Fetch()
        if not r:
            break
        seq = r.IntegerData(1)
        if seq > maxmedia:
            maxmedia = seq
    print "Start of Media", maxmedia

    for cabname, count in cab_and_filecount:
        stream = "merged%d" % maxmedia
        msilib.add_data(db, "Media", [(maxmedia + 1, maxmedia + count, None, "#" + stream, None, None)])
        msilib.add_stream(db, stream, cabname)
        os.unlink(cabname)
        maxmedia += count
    # The merge module sets ALLUSERS to 1 in the property table.
    # This is undesired; delete that
    v = db.OpenView("DELETE FROM Property WHERE Property='ALLUSERS'")
    v.Execute(None)
    v.Close()
    db.Commit()
开发者ID:Androtos,项目名称:toolchain_benchmark,代码行数:59,代码来源:merge.py

示例9: run

	def run(self):
		if not (os.path.isdir(self.bdist_dir) and self.skip_build):
			self.run_command('py2exe')

		fullname = self.distribution.get_fullname()
		installer_name = self.get_installer_filename(fullname)
		installer_name = os.path.abspath(installer_name)

		if os.path.exists(installer_name):
			os.unlink(installer_name)

		metadata = self.distribution.metadata
		author = metadata.author

		if not author:
			author = metadata.maintainer
		if not author:
			author = 'UNKNOWN'

		version = metadata.get_version()
		sversion = '%d.%d.%d' % StrictVersion(version).version
		product_name = self.distribution.get_name()

		log.info('creating MSI package %s', installer_name)

		self.db = msilib.init_database(installer_name, schema,
				product_name, self.product_code or msilib.gen_uuid(), sversion, author)

		msilib.add_tables(self.db, sequence)

		props = []

		if self.upgrade_code:
			props.extend([
				('UpgradeCode', self.upgrade_code),
				('SecureCustomProperties', 'REPLACE')
			])

			msilib.add_data(self.db, 'Upgrade', [(
				self.upgrade_code,  # UpgradeCode
				None,  # VersionMin, detect all
				sversion,  # VersionMax
				None,  # Language
				0,  # Attributes
				None,  # Remove, REMOVE=ALL
				'REPLACE'  # ActionProperty
			)])

		if props:
			msilib.add_data(self.db, 'Property', props)

		self.add_files()
		self.add_services()

		self.db.Commit()

		if not self.keep_temp:
			remove_tree(self.bdist_dir, dry_run=self.dry_run)
			remove_tree(self.get_finalized_command('build').build_base)
开发者ID:clach04,项目名称:py2exe2msi,代码行数:59,代码来源:command.py

示例10: add_upgrade_config

 def add_upgrade_config(self, sversion):
     if self.upgrade_code is not None:
         msilib.add_data(self.db, 'Upgrade',
                 [(self.upgrade_code, None, sversion, None, 513, None,
                         "REMOVEOLDVERSION"),
                  (self.upgrade_code, sversion, None, None, 257, None,
                         "REMOVENEWVERSION")
                 ])
开发者ID:Active8-BV,项目名称:cryptobox_app,代码行数:8,代码来源:windist.py

示例11: customize_msi

 def customize_msi(self, db):
     import msilib
     # Add the possibility to bind an engine with MSI
     msilib.add_data(db, "CustomAction", [("NuxeoDriveBinder", 82,
                     self.get_win_targetName(),
                     "bind-server --password \"[TARGETPASSWORD]\" --local-folder \"[TARGETDRIVEFOLDER]\" [TARGETUSERNAME] [TARGETURL]")])
     msilib.add_data(db, "InstallExecuteSequence", [("NuxeoDriveBinder",
                           'NOT (TARGETUSERNAME="" OR TARGETURL="")', -1)])
开发者ID:Bindupriya,项目名称:nuxeo-drive,代码行数:8,代码来源:setup.py

示例12: add_config

 def add_config(self, fullname):
     """add the uninstaller icon"""
     windist.bdist_msi.add_config(self, fullname)
     msilib.add_data(self.db, "Registry", [("DisplayIcon",  # Registry
                                            -1,  # Root
                                            r"Software\Microsoft\Windows\CurrentVersion\Uninstall\%s" %
                                            self.productcode(),  # Key
                                            "DisplayIcon",  # Name
                                            r"[icons]kajongg.ico",  # Value
                                            "TARGETDIR")])  # default Component
开发者ID:KDE,项目名称:kajongg,代码行数:10,代码来源:setup.py

示例13: add_files

    def add_files(self):
        db = self.db
        cab = msilib.CAB('distfiles')
        rootdir = os.path.abspath(self.bdist_dir)
        root = Directory(db, cab, None, rootdir, 'TARGETDIR', 'SourceDir')
        f = Feature(db, 'Python', 'Python', 'Everything', 0, 1, directory='TARGETDIR')
        items = [(f, root, '')]
        for version in self.versions + [self.other_version]:
            target = 'TARGETDIR' + version
            name = default = 'Python' + version
            desc = 'Everything'
            if version is self.other_version:
                title = 'Python from another location'
                level = 2
            else:
                title = 'Python %s from registry' % version
                level = 1
            f = Feature(db, name, title, desc, 1, level, directory=target)
            dir = Directory(db, cab, root, rootdir, target, default)
            items.append((f, dir, version))

        db.Commit()
        seen = {}
        for feature, dir, version in items:
            todo = [dir]
            while todo:
                dir = todo.pop()
                for file in os.listdir(dir.absolute):
                    afile = os.path.join(dir.absolute, file)
                    if os.path.isdir(afile):
                        short = '%s|%s' % (dir.make_short(file), file)
                        default = file + version
                        newdir = Directory(db, cab, dir, file, default, short)
                        todo.append(newdir)
                    else:
                        if not dir.component:
                            dir.start_component(dir.logical, feature, 0)
                        if afile not in seen:
                            key = seen[afile] = dir.add_file(file)
                            if file == self.install_script:
                                if self.install_script_key:
                                    raise DistutilsOptionError('Multiple files with name %s' % file)
                                self.install_script_key = '[#%s]' % key
                        else:
                            key = seen[afile]
                            add_data(self.db, 'DuplicateFile', [(key + version,
                              dir.component,
                              key,
                              None,
                              dir.logical)])

            db.Commit()

        cab.commit(db)
        return
开发者ID:webiumsk,项目名称:WOT-0.9.14-CT,代码行数:55,代码来源:bdist_msi.py

示例14: commit

 def commit(self, db):
     filename = tempfile.mktemp()
     msilib.FCICreate(filename, self.files)
     print filename, os.path.getsize(filename)
     sys.stderr.write(str((self.diskId, self.index, None, "#"+self.name, None, None)) + "\n")
     msilib.add_data(db, "Media",
                     [(self.diskId, self.index, None, "#"+self.name, None, None)])
     msilib.add_stream(db, self.name, filename)
     self.diskId += 1
     db.Commit()
     os.unlink(filename)
开发者ID:project-renard-survey,项目名称:xerox-parc-uplib-mirror,代码行数:11,代码来源:build-msi-installer.py

示例15: add_scripts

 def add_scripts(self):
     super().add_scripts()
     start = 6850
     for ver in self.versions + [self.other_version]:
         install_action = "post_batgen." + ver
         exe_prop = "PYTHON" + ver
         add_data(self.db, "CustomAction",
                 [(install_action, 50, exe_prop, '-m shenv.batgen --overwrite -f \"[EmgrBatDir]\\shenv.bat\"')])
         add_data(self.db, "InstallExecuteSequence",
                 [(install_action, "&Python%s=3" % ver, start)])
         start += 1
开发者ID:josharnold52,项目名称:shenv,代码行数:11,代码来源:setup.py


注:本文中的msilib.add_data函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。