Xojo built apps are portable per se, i.e. they do not need any configuration of the host system and have view dependencies that are not provided by the host system by default.
They usually cease being portable when you select system default locations to store documents, resources and configuration. All you need is a flag somewhere to distinguish between the two cases. The easiest form of such a flag is a file or folder alongside the executable. If your app uses externals, you may add these libraries to the “ Libs” folder to keep the app self contained.
Both, Windows and Linux have some external dependencies to certain libraries. At least on Windows, these external dependencies should always be met, as these are system components, that are installed and kept up to date on all versions that are supported by current versions of Xojo (I did not verify this, but that is my understanding).
So, on Windows, just copy the files, and run your app.
Typical way to doing this is
- an installer
- an installer with an option to create a portable installation
- a zip file and instructions for the user where he should extract it to, and how to start the app after extraction
You should never attempt to run an .exe directly from within a -zip. Resources stored within that .zip will not be available (unless you create your app to expect this, but I do not know of any way to locate the .zip file the exe has been run from, other than asking the user. (the .exe will get extracted to the system’s TEMP folder and be run from there.
If I wanted to create a self contained .exe for distribution, I’d probably look into creating it as a 7-Zip self-extracting archive with one of the installer type SFX modules first. I’d expect less trouble with virus alarms and system protection issues with this approach, and the user always can extract the .exe to a folder and run from there.
On Linux, external dependencies are a problem, because you cannot reasonably expect anything. So, here you will need a properly packaged app, either in some traditional package manager format such as .deb or .rpm, or one (or more) of the newer sandboxed package formats such as Flatpack, Snap, or AppImage. Or just provide the folder tree as a compressed tar archive and tell the user what additional dependencies might be needed. Linux users are used to inconveniences like this ;-).
Summary:
If a packaged executable makes sense for your use case, Xojo is probably not the right development environment. If you still want to use Xojo and a single executable, any packager will do, provided that it extracts all files first, or provides a file system virtualization with access to all packaged files. Furthermore the app should not require, or even offer, any persisted data that should roam with the executable.
Remark:
I used to use Altiris SVS (Software Virtualization Solution) and later Symantec Workspace Virtualization (SWV) (part of Symantec Endpoint Virtualization Suite) to package the Xojo IDE, which worked fine.