|
@@ -6,7 +6,9 @@ __all__ = ["Standalone", "Installer"]
|
|
|
|
|
|
|
|
import os, sys, subprocess, tarfile, shutil, time, zipfile, glob
|
|
import os, sys, subprocess, tarfile, shutil, time, zipfile, glob
|
|
|
from direct.directnotify.DirectNotifyGlobal import *
|
|
from direct.directnotify.DirectNotifyGlobal import *
|
|
|
-from pandac.PandaModules import PandaSystem, HTTPClient, Filename, VirtualFileSystem, Multifile, readXmlStream
|
|
|
|
|
|
|
+from direct.showbase.AppRunnerGlobal import appRunner
|
|
|
|
|
+from pandac.PandaModules import PandaSystem, HTTPClient, Filename, VirtualFileSystem, Multifile
|
|
|
|
|
+from pandac.PandaModules import TiXmlDocument, TiXmlDeclaration, TiXmlElement, readXmlStream
|
|
|
from direct.p3d.HostInfo import HostInfo
|
|
from direct.p3d.HostInfo import HostInfo
|
|
|
|
|
|
|
|
class CachedFile:
|
|
class CachedFile:
|
|
@@ -27,7 +29,7 @@ class Standalone:
|
|
|
|
|
|
|
|
hostDir = Filename(Filename.getTempDirectory(), 'pdeploy/')
|
|
hostDir = Filename(Filename.getTempDirectory(), 'pdeploy/')
|
|
|
hostDir.makeDir()
|
|
hostDir.makeDir()
|
|
|
- self.host = HostInfo(PandaSystem.getPackageHostUrl(), appRunner = base.appRunner, hostDir = hostDir, asMirror = False, perPlatform = True)
|
|
|
|
|
|
|
+ self.host = HostInfo(PandaSystem.getPackageHostUrl(), appRunner = appRunner, hostDir = hostDir, asMirror = False, perPlatform = True)
|
|
|
|
|
|
|
|
self.http = HTTPClient.getGlobalPtr()
|
|
self.http = HTTPClient.getGlobalPtr()
|
|
|
if not self.host.hasContentsFile:
|
|
if not self.host.hasContentsFile:
|
|
@@ -61,6 +63,9 @@ class Standalone:
|
|
|
|
|
|
|
|
if platform == None:
|
|
if platform == None:
|
|
|
platform = PandaSystem.getPlatform()
|
|
platform = PandaSystem.getPlatform()
|
|
|
|
|
+
|
|
|
|
|
+ vfs = VirtualFileSystem.getGlobalPtr()
|
|
|
|
|
+
|
|
|
for package in self.host.getPackages(name = "p3dembed", platform = platform):
|
|
for package in self.host.getPackages(name = "p3dembed", platform = platform):
|
|
|
if not package.downloadDescFile(self.http):
|
|
if not package.downloadDescFile(self.http):
|
|
|
Standalone.notify.warning(" -> %s failed for platform %s" % (package.packageName, package.platform))
|
|
Standalone.notify.warning(" -> %s failed for platform %s" % (package.packageName, package.platform))
|
|
@@ -75,7 +80,7 @@ class Standalone:
|
|
|
else:
|
|
else:
|
|
|
p3dembed = Filename(self.host.hostDir, "p3dembed/%s/p3dembed" % package.platform)
|
|
p3dembed = Filename(self.host.hostDir, "p3dembed/%s/p3dembed" % package.platform)
|
|
|
|
|
|
|
|
- if not p3dembed.exists():
|
|
|
|
|
|
|
+ if not vfs.exists(p3dembed):
|
|
|
Standalone.notify.warning(" -> %s failed for platform %s" % (package.packageName, package.platform))
|
|
Standalone.notify.warning(" -> %s failed for platform %s" % (package.packageName, package.platform))
|
|
|
continue
|
|
continue
|
|
|
|
|
|
|
@@ -104,7 +109,11 @@ class Standalone:
|
|
|
output.makeDir()
|
|
output.makeDir()
|
|
|
ohandle = open(output.toOsSpecific(), "wb")
|
|
ohandle = open(output.toOsSpecific(), "wb")
|
|
|
ohandle.write(p3dembed_data)
|
|
ohandle.write(p3dembed_data)
|
|
|
- for token in self.tokens.items():
|
|
|
|
|
|
|
+
|
|
|
|
|
+ # Write out the tokens. Set log_basename to the basename by default
|
|
|
|
|
+ tokens = {"log_basename" : self.basename}
|
|
|
|
|
+ tokens.update(self.tokens)
|
|
|
|
|
+ for token in tokens.items():
|
|
|
ohandle.write("\0%s=%s" % token)
|
|
ohandle.write("\0%s=%s" % token)
|
|
|
ohandle.write("\0\0")
|
|
ohandle.write("\0\0")
|
|
|
|
|
|
|
@@ -134,11 +143,12 @@ class Standalone:
|
|
|
return []
|
|
return []
|
|
|
|
|
|
|
|
filenames = []
|
|
filenames = []
|
|
|
|
|
+ vfs = VirtualFileSystem.getGlobalPtr()
|
|
|
for e in package.extracts:
|
|
for e in package.extracts:
|
|
|
if e.basename not in ["p3dembed", "p3dembed.exe"]:
|
|
if e.basename not in ["p3dembed", "p3dembed.exe"]:
|
|
|
filename = Filename(package.getPackageDir(), e.filename)
|
|
filename = Filename(package.getPackageDir(), e.filename)
|
|
|
filename.makeAbsolute()
|
|
filename.makeAbsolute()
|
|
|
- if filename.exists():
|
|
|
|
|
|
|
+ if vfs.exists(filename):
|
|
|
filenames.append(filename)
|
|
filenames.append(filename)
|
|
|
else:
|
|
else:
|
|
|
Standalone.notify.error("%s mentioned in xml, but does not exist" % e.filename)
|
|
Standalone.notify.error("%s mentioned in xml, but does not exist" % e.filename)
|
|
@@ -187,14 +197,16 @@ class Installer:
|
|
|
self.requirements.append((p3dRequires.Attribute('name'), p3dRequires.Attribute('version')))
|
|
self.requirements.append((p3dRequires.Attribute('name'), p3dRequires.Attribute('version')))
|
|
|
p3dRequires = p3dRequires.NextSiblingElement('requires')
|
|
p3dRequires = p3dRequires.NextSiblingElement('requires')
|
|
|
|
|
|
|
|
- def installPackagesInto(self, rootDir, platform):
|
|
|
|
|
|
|
+ def installPackagesInto(self, hostDir, platform):
|
|
|
""" Installs the packages required by the .p3d file into
|
|
""" Installs the packages required by the .p3d file into
|
|
|
- the specified root directory, for the given platform. """
|
|
|
|
|
|
|
+ the specified directory, for the given platform. """
|
|
|
|
|
|
|
|
if not self.includeRequires:
|
|
if not self.includeRequires:
|
|
|
return
|
|
return
|
|
|
|
|
|
|
|
- host = HostInfo(self.hostUrl, appRunner = base.appRunner, rootDir = rootDir, asMirror = True, perPlatform = False)
|
|
|
|
|
|
|
+ packages = []
|
|
|
|
|
+
|
|
|
|
|
+ host = HostInfo(self.hostUrl, appRunner = appRunner, hostDir = hostDir, asMirror = False, perPlatform = False)
|
|
|
if not host.hasContentsFile:
|
|
if not host.hasContentsFile:
|
|
|
if not host.readContentsFile():
|
|
if not host.readContentsFile():
|
|
|
if not host.downloadContentsFile(self.http):
|
|
if not host.downloadContentsFile(self.http):
|
|
@@ -203,15 +215,17 @@ class Installer:
|
|
|
|
|
|
|
|
for name, version in self.requirements:
|
|
for name, version in self.requirements:
|
|
|
package = host.getPackage(name, version, platform)
|
|
package = host.getPackage(name, version, platform)
|
|
|
|
|
+ package.installed = True # Hack not to let it install itself
|
|
|
|
|
+ packages.append(package)
|
|
|
if not package.downloadDescFile(self.http):
|
|
if not package.downloadDescFile(self.http):
|
|
|
- Standalone.notify.warning(" -> %s failed for platform %s" % (package.packageName, package.platform))
|
|
|
|
|
|
|
+ Installer.notify.warning(" -> %s failed for platform %s" % (package.packageName, package.platform))
|
|
|
continue
|
|
continue
|
|
|
if not package.downloadPackage(self.http):
|
|
if not package.downloadPackage(self.http):
|
|
|
- Standalone.notify.warning(" -> %s failed for platform %s" % (package.packageName, package.platform))
|
|
|
|
|
|
|
+ Installer.notify.warning(" -> %s failed for platform %s" % (package.packageName, package.platform))
|
|
|
continue
|
|
continue
|
|
|
|
|
|
|
|
# Also install the 'images' package from the same host that p3dembed was downloaded from.
|
|
# Also install the 'images' package from the same host that p3dembed was downloaded from.
|
|
|
- host = HostInfo(self.standalone.host.hostUrl, appRunner = base.appRunner, rootDir = rootDir, asMirror = False, perPlatform = False)
|
|
|
|
|
|
|
+ host = HostInfo(self.standalone.host.hostUrl, appRunner = appRunner, hostDir = hostDir, asMirror = False, perPlatform = False)
|
|
|
if not host.hasContentsFile:
|
|
if not host.hasContentsFile:
|
|
|
if not host.readContentsFile():
|
|
if not host.readContentsFile():
|
|
|
if not host.downloadContentsFile(self.http):
|
|
if not host.downloadContentsFile(self.http):
|
|
@@ -219,13 +233,71 @@ class Installer:
|
|
|
return
|
|
return
|
|
|
|
|
|
|
|
for package in host.getPackages(name = "images"):
|
|
for package in host.getPackages(name = "images"):
|
|
|
|
|
+ package.installed = True # Hack not to let it install itself
|
|
|
|
|
+ packages.append(package)
|
|
|
if not package.downloadDescFile(self.http):
|
|
if not package.downloadDescFile(self.http):
|
|
|
- Standalone.notify.warning(" -> %s failed for platform %s" % (package.packageName, package.platform))
|
|
|
|
|
|
|
+ Installer.notify.warning(" -> %s failed for platform %s" % (package.packageName, package.platform))
|
|
|
continue
|
|
continue
|
|
|
if not package.downloadPackage(self.http):
|
|
if not package.downloadPackage(self.http):
|
|
|
- Standalone.notify.warning(" -> %s failed for platform %s" % (package.packageName, package.platform))
|
|
|
|
|
|
|
+ Installer.notify.warning(" -> %s failed for platform %s" % (package.packageName, package.platform))
|
|
|
continue
|
|
continue
|
|
|
break
|
|
break
|
|
|
|
|
+
|
|
|
|
|
+ # Remove the extracted files from the compressed archive, to save space.
|
|
|
|
|
+ vfs = VirtualFileSystem.getGlobalPtr()
|
|
|
|
|
+ for package in packages:
|
|
|
|
|
+ if package.uncompressedArchive:
|
|
|
|
|
+ archive = Filename(package.getPackageDir(), package.uncompressedArchive.filename)
|
|
|
|
|
+ if not archive.exists():
|
|
|
|
|
+ continue
|
|
|
|
|
+
|
|
|
|
|
+ print archive
|
|
|
|
|
+ mf = Multifile()
|
|
|
|
|
+ # Make sure that it isn't mounted before altering it, just to be safe
|
|
|
|
|
+ vfs.unmount(archive)
|
|
|
|
|
+ if not mf.openRead(archive):
|
|
|
|
|
+ Installer.notify.warning("Failed to open archive " + archive)
|
|
|
|
|
+ continue
|
|
|
|
|
+
|
|
|
|
|
+ # We don't iterate over getNumSubfiles because we're
|
|
|
|
|
+ # removing subfiles while we're iterating over them.
|
|
|
|
|
+ subfiles = mf.getSubfileNames()
|
|
|
|
|
+ for subfile in subfiles:
|
|
|
|
|
+ # We do *NOT* call vfs.exists here in case the package is mounted.
|
|
|
|
|
+ if Filename(package.getPackageDir(), subfile).exists():
|
|
|
|
|
+ mf.removeSubfile(subfile)
|
|
|
|
|
+
|
|
|
|
|
+ # This seems essential for mf.close() not to crash later.
|
|
|
|
|
+ mf.repack()
|
|
|
|
|
+
|
|
|
|
|
+ # If we have no subfiles left, we can just remove the multifile.
|
|
|
|
|
+ if mf.getNumSubfiles() == 0:
|
|
|
|
|
+ Installer.notify.info("Removing empty archive " + package.uncompressedArchive.filename)
|
|
|
|
|
+ mf.close()
|
|
|
|
|
+ archive.unlink()
|
|
|
|
|
+ else:
|
|
|
|
|
+ mf.close()
|
|
|
|
|
+
|
|
|
|
|
+ # Write out our own contents.xml file.
|
|
|
|
|
+ doc = TiXmlDocument()
|
|
|
|
|
+ decl = TiXmlDeclaration("1.0", "utf-8", "")
|
|
|
|
|
+ doc.InsertEndChild(decl)
|
|
|
|
|
+
|
|
|
|
|
+ xcontents = TiXmlElement("contents")
|
|
|
|
|
+ for package in packages:
|
|
|
|
|
+ xpackage = TiXmlElement('package')
|
|
|
|
|
+ xpackage.SetAttribute('name', package.packageName)
|
|
|
|
|
+ if package.platform:
|
|
|
|
|
+ xpackage.SetAttribute('platform', package.platform)
|
|
|
|
|
+ if package.packageVersion:
|
|
|
|
|
+ xpackage.SetAttribute('version', version)
|
|
|
|
|
+ xpackage.SetAttribute('filename', package.packageName + "/" + package.packageVersion + "/" + package.descFileBasename)
|
|
|
|
|
+ else:
|
|
|
|
|
+ xpackage.SetAttribute('filename', package.packageName + "/" + package.descFileBasename)
|
|
|
|
|
+ xcontents.InsertEndChild(xpackage)
|
|
|
|
|
+
|
|
|
|
|
+ doc.InsertEndChild(xcontents)
|
|
|
|
|
+ doc.SaveFile(Filename(hostDir, "contents.xml").toOsSpecific())
|
|
|
|
|
|
|
|
def buildAll(self, outputDir = "."):
|
|
def buildAll(self, outputDir = "."):
|
|
|
""" Creates a (graphical) installer for every known platform.
|
|
""" Creates a (graphical) installer for every known platform.
|
|
@@ -289,45 +361,26 @@ class Installer:
|
|
|
print >>controlfile, "Description: %s" % self.fullname
|
|
print >>controlfile, "Description: %s" % self.fullname
|
|
|
print >>controlfile, "Depends: libc6, libgcc1, libstdc++6, libx11-6, libssl0.9.8"
|
|
print >>controlfile, "Depends: libc6, libgcc1, libstdc++6, libx11-6, libssl0.9.8"
|
|
|
controlfile.close()
|
|
controlfile.close()
|
|
|
- postinst = open(Filename(tempdir, "postinst").toOsSpecific(), "w")
|
|
|
|
|
- print >>postinst, "#!/bin/sh"
|
|
|
|
|
- print >>postinst, "/usr/bin/%s --prep" % self.shortname.lower()
|
|
|
|
|
- print >>postinst, "chmod -R 777 /usr/share/%s" % self.shortname.lower()
|
|
|
|
|
- print >>postinst, "chmod -R 555 /usr/share/%s/hosts" % self.shortname.lower()
|
|
|
|
|
- postinst.close()
|
|
|
|
|
- os.chmod(Filename(tempdir, "postinst").toOsSpecific(), 0755)
|
|
|
|
|
- postrmfile = open(Filename(tempdir, "postrm").toOsSpecific(), "w")
|
|
|
|
|
- print >>postrmfile, "#!/bin/sh"
|
|
|
|
|
- print >>postrmfile, "rm -rf /usr/share/%s" % self.shortname.lower()
|
|
|
|
|
- postrmfile.close()
|
|
|
|
|
- os.chmod(Filename(tempdir, "postrm").toOsSpecific(), 0755)
|
|
|
|
|
Filename(tempdir, "usr/bin/").makeDir()
|
|
Filename(tempdir, "usr/bin/").makeDir()
|
|
|
- self.standalone.tokens["root_dir"] = "/usr/share/" + self.shortname.lower()
|
|
|
|
|
|
|
+ if self.includeRequires:
|
|
|
|
|
+ self.standalone.tokens["host_dir"] = "/usr/lib/" + self.shortname.lower()
|
|
|
|
|
+ elif "host_dir" in self.standalone.tokens:
|
|
|
|
|
+ del self.standalone.tokens["host_dir"]
|
|
|
self.standalone.build(Filename(tempdir, "usr/bin/" + self.shortname.lower()), platform)
|
|
self.standalone.build(Filename(tempdir, "usr/bin/" + self.shortname.lower()), platform)
|
|
|
if not self.licensefile.empty():
|
|
if not self.licensefile.empty():
|
|
|
Filename(tempdir, "usr/share/doc/%s/" % self.shortname.lower()).makeDir()
|
|
Filename(tempdir, "usr/share/doc/%s/" % self.shortname.lower()).makeDir()
|
|
|
shutil.copyfile(self.licensefile.toOsSpecific(), Filename(tempdir, "usr/share/doc/%s/copyright" % self.shortname.lower()).toOsSpecific())
|
|
shutil.copyfile(self.licensefile.toOsSpecific(), Filename(tempdir, "usr/share/doc/%s/copyright" % self.shortname.lower()).toOsSpecific())
|
|
|
- rootDir = Filename(tempdir, "usr/share/" + self.shortname.lower())
|
|
|
|
|
- rootDir.makeDir()
|
|
|
|
|
- Filename(rootDir, "log").makeDir()
|
|
|
|
|
- Filename(rootDir, "prc").makeDir()
|
|
|
|
|
- Filename(rootDir, "start").makeDir()
|
|
|
|
|
- Filename(rootDir, "certs").makeDir()
|
|
|
|
|
- self.installPackagesInto(rootDir, platform)
|
|
|
|
|
|
|
+ hostDir = Filename(tempdir, "usr/lib/" + self.shortname.lower())
|
|
|
|
|
+ hostDir.makeDir()
|
|
|
|
|
+ self.installPackagesInto(hostDir, platform)
|
|
|
|
|
|
|
|
# Create a control.tar.gz file in memory
|
|
# Create a control.tar.gz file in memory
|
|
|
controlfile = Filename(tempdir, "control")
|
|
controlfile = Filename(tempdir, "control")
|
|
|
- postinstfile = Filename(tempdir, "postinst")
|
|
|
|
|
- postrmfile = Filename(tempdir, "postrm")
|
|
|
|
|
controltargz = CachedFile()
|
|
controltargz = CachedFile()
|
|
|
controltarfile = tarfile.TarFile.gzopen("control.tar.gz", "w", controltargz, 9)
|
|
controltarfile = tarfile.TarFile.gzopen("control.tar.gz", "w", controltargz, 9)
|
|
|
controltarfile.add(controlfile.toOsSpecific(), "control")
|
|
controltarfile.add(controlfile.toOsSpecific(), "control")
|
|
|
- controltarfile.add(postinstfile.toOsSpecific(), "postinst")
|
|
|
|
|
- controltarfile.add(postrmfile.toOsSpecific(), "postrm")
|
|
|
|
|
controltarfile.close()
|
|
controltarfile.close()
|
|
|
controlfile.unlink()
|
|
controlfile.unlink()
|
|
|
- postinstfile.unlink()
|
|
|
|
|
- postrmfile.unlink()
|
|
|
|
|
|
|
|
|
|
# Create the data.tar.gz file in the temporary directory
|
|
# Create the data.tar.gz file in the temporary directory
|
|
|
datatargz = CachedFile()
|
|
datatargz = CachedFile()
|
|
@@ -352,7 +405,7 @@ class Installer:
|
|
|
if (len(datatargz.str) & 1): debfile.write("\x0A")
|
|
if (len(datatargz.str) & 1): debfile.write("\x0A")
|
|
|
debfile.close()
|
|
debfile.close()
|
|
|
try:
|
|
try:
|
|
|
- base.appRunner.rmtree(tempdir)
|
|
|
|
|
|
|
+ appRunner.rmtree(tempdir)
|
|
|
except:
|
|
except:
|
|
|
try: shutil.rmtree(tempdir.toOsSpecific())
|
|
try: shutil.rmtree(tempdir.toOsSpecific())
|
|
|
except: pass
|
|
except: pass
|
|
@@ -367,11 +420,14 @@ class Installer:
|
|
|
# Create the executable for the application bundle
|
|
# Create the executable for the application bundle
|
|
|
exefile = Filename(output, "Contents/MacOS/" + self.shortname)
|
|
exefile = Filename(output, "Contents/MacOS/" + self.shortname)
|
|
|
exefile.makeDir()
|
|
exefile.makeDir()
|
|
|
- self.standalone.tokens["root_dir"] = "../Resources"
|
|
|
|
|
|
|
+ if self.includeRequires:
|
|
|
|
|
+ self.standalone.tokens["host_dir"] = "../Resources"
|
|
|
|
|
+ elif "host_dir" in self.standalone.tokens:
|
|
|
|
|
+ del self.standalone.tokens["host_dir"]
|
|
|
self.standalone.build(exefile, platform)
|
|
self.standalone.build(exefile, platform)
|
|
|
- rootDir = Filename(output, "Contents/Resources/")
|
|
|
|
|
- rootDir.makeDir()
|
|
|
|
|
- self.installPackagesInto(rootDir, platform)
|
|
|
|
|
|
|
+ hostDir = Filename(output, "Contents/Resources/")
|
|
|
|
|
+ hostDir.makeDir()
|
|
|
|
|
+ self.installPackagesInto(hostDir, platform)
|
|
|
|
|
|
|
|
# Create the application plist file.
|
|
# Create the application plist file.
|
|
|
# Although it might make more sense to use Python's plistlib module here,
|
|
# Although it might make more sense to use Python's plistlib module here,
|
|
@@ -510,13 +566,6 @@ class Installer:
|
|
|
plist.write('</plist>\n')
|
|
plist.write('</plist>\n')
|
|
|
plist.close()
|
|
plist.close()
|
|
|
|
|
|
|
|
- postflight = open(Filename(output, "Contents/Resources/postflight").toOsSpecific(), "w")
|
|
|
|
|
- print >>postflight, '#!/bin/sh'
|
|
|
|
|
- print >>postflight, 'chmod -R 777 "%s"' % appname
|
|
|
|
|
- print >>postflight, 'chmod -R 755 "%s/hosts/"' % appname
|
|
|
|
|
- postflight.close()
|
|
|
|
|
- os.chmod(Filename(output, "Contents/Resources/postflight").toOsSpecific(), 0755)
|
|
|
|
|
-
|
|
|
|
|
if hasattr(tarfile, "PAX_FORMAT"):
|
|
if hasattr(tarfile, "PAX_FORMAT"):
|
|
|
archive = tarfile.open(Filename(output, "Contents/Archive.pax.gz").toOsSpecific(), "w:gz", format = tarfile.PAX_FORMAT)
|
|
archive = tarfile.open(Filename(output, "Contents/Archive.pax.gz").toOsSpecific(), "w:gz", format = tarfile.PAX_FORMAT)
|
|
|
else:
|
|
else:
|
|
@@ -569,13 +618,16 @@ class Installer:
|
|
|
|
|
|
|
|
exefile = Filename(Filename.getTempDirectory(), self.shortname + ".exe")
|
|
exefile = Filename(Filename.getTempDirectory(), self.shortname + ".exe")
|
|
|
exefile.unlink()
|
|
exefile.unlink()
|
|
|
- self.standalone.tokens["root_dir"] = "."
|
|
|
|
|
|
|
+ if self.includeRequires:
|
|
|
|
|
+ self.standalone.tokens["host_dir"] = "."
|
|
|
|
|
+ elif "host_dir" in self.standalone.tokens:
|
|
|
|
|
+ del self.standalone.tokens["host_dir"]
|
|
|
self.standalone.build(exefile, platform)
|
|
self.standalone.build(exefile, platform)
|
|
|
|
|
|
|
|
- # Temporary directory to store the rootdir in
|
|
|
|
|
- rootDir = Filename.temporary("", self.shortname.lower() + "_exe_", "") + "/"
|
|
|
|
|
- rootDir.makeDir()
|
|
|
|
|
- self.installPackagesInto(rootDir, platform)
|
|
|
|
|
|
|
+ # Temporary directory to store the hostdir in
|
|
|
|
|
+ hostDir = Filename.temporary("", self.shortname.lower() + "_exe_", "") + "/"
|
|
|
|
|
+ hostDir.makeDir()
|
|
|
|
|
+ self.installPackagesInto(hostDir, platform)
|
|
|
|
|
|
|
|
nsifile = Filename(Filename.getTempDirectory(), self.shortname + ".nsi")
|
|
nsifile = Filename(Filename.getTempDirectory(), self.shortname + ".nsi")
|
|
|
nsifile.unlink()
|
|
nsifile.unlink()
|
|
@@ -625,11 +677,11 @@ class Installer:
|
|
|
for f in extrafiles:
|
|
for f in extrafiles:
|
|
|
nsi.write(' File "%s"\n' % f.toOsSpecific())
|
|
nsi.write(' File "%s"\n' % f.toOsSpecific())
|
|
|
curdir = ""
|
|
curdir = ""
|
|
|
- for root, dirs, files in os.walk(rootDir.toOsSpecific()):
|
|
|
|
|
|
|
+ for root, dirs, files in os.walk(hostDir.toOsSpecific()):
|
|
|
for name in files:
|
|
for name in files:
|
|
|
file = Filename.fromOsSpecific(os.path.join(root, name))
|
|
file = Filename.fromOsSpecific(os.path.join(root, name))
|
|
|
file.makeAbsolute()
|
|
file.makeAbsolute()
|
|
|
- file.makeRelativeTo(rootDir)
|
|
|
|
|
|
|
+ file.makeRelativeTo(hostDir)
|
|
|
outdir = file.getDirname().replace('/', '\\')
|
|
outdir = file.getDirname().replace('/', '\\')
|
|
|
if curdir != outdir:
|
|
if curdir != outdir:
|
|
|
nsi.write(' SetOutPath "$INSTDIR\\%s"\n' % outdir)
|
|
nsi.write(' SetOutPath "$INSTDIR\\%s"\n' % outdir)
|
|
@@ -670,8 +722,8 @@ class Installer:
|
|
|
|
|
|
|
|
nsifile.unlink()
|
|
nsifile.unlink()
|
|
|
try:
|
|
try:
|
|
|
- base.appRunner.rmtree(rootDir)
|
|
|
|
|
|
|
+ appRunner.rmtree(hostDir)
|
|
|
except:
|
|
except:
|
|
|
- try: shutil.rmtree(rootDir.toOsSpecific())
|
|
|
|
|
|
|
+ try: shutil.rmtree(hostDir.toOsSpecific())
|
|
|
except: pass
|
|
except: pass
|
|
|
return output
|
|
return output
|