@@ -738,6 +738,56 @@ The size reduction is often significant (relative to the project's size),
738738since applications contain fewer large assets compared to games.
739739See :ref: `doc_optimizing_for_size ` for more information on how to do this.
740740
741+ Creating a single-executable distribution
742+ -----------------------------------------
743+
744+ By default, Godot creates a PCK file containing the project data next to the
745+ executable. This means that if the executable is moved without moving the PCK
746+ file at the same time, the application will not run. This is not ideal for
747+ applications, which are increasingly being distributed as a single executable
748+ file.
749+
750+ To make the application entirely self-contained to a single executable, you can
751+ enable **Embed PCK ** in the export preset options. This will embed the PCK data
752+ within the executable, so that the application can be moved around without
753+ breaking. This also makes it possible to run the application directly from a ZIP
754+ archive without having to extract it first.
755+
756+ .. note ::
757+
758+ PCK embedding has a size limitation depending on the platform. Very large
759+ applications (several GBs) may not be able to use this feature on all platforms.
760+ Check the export documentation for the target platform for more details.
761+
762+ Creating portable applications
763+ ------------------------------
764+
765+ An application is called *portable * when it can be run without installation, and
766+ when its configuration is entirely self-contained to the folder it was extracted
767+ to. This allows placing the application files on an USB drive or similar, and
768+ running it on different machines without having to go through an installation
769+ process.
770+
771+ The Godot editor's own :ref: `self-contained mode <doc_data_paths_self_contained_mode >`
772+ currently can't be used within projects. However, you can still choose to save
773+ your own configuration files to the folder containing the executable as follows:
774+
775+ ::
776+
777+ var config_path = OS.get_executable_path().get_base_dir().path_join("config.ini")
778+ # Then use `config_path` to save/load configuration files using ConfigFile or similar.
779+
780+ You may want to make portable mode optional as it's not always desired.
781+ Typically, this is performed by detecting the presence of a specific file in the
782+ executable's folder (e.g. a file named ``portable.txt ``), and only using the
783+ executable's folder for configuration if that file is present.
784+
785+ .. warning ::
786+
787+ Remember that this will only work if the application is extracted to a
788+ writable location. This will result in permission errors if the executable
789+ is run from a read-only location, such as ``C:\Program Files `` on Windows.
790+
741791Creating installers
742792-------------------
743793
0 commit comments