739c739,741 < self.copy_file(src, exe_path, preserve_mode=0) --- > > if not self.dry_run: > self.copy_file(src, exe_path, preserve_mode=0) 742,748c744,751 < # Make sure the file is writeable... < os.chmod(exe_path, stat.S_IREAD | stat.S_IWRITE) < try: < f = open(exe_path, "a+b") < f.close() < except IOError, why: < print "WARNING: File %s could not be opened - %s" % (exe_path, why) --- > if not self.dry_run: > # Make sure the file is writeable... > os.chmod(exe_path, stat.S_IREAD | stat.S_IWRITE) > try: > f = open(exe_path, "a+b") > f.close() > except IOError, why: > print "WARNING: File %s could not be opened - %s" % (exe_path, why) 786a790 > 811a816,838 > > # Handle all resources specified by the target > bitmap_resources = getattr(target, "bitmap_resources", []) > for bmp_id, bmp_filename in bitmap_resources: > bmp_data = open(bmp_filename, "rb").read() > # skip the 14 byte bitmap header. > if not self.dry_run: > add_resource(unicode(exe_path), bmp_data[14:], RT_BITMAP, bmp_id, False) > icon_resources = getattr(target, "icon_resources", []) > for ico_id, ico_filename in icon_resources: > if not self.dry_run: > add_icon(unicode(exe_path), unicode(ico_filename), ico_id) > > for res_type, res_id, data in getattr(target, "other_resources", []): > if not self.dry_run: > if isinstance(res_type, str): > res_type = unicode(res_type) > add_resource(unicode(exe_path), data, res_type, res_id, False) > > typelib = getattr(target, "typelib", None) > if typelib is not None: > data = open(typelib, "rb").read() > add_resource(unicode(exe_path), data, u"TYPELIB", 1, False) 813,836c840 < # Handle all resources specified by the target < bitmap_resources = getattr(target, "bitmap_resources", []) < for bmp_id, bmp_filename in bitmap_resources: < bmp_data = open(bmp_filename, "rb").read() < # skip the 14 byte bitmap header. < if not self.dry_run: < add_resource(unicode(exe_path), bmp_data[14:], RT_BITMAP, bmp_id, False) < icon_resources = getattr(target, "icon_resources", []) < for ico_id, ico_filename in icon_resources: < if not self.dry_run: < add_icon(unicode(exe_path), unicode(ico_filename), ico_id) < < for res_type, res_id, data in getattr(target, "other_resources", []): < if not self.dry_run: < if isinstance(res_type, str): < res_type = unicode(res_type) < add_resource(unicode(exe_path), data, res_type, res_id, False) < < typelib = getattr(target, "typelib", None) < if typelib is not None: < data = open(typelib, "rb").read() < add_resource(unicode(exe_path), data, u"TYPELIB", 1, False) < < self.add_versioninfo(target, exe_path) --- > self.add_versioninfo(target, exe_path) 852,854c856,858 < if self.distribution.zipfile is None: < zip_data = open(arcname, "rb").read() < open(exe_path, "a+b").write(zip_data) --- > if self.distribution.zipfile is None: > zip_data = open(arcname, "rb").read() > open(exe_path, "a+b").write(zip_data)