mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 17:35:34 -04:00
Fix eggcacher, dramatically improve Windows installer
This commit is contained in:
parent
cbd70ad8af
commit
b9c1765ab4
@ -7,6 +7,8 @@
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "dtoolbase.h"
|
||||
|
||||
#include <Python.h>
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
#include <wchar.h>
|
||||
|
@ -9,15 +9,15 @@
|
||||
##############################################################################
|
||||
|
||||
import os,sys,gc
|
||||
from pandac.PandaModules import *
|
||||
from panda3d.core import *
|
||||
|
||||
class EggCacher:
|
||||
def __init__(self, args):
|
||||
maindir = Filename.fromOsSpecific(os.getcwd()).getFullpath()
|
||||
ExecutionEnvironment.setEnvironmentVariable("MAIN_DIR", maindir)
|
||||
self.bamcache = BamCache.getGlobalPtr()
|
||||
self.pandaloader = PandaLoader()
|
||||
self.loaderopts = LoaderOptions()
|
||||
self.pandaloader = Loader()
|
||||
self.loaderopts = LoaderOptions(LoaderOptions.LF_no_ram_cache)
|
||||
if (self.bamcache.getActive() == 0):
|
||||
print "The model cache is not currently active."
|
||||
print "You must set a model-cache-dir in your config file."
|
||||
@ -87,6 +87,4 @@ class EggCacher:
|
||||
TexturePool.releaseAllTextures()
|
||||
progress += size
|
||||
|
||||
|
||||
cacher = EggCacher(sys.argv[1:])
|
||||
|
||||
|
1276
makepanda/installer.nsi
Executable file
1276
makepanda/installer.nsi
Executable file
File diff suppressed because it is too large
Load Diff
@ -6173,7 +6173,7 @@ except:
|
||||
#
|
||||
##########################################################################################
|
||||
|
||||
def MakeInstallerNSIS(file, fullname, smdirectory, installdir):
|
||||
def MakeInstallerNSIS(file, title, installdir):
|
||||
if (os.path.isfile(file)):
|
||||
os.remove(file)
|
||||
elif (os.path.isdir(file)):
|
||||
@ -6201,7 +6201,7 @@ def MakeInstallerNSIS(file, fullname, smdirectory, installdir):
|
||||
shutil.move("direct\\src\\plugin_installer\\p3d-setup.exe", file)
|
||||
return
|
||||
|
||||
print("Building "+fullname+" installer. This can take up to an hour.")
|
||||
print("Building "+title+" installer. This can take up to an hour.")
|
||||
if (COMPRESSOR != "lzma"):
|
||||
print("Note: you are using zlib, which is faster, but lzma gives better compression.")
|
||||
if (os.path.exists("nsis-output.exe")):
|
||||
@ -6212,19 +6212,13 @@ def MakeInstallerNSIS(file, fullname, smdirectory, installdir):
|
||||
|
||||
nsis_defs = {
|
||||
'COMPRESSOR' : COMPRESSOR,
|
||||
'NAME' : fullname,
|
||||
'SMDIRECTORY' : smdirectory,
|
||||
'TITLE' : title,
|
||||
'INSTALLDIR' : installdir,
|
||||
'OUTFILE' : os.path.join(psource, 'nsis-output.exe'),
|
||||
'LICENSE' : os.path.join(panda, 'LICENSE'),
|
||||
'LANGUAGE' : "English",
|
||||
'RUNTEXT' : "Visit the Panda Manual",
|
||||
'IBITMAP' : "panda-install.bmp",
|
||||
'UBITMAP' : "panda-install.bmp",
|
||||
'PANDA' : panda,
|
||||
'BUILT' : panda,
|
||||
'SOURCE' : psource,
|
||||
'PYVER' : SDK["PYTHONVERSION"][6:9],
|
||||
'PANDACONF' : os.path.join(panda, 'etc'),
|
||||
'PSOURCE' : psource,
|
||||
'PYEXTRAS' : os.path.join(os.path.abspath(GetThirdpartyBase()), 'win-extras'),
|
||||
'REGVIEW' : regview,
|
||||
}
|
||||
@ -6238,7 +6232,7 @@ def MakeInstallerNSIS(file, fullname, smdirectory, installdir):
|
||||
for item in nsis_defs.items():
|
||||
cmd += ' -D%s="%s"' % item
|
||||
|
||||
cmd += ' "%s"' % (os.path.join(psource, 'direct', 'src', 'directscripts', 'packpanda.nsi'))
|
||||
cmd += ' "%s"' % (os.path.join(psource, 'makepanda', 'installer.nsi'))
|
||||
oscmd(cmd)
|
||||
os.rename("nsis-output.exe", file)
|
||||
|
||||
@ -6763,14 +6757,14 @@ try:
|
||||
if (GetOptimize() <= 2): dbg = "-dbg"
|
||||
if GetTargetArch() == 'x64':
|
||||
if (RUNTIME):
|
||||
MakeInstallerNSIS("Panda3D-Runtime-"+VERSION+dbg+"-x64.exe", "Panda3D", "Panda3D "+VERSION, "C:\\Panda3D-"+VERSION+"-x64")
|
||||
MakeInstallerNSIS("Panda3D-Runtime-"+VERSION+dbg+"-x64.exe", "Panda3D "+VERSION, "C:\\Panda3D-"+VERSION+"-x64")
|
||||
else:
|
||||
MakeInstallerNSIS("Panda3D-"+VERSION+dbg+"-x64.exe", "Panda3D", "Panda3D "+VERSION, "C:\\Panda3D-"+VERSION+"-x64")
|
||||
MakeInstallerNSIS("Panda3D-"+VERSION+dbg+"-x64.exe", "Panda3D SDK "+VERSION, "C:\\Panda3D-"+VERSION+"-x64")
|
||||
else:
|
||||
if (RUNTIME):
|
||||
MakeInstallerNSIS("Panda3D-Runtime-"+VERSION+dbg+".exe", "Panda3D", "Panda3D "+VERSION, "C:\\Panda3D-"+VERSION)
|
||||
MakeInstallerNSIS("Panda3D-Runtime-"+VERSION+dbg+".exe", "Panda3D "+VERSION, "C:\\Panda3D-"+VERSION)
|
||||
else:
|
||||
MakeInstallerNSIS("Panda3D-"+VERSION+dbg+".exe", "Panda3D", "Panda3D "+VERSION, "C:\\Panda3D-"+VERSION)
|
||||
MakeInstallerNSIS("Panda3D-"+VERSION+dbg+".exe", "Panda3D SDK "+VERSION, "C:\\Panda3D-"+VERSION)
|
||||
elif (target == 'linux'):
|
||||
MakeInstallerLinux()
|
||||
elif (target == 'darwin'):
|
||||
|
Before Width: | Height: | Size: 151 KiB After Width: | Height: | Size: 151 KiB |
@ -343,12 +343,12 @@ try_load_file(const Filename &pathname, const LoaderOptions &options,
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (loader_cat.is_debug()) {
|
||||
loader_cat.debug()
|
||||
<< "Model " << pathname << " not found in cache.\n";
|
||||
}
|
||||
}
|
||||
|
||||
bool cache_only = (options.get_flags() & LoaderOptions::LF_cache_only) != 0;
|
||||
if (!cache_only) {
|
||||
|
@ -385,6 +385,16 @@ flush_index() {
|
||||
check_cache_size();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: BamCache::list_index
|
||||
// Access: Published
|
||||
// Description: Writes the contents of the index to standard output.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BamCache::
|
||||
list_index(ostream &out, int indent_level) const {
|
||||
_index->write(out, indent_level);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: BamCache::read_index
|
||||
// Access: Private
|
||||
|
@ -80,6 +80,8 @@ PUBLISHED:
|
||||
void consider_flush_index();
|
||||
void flush_index();
|
||||
|
||||
void list_index(ostream &out, int indent_level = 0) const;
|
||||
|
||||
INLINE static BamCache *get_global_ptr();
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user