def _AddVersionResource(self, fileName): try: from win32verstamp import stamp except: print("*** WARNING *** unable to create version resource") print("install pywin32 extensions first") return versionInfo = VersionInfo(self.metadata.version, comments = self.metadata.long_description, description = self.metadata.description, company = self.metadata.author, product = self.metadata.name) stamp(fileName, versionInfo)
def _AddVersionResource(self, exe): warning_msg = "*** WARNING *** unable to create version resource" try: from win32verstamp import stamp except: print(warning_msg) print("install pywin32 extensions first") return if not self.metadata.version: print(warning_msg) print("version must be specified") return fileName = exe.targetName versionInfo = VersionInfo(self.metadata.version, comments=self.metadata.long_description, description=self.metadata.description, company=self.metadata.author, product=self.metadata.name, copyright=exe.copyright, trademarks=exe.trademarks) stamp(fileName, versionInfo)
] get_version = lambda: "%s-win32" % (_get_version(), ) # Monkey-patch _AddVersionResource in cx_Freeze so win32verstamp will # not bitch about non-numeric version RE_NUMBER = re.compile(r'v?([0-9]+).*') extract_number = lambda x : RE_NUMBER.match(x).group(1) if \ RE_NUMBER.match(x) else "0" win32version = lambda x: ".".join( [extract_number(i) for i in x.split(".")[0:4]]) Freezer._AddVersionResource = lambda self, filename : \ stamp(filename, VersionInfo( win32version(self.metadata.version), comments = self.metadata.long_description, description = self.metadata.description, company = self.metadata.author, product = self.metadata.name )) setup(name="Syncthing GTK", author="Kozec", version=get_version(), description="Windows port of Syncthing GTK", options=dict(build_exe=dict(compressed=False, includes=["gi"], packages=["gi"], include_files=include_files), ), executables=executables) if 'build' in sys.argv:
] get_version = lambda : "%s-win32" % (_get_version(),) # Monkey-patch _AddVersionResource in cx_Freeze so win32verstamp will # not bitch about non-numeric version RE_NUMBER = re.compile(r'v?([0-9]+).*') extract_number = lambda x : RE_NUMBER.match(x).group(1) if \ RE_NUMBER.match(x) else "0" win32version = lambda x : ".".join([ extract_number(i) for i in x.split(".") ]) Freezer._AddVersionResource = lambda self, filename : \ stamp(filename, VersionInfo( win32version(self.metadata.version), comments = self.metadata.long_description, description = self.metadata.description, company = self.metadata.author, product = self.metadata.name )) setup( name = "Syncthing GTK", author = "Kozec", version = get_version(), description = "Windows port of Sycnthing GTK", options = dict( build_exe = dict( compressed = False, includes = ["gi"], packages = ["gi"], include_files = include_files
os.makedirs(dst_dir) except: pass shutil.copy(full_path, dst_dir) # Add version information to exe files. for script in script_list: script_exe = os.path.splitext(os.path.basename(script))[0] + ".exe" # Don't add to dev build versions. if not re.search('[a-zA-Z_-]', build_version): versionInfo = VersionInfo(build_version, description="Deluge Bittorrent Client", company="Deluge Team", product="Deluge", copyright="Deluge Team") stamp(os.path.join(build_dir, script_exe), versionInfo) # Copy version info to file for nsis script. with open('VERSION.tmp', 'w') as ver_file: ver_file.write("build_version = \"%s\"" % build_version) # Create the install and uninstall file list for NSIS. filedir_list = [] for root, dirnames, filenames in os.walk(build_dir): dirnames.sort() filenames.sort() filedir_list.append((root[len(build_dir):], filenames)) with open('install_files.nsh', 'w') as f: f.write('; Files to install\n') for dirname, files in filedir_list:
os.makedirs(dst_dir) except OSError: pass shutil.copy(full_path, dst_dir) # Add version information to exe files. for script in script_list: script_exe = os.path.splitext(os.path.basename(script))[0] + '.exe' # Don't add to dev build versions. if not re.search('[a-zA-Z_-]', build_version): versionInfo = VersionInfo(build_version, description='Deluge Bittorrent Client', company='Deluge Team', product='Deluge', _copyright='Deluge Team') stamp(os.path.join(build_dir, script_exe), versionInfo) # Copy version info to file for nsis script. with open('VERSION.tmp', 'w') as ver_file: ver_file.write('build_version = "%s"' % build_version) # Create the install and uninstall file list for NSIS. filedir_list = [] for root, dirnames, filenames in os.walk(build_dir): dirnames.sort() filenames.sort() filedir_list.append((root[len(build_dir):], filenames)) with open('install_files.nsh', 'w') as f: f.write('; Files to install\n') for dirname, files in filedir_list:
get_version = lambda: "%s-win32" % (_get_version(), ) # Monkey-patch _AddVersionResource in cx_Freeze so win32verstamp will # not bitch about non-numeric version RE_NUMBER = re.compile(r'v?([0-9]+).*') extract_number = lambda x : RE_NUMBER.match(x).group(1) if \ RE_NUMBER.match(x) else "0" win32version = lambda x: ".".join( [extract_number(i) for i in x.split(".")[0:4]]) Freezer._AddVersionResource = lambda self, exe : \ stamp(exe.targetName, VersionInfo( win32version(self.metadata.version), comments = self.metadata.long_description, description = self.metadata.description, company = self.metadata.author, product = self.metadata.name, copyright = exe.copyright, trademarks = exe.trademarks )) setup(name="Syncthing GTK", author="Kozec", version=get_version(), description="Windows port of Syncthing GTK", options=dict(build_exe=dict(includes=["gi"], packages=["gi", "bcrypt", "cffi"], include_files=include_files), ), executables=executables) if 'build' in sys.argv:
), ] get_version = lambda: "%s-win32" % (_get_version(),) # Monkey-patch _AddVersionResource in cx_Freeze so win32verstamp will # not bitch about non-numeric version RE_NUMBER = re.compile(r"v?([0-9]+).*") extract_number = lambda x: RE_NUMBER.match(x).group(1) if RE_NUMBER.match(x) else "0" win32version = lambda x: ".".join([extract_number(i) for i in x.split(".")[0:4]]) Freezer._AddVersionResource = lambda self, filename: stamp( filename, VersionInfo( win32version(self.metadata.version), comments=self.metadata.long_description, description=self.metadata.description, company=self.metadata.author, product=self.metadata.name, ), ) setup( name="Syncthing GTK", author="Kozec", version=get_version(), description="Windows port of Syncthing GTK", options=dict(build_exe=dict(compressed=False, includes=["gi"], packages=["gi"], include_files=include_files)), executables=executables, ) if "build" in sys.argv:
get_version = lambda : "%s-win32" % (_get_version(),) # Monkey-patch _AddVersionResource in cx_Freeze so win32verstamp will # not bitch about non-numeric version RE_NUMBER = re.compile(r'v?([0-9]+).*') extract_number = lambda x : RE_NUMBER.match(x).group(1) if \ RE_NUMBER.match(x) else "0" win32version = lambda x : ".".join([ extract_number(i) for i in x.split(".")[0:4] ]) Freezer._AddVersionResource = lambda self, exe : \ stamp(exe.targetName, VersionInfo( win32version(self.metadata.version), comments = self.metadata.long_description, description = self.metadata.description, company = self.metadata.author, product = self.metadata.name, copyright = exe.copyright, trademarks = exe.trademarks )) setup( name = "Syncthing GTK", author = "Kozec", version = get_version(), description = "Windows port of Syncthing GTK", options = dict( build_exe = dict( includes = [ "gi" ], packages = [ "gi", "bcrypt", "cffi" ], include_files = include_files