|
@@ -4,12 +4,11 @@ to build for as many platforms as possible. """
|
|
|
|
|
|
|
|
__all__ = ["Standalone", "Installer"]
|
|
__all__ = ["Standalone", "Installer"]
|
|
|
|
|
|
|
|
-import os, sys, subprocess, tarfile, shutil, time
|
|
|
|
|
|
|
+import os, sys, subprocess, tarfile, shutil, time, zipfile
|
|
|
from direct.directnotify.DirectNotifyGlobal import *
|
|
from direct.directnotify.DirectNotifyGlobal import *
|
|
|
from pandac.PandaModules import PandaSystem, HTTPClient, Filename, VirtualFileSystem
|
|
from pandac.PandaModules import PandaSystem, HTTPClient, Filename, VirtualFileSystem
|
|
|
from direct.p3d.HostInfo import HostInfo
|
|
from direct.p3d.HostInfo import HostInfo
|
|
|
from direct.showbase.AppRunnerGlobal import appRunner
|
|
from direct.showbase.AppRunnerGlobal import appRunner
|
|
|
-import glob
|
|
|
|
|
|
|
|
|
|
class CachedFile:
|
|
class CachedFile:
|
|
|
def __init__(self): self.str = ""
|
|
def __init__(self): self.str = ""
|
|
@@ -415,6 +414,19 @@ class Installer:
|
|
|
archive.add(appfn.toOsSpecific(), appname)
|
|
archive.add(appfn.toOsSpecific(), appname)
|
|
|
archive.close()
|
|
archive.close()
|
|
|
|
|
|
|
|
|
|
+ # Put the .pkg into a zipfile
|
|
|
|
|
+ archive = Filename(output.getDirname(), "%s %s.zip" % (self.fullname, self.version))
|
|
|
|
|
+ dir = Filename(output.getDirname())
|
|
|
|
|
+ dir.makeAbsolute()
|
|
|
|
|
+ zip = zipfile.ZipFile(archive.toOsSpecific(), 'w')
|
|
|
|
|
+ for root, dirs, files in os.walk(output.toOsSpecific()):
|
|
|
|
|
+ for name in files:
|
|
|
|
|
+ file = Filename.fromOsSpecific(os.path.join(root, name))
|
|
|
|
|
+ file.makeAbsolute()
|
|
|
|
|
+ file.makeRelativeTo(dir)
|
|
|
|
|
+ zip.write(os.path.join(root, name), str(file))
|
|
|
|
|
+ zip.close()
|
|
|
|
|
+
|
|
|
return output
|
|
return output
|
|
|
|
|
|
|
|
def buildNSIS(self, output, platform):
|
|
def buildNSIS(self, output, platform):
|