📄 rztbld.py
字号:
project.writeln('\tnmake') project.writeln('\tcd ' + os.pardir) project.writeln('\tcd ' + project.module_dir) elif platform.type == 'unix': inst_module = 'v70_%s_%s.bin' % (sysinfo.id, project.target_name) setshell_base = os.path.join(project.src_root_path, 'setshell') setshell_path = os.path.join(setshell_base, project.output_dir) ## Copy RZT file project.writeln('\tcp archive%s ' % archive_extension + setshell_path) ## Create a self extracting exe file containing the archive.rzt file project.writeln('\t(cd ' + setshell_path + '; python ../selfextr.py archive%s ../unix/archive.h)' % archive_extension) project.writeln('\t(cd ' + setshell_base + '; make clean)') project.writeln('\t(cd ' + setshell_base + '; make)') project.writeln('\t(cd ' + setshell_path + '; cat setup archive%s > ' % archive_extension + inst_module + ')') project.writeln('\t(cd ' + setshell_path + '; chmod a+x '+ inst_module +')') elif sysinfo.host_type == 'mac': temp_dir = os.path.join(project.src_root_path, project.module_dir) temp_dir = os.path.join(temp_dir, temp_dir_name) setshell_path1 = os.path.join(project.src_root_path, 'setshell', project.output_dir, 'setshell') setshell_path2 = os.path.join(temp_dir, 'setshell') global g_rzt_apple_script g_rzt_apple_script.Append( '-- Copy the archive', 'tell application "Finder"', 'with timeout of 99999 seconds', 'try', 'Duplicate file "%s" to folder "%s" with replacing' % (setshell_path1, temp_dir), 'on error', 'error "The SETSHELL application did not build"', 'end try', 'end timeout', 'end tell' ) ## FileToResource AppleScript extension not useable on MacOS X ## if BUILDING_ON_PLATFORM environment var doesn't exist, assume MacOS 9 if os.environ.get('BUILD_ON_PLATFORM','') != 'MacOSX': global g_rzt_apple_script g_rzt_apple_script.Append( '-- Combine the archive and setshell application', 'FileToResource "%s" ResourceType "ARCH" ResourceID 128 SourceFile "%s"' % (setshell_path2, rzt_src_path) ) g_compression_type = ''def CopyRZT(platform, project, rzt_file_name): global g_compression_type archive_extension = '.rzt' #if(sysinfo.host_type == 'mac' and g_compression_type == ''): # archive_extension = '.rxt' if(g_compression_type == 'xtr'): archive_extension = '.rxt' if(g_compression_type == 'rfx'): archive_extension = '.rfx' if sysinfo.host_type == 'win32' or platform.name == 'win16': project.writeln('\t' + platform.copy.cmd + ' ' + rzt_file_name + archive_extension + ' ' + project.target_dir) elif platform.type == 'unix': project.writeln('\t' + platform.copy.cmd + ' ' + rzt_file_name + archive_extension + ' ' + project.target_dir) elif sysinfo.host_type == 'mac': rzt_file_path = os.path.join(project.src_root_path, project.module_dir) rzt_file_path = os.path.join(rzt_file_path, rzt_file_name + archive_extension) global g_rzt_apple_script g_rzt_apple_script.Append( '-- Copy the archive', 'tell application "Finder"', 'with timeout of 99999 seconds', 'Duplicate file "%s" to folder "%s" with replacing' % (rzt_file_path, os.path.join(project.src_root_path, project.output_dir)), 'end timeout', 'end tell' )def CopyInstaller(platform, project): if sysinfo.host_type == 'win32' or platform.name == 'win16': installer_exe = os.path.join(project.src_root_path, "setshell") installer_exe = os.path.join(installer_exe, project.output_dir + 's') installer_exe = os.path.join(installer_exe, "setup.exe") output_exe = os.path.join(project.target_dir, project.target_name + '.exe') project.writeln('\t' + platform.copy.cmd + ' ' + installer_exe + ' ' + output_exe) elif platform.type == 'unix': inst_module = 'v70_%s_%s.bin' % (sysinfo.id, project.target_name) installer_exe = os.path.join(project.src_root_path, 'setshell') installer_exe = os.path.join(installer_exe, project.output_dir) installer_exe = os.path.join(installer_exe, inst_module) output_exe = os.path.join(project.target_dir, inst_module) project.writeln('\tcp ' + installer_exe + ' ' + output_exe) elif sysinfo.host_type == 'mac': # XXX: HACK! Choose name of final installer target. if project.target_name == 'playinst': installer_name = 'RealPlayer Installer' elif project.target_name == 'plusinst': installer_name = 'RealPlayerPlus Installer' elif project.target_name == 'playinstnetscape': installer_name = 'RealPlayerNS Installer' elif project.target_name == 'encg2sdk': installer_name = 'RealProducer G2 SDK Installer' elif project.target_name == 'encinst': installer_name = 'RealProducer G2 Installer' elif project.target_name == 'pubinst': installer_name = 'RealProducer Plus G2 Installer' elif project.target_name == 'mppinst': installer_name = 'RealBandwidthSimulator Setup' elif project.target_name == 'preminst': installer_name = 'Real Premiere Plug-in Setup' elif project.target_name == 'geoprodinst': installer_name = 'RealProd Geo G2 Installer' elif project.target_name == 'geoprodplusinst': installer_name = 'RealProd Geo Plus G2 Installer' elif project.target_name == 'dsn6inst': installer_name = 'RealPlayer Installer' elif project.target_name == 'dsnpinst': installer_name = 'RealPlayerPlus Installer' elif project.target_name == 'mac_ah60': installer_name = '@HomePlayer Installer' elif project.target_name == 'mac_rm6u': installer_name = 'Education RM6U Installer' elif project.target_name == 'mac_rm6s': installer_name = 'ISP RM6S Installer' elif project.target_name == 'mac_rm6n': installer_name = 'Online RM6N Installer' elif project.target_name == 'mac_rm6z': installer_name = 'OEM RM6Z Installer' elif project.target_name == 'mac_rm6m': installer_name = 'Misc RM6M Installer' elif project.target_name == 'mac_rm6p': installer_name = 'Peripheral RM6P Installer' elif project.target_name == 'mac_rm6a': installer_name = 'Publishing RM6A Installer' elif project.target_name == 'mac_dsn6': installer_name = 'Disney DSN6 Installer' elif project.target_name == 'mac_ns60': installer_name = 'Netscape NS60 Installer' elif project.target_name == 'mac_aol6': installer_name = 'AOL AOL6 Installer' elif project.target_name == 'mac_elm6': installer_name = 'Earthlink ELM6 Installer' elif project.target_name == 'iw60inst': installer_name = 'IWorld IW6M Installer' elif project.target_name == 'mac_rm6c': installer_name = 'Generic RM6C Installer' elif project.target_name == 'nscpinst': installer_name = 'Netscape NS60 Installer' elif project.target_name == 'mac_uvom': installer_name = 'UVOM Installer' elif project.target_name == 'rn7ninst': installer_name = 'RealPlayer Installer' elif project.target_name == 'stubinst': installer_name = 'RealStub Installer' elif project.target_name == 'alchinst': installer_name = 'Alchemy Installer' elif project.target_name == 'geminst': installer_name = 'Gemini Installer' elif project.target_name == 'gemembedinst': installer_name = 'Gemembed Installer' elif project.target_name == 'aol7inst': installer_name = 'AOL7 Installer' elif project.target_name == 'mac_rm7u': installer_name = 'Education RM7U Installer' elif project.target_name == 'mac_rm7s': installer_name = 'ISP RM7S Installer' elif project.target_name == 'mac_rm7n': installer_name = 'Online RM7N Installer' elif project.target_name == 'mac_rm7z': installer_name = 'OEM RM7Z Installer' elif project.target_name == 'mac_rm7m': installer_name = 'Misc RM7M Installer' elif project.target_name == 'mac_rm7p': installer_name = 'Peripheral RM7P Installer' elif project.target_name == 'mac_rm7a': installer_name = 'Publishing RM7A Installer' elif project.target_name == 'rm8uinst': installer_name = 'Education RM8U Installer' elif project.target_name == 'rm8sinst': installer_name = 'ISP RM8S Installer' elif project.target_name == 'rm8ninst': installer_name = 'Online RM8N Installer' elif project.target_name == 'rm8zinst': installer_name = 'OEM RM8Z Installer' elif project.target_name == 'rm8minst': installer_name = 'Misc RM8M Installer' elif project.target_name == 'rm8pinst': installer_name = 'Peripheral RM8P Installer' elif project.target_name == 'rm8ainst': installer_name = 'Publishing RM8A Installer' elif project.target_name == 'il8binst': installer_name = 'IL8B Plus Installer' else: ## don't need big if stmt anymore, use g_product_name set in CreateProductHeader installer_name = g_product_name + ' Installer' ##'UNKNOWN INSTALLER' setshell_path = os.path.join(project.src_root_path, project.module_dir, temp_dir_name, 'setshell') installer_path = os.path.join(project.src_root_path, project.module_dir, temp_dir_name, installer_name) global g_rzt_apple_script g_rzt_apple_script.Append( '--Rename the installer, copy it out of the tempdir, and dispose of the tempdir', 'tell application "Finder"', 'with timeout of 99999 seconds', 'set name of file "%s" to "%s"' % (setshell_path, installer_name), 'if file "%s" exists then' % (os.path.join(project.src_root_path, project.output_dir, installer_name)), 'delete file "%s"' % (os.path.join(project.src_root_path, project.output_dir, installer_name)), 'end if', 'Duplicate file "%s" to folder "%s" with replacing' % (installer_path, os.path.join(project.src_root_path, project.output_dir)), 'end timeout', 'end tell' )def Terminate(platform, project): distcode_files = [] product_distcode = '' product_executable = '' if sysinfo.host_type == 'mac': global g_rzt_apple_script if os.path.exists(pnpkg_path): g_rzt_apple_script.Append( 'tell application "%s" to quit' % (pnpkg_path)) g_rzt_apple_script.Append( ' return ""', 'end all', 'return all()' ) project.append_script(g_rzt_apple_script) # free the AppleScript by de-referencing it g_rzt_apple_script = None# writes a #define in setshell/compressiontype.h# this was added since we sometimes need to be able to build PnPkg & setshell (upgrade# components and installers) with different compression libraries. Default is ICT compression.def CreateInstCompressionHeader(platform, project, compression_type): if compression_type == 'rfx': line_list = ['#define INSTALL_USE_RICHFX'] elif compression_type == 'xtr': line_list = ['#define INSTALL_USE_XTREME'] elif compression_type == 'ict': line_list = ['#define INSTALL_USE_ICT'] elif compression_type == 'zlib': line_list = ['#define INSTALL_USE_ZLIB'] else: line_list = ['#define INSTALL_USE_ICT'] if sysinfo.host_type != 'mac': compression_hdr_path = os.path.join(project.src_root_path, "setshell") compression_hdr_path = os.path.join(compression_hdr_path, "compressiontype.h") filehandle = open(compression_hdr_path, 'w') filehandle.write(string.join(line_list, '\n')) filehandle.close()def SetCompressionType(platform, project, compression_type): global g_compression_type g_compression_type = compression_type CreateInstCompressionHeader(platform, project, compression_type)def PrintMissingFileWarning(text): print "UMAKE Warning: Could not find file %s" % (text)def DoAllFilesExist(platform, project, component, files, dlls): specfile_path = os.path.join(project.src_root_path, component[2]) if not os.path.isfile(specfile_path): PrintMissingFileWarning(specfile_path) return 0 verfile_path = os.path.join(project.src_root_path, component[1]) if not os.path.isfile(verfile_path): PrintMissingFileWarning(verfile_path) return 0 for dll in dlls: dll_location = os.path.join(dll[2], project.output_dir) dll_location = os.path.join(project.src_root_path, dll_location) dll_name = platform.versioning.create_dll_name(dll[0], dll[2]) if not os.path.isfile(os.path.join(dll_location, dll_name)): PrintMissingFileWarning(os.path.join(dll_location, dll_name)) return 0 for file in files: if not os.path.isfile(os.path.join(project.src_root_path, file[0])): PrintMissingFileWarning(os.path.join(project.src_root_path, file[0])) return 0 return 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -