From 365715699036c951f756ba951fb821c02bcd7998 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 21 Jul 2009 01:20:24 +0000 Subject: [PATCH] make a dmg --- direct/src/plugin_npapi/make_osx_bundle.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/direct/src/plugin_npapi/make_osx_bundle.py b/direct/src/plugin_npapi/make_osx_bundle.py index c686558369..ccc15e03f4 100755 --- a/direct/src/plugin_npapi/make_osx_bundle.py +++ b/direct/src/plugin_npapi/make_osx_bundle.py @@ -96,7 +96,8 @@ def makeBundle(startDir): optDir = optDirs[0] # Generate the bundle directory structure - bundleFilename = Filename(fstartDir, 'nppanda3d.plugin') + rootFilename = Filename(fstartDir, 'bundle') + bundleFilename = Filename(rootFilename, 'nppanda3d.plugin') plistFilename = Filename(bundleFilename, 'Contents/Info.plist') plistFilename.makeDir() exeFilename = Filename(bundleFilename, 'Contents/MacOS/nppanda3d') @@ -129,6 +130,18 @@ def makeBundle(startDir): bundleFilename.touch() print bundleFilename.toOsSpecific() +def buildDmg(startDir): + fstartDir = Filename.fromOsSpecific(startDir) + rootFilename = Filename(fstartDir, 'bundle') + output = Filename(fstartDir, 'nppanda3d.dmg') + cmd = 'hdiutil create -fs HFS+ -srcfolder "%(dir)s" -volname "%(volname)s" "%(output)s"' % { + 'dir' : rootFilename.toOsSpecific(), + 'volname' : 'nppanda3d', + 'output' : output.toOsSpecific(), + } + os.system(cmd) + shutil.rmtree(rootFilename.toOsSpecific()) + if __name__ == '__main__': try: opts, args = getopt.getopt(sys.argv[1:], 'h') @@ -144,4 +157,5 @@ if __name__ == '__main__': startDir = os.path.split(sys.argv[0])[0] makeBundle(startDir) + buildDmg(startDir)