Browse Source

p3dembed --prep

rdb 16 years ago
parent
commit
55ba9a1b3d
2 changed files with 15 additions and 8 deletions
  1. 1 8
      direct/src/p3d/DeploymentTools.py
  2. 14 0
      direct/src/plugin_standalone/p3dEmbed.cxx

+ 1 - 8
direct/src/p3d/DeploymentTools.py

@@ -193,7 +193,7 @@ class Installer:
         if not self.includeRequires:
         if not self.includeRequires:
             return
             return
         
         
-        host = HostInfo(self.hostUrl, rootDir = rootDir, asMirror = False)
+        host = HostInfo(self.hostUrl, rootDir = rootDir, asMirror = True)
         if not host.readContentsFile():
         if not host.readContentsFile():
             if not host.downloadContentsFile(self.http):
             if not host.downloadContentsFile(self.http):
                 Installer.notify.error("couldn't read host")
                 Installer.notify.error("couldn't read host")
@@ -223,12 +223,6 @@ class Installer:
                 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
             break
             break
-        
-        # Remove the original multifiles. We don't need them and they take up space.
-        for mf in glob.glob(Filename(rootDir, "hosts/*/*/*.mf").toOsSpecific()):
-            os.remove(mf)
-        for mf in glob.glob(Filename(rootDir, "hosts/*/*/*/*.mf").toOsSpecific()):
-            os.remove(mf)
 
 
     def buildAll(self, outputDir = "."):
     def buildAll(self, outputDir = "."):
         """ Creates a (graphical) installer for every known platform.
         """ Creates a (graphical) installer for every known platform.
@@ -624,7 +618,6 @@ class Installer:
         for root, dirs, files in os.walk(rootDir.toOsSpecific()):
         for root, dirs, files in os.walk(rootDir.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))
-                if file.getExtension().lower() == "mf": continue
                 file.makeAbsolute()
                 file.makeAbsolute()
                 file.makeRelativeTo(rootDir)
                 file.makeRelativeTo(rootDir)
                 outdir = file.getDirname().replace('/', '\\')
                 outdir = file.getDirname().replace('/', '\\')

+ 14 - 0
direct/src/plugin_standalone/p3dEmbed.cxx

@@ -173,6 +173,20 @@ run_embedded(streampos read_offset, int argc, char *argv[]) {
   P3D_instance_feed_url_stream_ptr = &P3D_instance_feed_url_stream;
   P3D_instance_feed_url_stream_ptr = &P3D_instance_feed_url_stream;
   P3D_instance_handle_event_ptr = &P3D_instance_handle_event;
   P3D_instance_handle_event_ptr = &P3D_instance_handle_event;
 
 
+  // Calling the executable with --prep just prepares the directory
+  // structure, this is usually invoked in the installer.
+  if (argc == 2 && strcmp(argv[1], "--prep") == 0) {
+    _window_type = P3D_WT_hidden;
+    _log_basename = "prep";
+    P3D_token token;
+    token._keyword = "stop_on_ready";
+    token._value = "1";
+    _tokens.push_back(token);
+    token._keyword = "hidden";
+    token._value = "1";
+    _tokens.push_back(token);
+  }
+
   // Now call init_plugin() to verify that we got all of the required
   // Now call init_plugin() to verify that we got all of the required
   // function pointers.  This will also call P3D_initialize().
   // function pointers.  This will also call P3D_initialize().
   if (!init_plugin("", _host_url, _verify_contents, _this_platform, 
   if (!init_plugin("", _host_url, _verify_contents, _this_platform,