packing to standalone exe

just started to think about packing an app. I found packp3d and pdeploy both require internet connection. why not just extract files from the sdk folder?
and I prefer the user only get one exe file,(and maybe an ini file for custom setting and a dll file) then it can run, without internet, assumming msvc runtime dll package is already installed.
can that be done? do I have to learn other tools like py2exe if I want that result?

I will just refer to existing similar posts (some were years old) if things have not been changed.

Two reasons:

  • The SDK is not built with very high optimisation options. So, grabbing the files from the SDK installation would result in a build with suboptimal performance.
  • Pdeploy can build for any platform, and the local SDK is only built for the local platform of course.

If you wish to use pdeploy on another computer that doesn’t have an internet connection, download the contents of (or at least of the packages you need, including p3dembed which is needed by the plugin) to a local directory and set the super-mirror option to panda3d when running pdeploy to that location. This isn’t recommended unless you know what you’re doing.

After you use packp3d and pdeploy with the -s and “installer” options, the resulting binary will not require an internet connection at all, however. Pdeploy downloads the packages so that the resulting binary doesn’t have to.

thank you.
now I have another question,
why is the sdk built with suboptimal setting?
in dev, I have to run the app in sdk for many times. does that mean I am running the app in suboptimal performance for those many times?
does it refer to execution speed in runtime? or load time or file size?
is there a benefit to build the sdk that way?

The SDK is built with all sorts of error checks, as it is meant to be used by developers who expect to get neat error messages when they do something wrong. The runtime has all these error checks removed, which means it is faster, but it will crash if you even get a parameter to a method wrong. This is not very useful for developers since it becomes very difficult to debug even the simplest of issues.

This affects execution speed, load time and the size of the Panda3D libraries.

If you insist, however, you may download the source code and add the --optimize 4 flag to makepanda. (The default, for the SDK, is 3.)

that’s a very good reason. thank you.

rdb, I can’t do this: I’ve found the super-mirror option for panda3d (panda3d -M ), but I can’t find it for packp3d, ppackage and pdeploy. How can I set the super-mirror option for these tools? Thank you!

The packp3d/ppackage/pdeploy tools are .p3d packages themselves, so if you want to run them with additional options, you should run them with ‘panda3d’ like you would run any other .p3d file:

On Windows:

panda3d -M <path> C:\Panda3d-1.8.1\bin\pdeploy.p3d -h

On Unix:

panda3d -M <path> /usr/bin/pdeploy -h

Options to the Panda3D runtime should go before the path to the .p3d file, and options to the .p3d tools themselves should go after.