title = os.path.splitext(game_name)[0] bits_path = os.path.join(output_d, "bits") if not os.path.exists(bits_path): os.makedirs(bits_path) files_ex = ["DevIL.dll", "ILU.dll", "ILUT.dll", "python26.dll", "fmodex.dll"] files_base = ["GameInfo.txt", "Attributions.txt"] directories = ["Resources", "Config", "Logs"] for file_ex in files_ex: shutil.copyfile(os.path.join(input_d, file_ex), os.path.join(bits_path, file_ex)) for file_base in files_base: shutil.copyfile(os.path.join(input_d, file_base), os.path.join(output_d, file_base)) for directory in directories: recursive_copy(os.path.join(input_d, directory), os.path.join(bits_path, directory)) shutil.copyfile(os.path.join(input_d, "Release", game_name), os.path.join(bits_path, title + ".exe")) script = os.path.join("Resources", "Scripts", "start.py") remoteLib = os.path.join(bits_path, "lib") p = PythonPackage(script, remoteLib) p.run() batch = open(os.path.join(output_d, title + ".bat"), "w") batch.write("cd bits\n\"" + title + ".exe\"") batch.close() if __name__ == '__main__':
'build', os.environ['CONFIGURATION'], os.environ['EXECUTABLE_NAME'] + '.app', 'Contents', 'Resources', 'Scripts' ) if not os.path.exists(dest): os.makedirs(dest) for fileName in glob.glob('*.py'): dstname = os.path.join(dest, fileName) shutil.copyfile(fileName, dstname) # just grabbing this manually for now; if we want to have more libraries, # we'll have to find a more scalable way of doing this source = "iniparse" recursive_copy(source, os.path.join(dest, "iniparse")) if (os.environ['CONFIGURATION'] == 'Debug'): exit(0) source = os.path.join(os.environ['PROJECT_DIR'], os.environ['EXECUTABLE_NAME'], 'Resources') dest = os.path.join( os.environ['PROJECT_DIR'], 'build', os.environ['CONFIGURATION'], os.environ['EXECUTABLE_NAME'] + '.app', 'Contents', 'Resources' ) recursive_copy(source, dest)