@@ -796,6 +796,56 @@ The size reduction is often significant (relative to the project's size),
796796since applications contain fewer large assets compared to games.
797797See :ref: `doc_optimizing_for_size ` for more information on how to do this.
798798
799+ Creating a single-executable distribution
800+ -----------------------------------------
801+
802+ By default, Godot creates a PCK file containing the project data next to the
803+ executable. This means that if the executable is moved without moving the PCK
804+ file at the same time, the application will not run. This is not ideal for
805+ applications, which are increasingly being distributed as a single executable
806+ file.
807+
808+ To make the application entirely self-contained to a single executable, you can
809+ enable **Embed PCK ** in the export preset options. This will embed the PCK data
810+ within the executable, so that the application can be moved around without
811+ breaking. This also makes it possible to run the application directly from a ZIP
812+ archive without having to extract it first.
813+
814+ .. note ::
815+
816+ PCK embedding has a size limitation depending on the platform. Very large
817+ applications (several GBs) may not be able to use this feature on all platforms.
818+ Check the export documentation for the target platform for more details.
819+
820+ Creating portable applications
821+ ------------------------------
822+
823+ An application is called *portable * when it can be run without installation, and
824+ when its configuration is entirely self-contained to the folder it was extracted
825+ to. This allows placing the application files on an USB drive or similar, and
826+ running it on different machines without having to go through an installation
827+ process.
828+
829+ The Godot editor's own :ref: `self-contained mode <doc_data_paths_self_contained_mode >`
830+ currently can't be used within projects. However, you can still choose to save
831+ your own configuration files to the folder containing the executable as follows:
832+
833+ ::
834+
835+ var config_path = OS.get_executable_path().get_base_dir().path_join("config.ini")
836+ # Then use `config_path` to save/load configuration files using ConfigFile or similar.
837+
838+ You may want to make portable mode optional as it's not always desired.
839+ Typically, this is performed by detecting the presence of a specific file in the
840+ executable's folder (e.g. a file named ``portable.txt ``), and only using the
841+ executable's folder for configuration if that file is present.
842+
843+ .. warning ::
844+
845+ Remember that this will only work if the application is extracted to a
846+ writable location. This will result in permission errors if the executable
847+ is run from a read-only location, such as ``C:\Program Files `` on Windows.
848+
799849Creating installers
800850-------------------
801851
0 commit comments