How to use the py2exe.build_exe.py2exe.run function in py2exe

To help you get started, we’ve selected a few py2exe examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kelvinlawson / pykaraoke / setup.py View on Github external
# the user delete it first if it does.  (This is safer
            # than calling rm_rf() on it, in case the user has
            # specified '/' or some equally foolish directory as the
            # dist directory.)
            if os.path.exists(self.dist_dir):
                print "Error, the directory %s already exists." % (self.dist_dir)
                print "Please remove it before starting this script."
                sys.exit(1)

            # Override py2exe's isSystemDLL because it erroneously
            # flags sdl_ttf.dll and libogg-0.dll as system DLLs
            self.origIsSystemDLL = py2exe.build_exe.isSystemDLL
            py2exe.build_exe.isSystemDLL = self.isSystemDLL

            # Build the .exe files, etc.
            py2exe.build_exe.py2exe.run(self)

            # Now run NSIS to build the installer.
            cmd = '"%(makensis)s" /DVERSION=%(version)s install\\windows_installer.nsi' % {
                'makensis' : self.makensis,
                'version' : pykversion.PYKARAOKE_VERSION_STRING,
                }
            print cmd
            os.system(cmd)

            # Now that we've got an installer, we can empty the dist
            # dir again.
            self.rm_rf(self.dist_dir)
github fcwu / desktop-mirror / windows / builder_win7.py View on Github external
def run(self):
        # First, let py2exe do it's work.
        py2exe.run(self)

        lib_dir = self.lib_dir
        dist_dir = self.dist_dir

        # Create the installer, using the files py2exe has created.
        script = NSISScript('desktop-mirror',
                            'A tools to stream screen(video and audio) out',
                            'dist',
                            os.path.join('share', 'icon.ico'))
        print "*** creating the NSIS setup script***"
        script.create()
        print "*** compiling the NSIS setup script***"
        script.compile()
github Syncplay / syncplay / buildPy2exe.py View on Github external
def run(self):
        py2exe.run(self)
        print('*** deleting unnecessary libraries and modules ***')
        pruneUnneededLibraries()
        print('*** copying qt plugins ***')
        copyQtPlugins(qt_plugins)
        script = NSISScript()
        script.create()
        print("*** compiling the NSIS setup script ***")
        script.compile()
        print("*** DONE ***")
github wummel / dosage / setup.py View on Github external
def run (self):
            """Generate py2exe installer."""
            # First, let py2exe do it's work.
            py2exe_build.run(self)
            print("*** preparing the inno setup script ***")
            lib_dir = self.lib_dir
            dist_dir = self.dist_dir
            # create the Installer, using the files py2exe has created.
            script = InnoScript(lib_dir, dist_dir, self.windows_exe_files,
                self.console_exe_files, self.service_exe_files,
                self.comserver_files, self.lib_files)
            script.create()
            script.compile()
            script.sign()
except ImportError:
github ospaceteam / outerspace / client-msg-wx / setup.py View on Github external
def run(self):
        # First, let py2exe do it's work.
        py2exe.run(self)

        lib_dir = self.lib_dir
        dist_dir = self.dist_dir

        # create the Installer, using the files py2exe has created.
        script = InnoScript("OuterSpace Message Reader",
                            lib_dir,
                            dist_dir,
                            self.windows_exe_files,
                            self.lib_files)
        print "*** creating the inno setup script***"
        script.create()
        print "*** compiling the inno setup script***"
        script.compile()
        # Note: By default the final setup.exe will be in an Output subdirectory.
github twisted / twisted / sandbox / moonfallen / ntsvc / command.py View on Github external
# follow; mostly, these will be imports from strings such as what's
        # done by Nevow.  This is a plugin system.  Add to helpers.helpers
        # if you want your own default module injecting.
        for imported, injected in helpers.items():
            m = mf.findNode(imported)
            if m is not None and m.filename is not None:
                for module, attrs in injected:
                    mf.import_hook(module, m, attrs)
        
        config = os.path.abspath(twcfg['basecf'])
        isinteresting = lambda m: interestingModule(m, config)
        # remove modules that aren't worthy of explicit importing
        li = list(itertools.ifilter(isinteresting, mf.flatten()))
        
        self.includes.extend([node.identifier for node in li])
        return build_exe.run(self)