Is there a way to build an app that does not depend on external resource files?

When building with RealBasic, we used to obtain a .exe that included all the resources, pictures, sounds, scripts, etc all inside the .exe and no external file was required to run the app. With Xojo, I find like 25 different external .DLL, .PNG and .MP3 files that are required to launch the built app. Why is that and is there a way to build to just ONE single .exe file and nothing else?

1 Like

The best thing to do is build an installer using something like InnoSetup, but there are some apps out there that will attempt to compress everything down in to a single EXE that is extracted each time the application is run. In my experience, these aren’t very reliable and tend to trigger false positives on antivirus software.

3 Likes

Interesting approach. Although it does not solve my problem, I’ll still try it tomorrow, it’s still better than zipping a ton of external files, thanks. I’m asking because I’m remotely pushing updates to my app and now it has become extremely complicated, compared to 2 days ago when I was still using RealBasic. With RB, it built to a single .exe and so when remotely updating the app, all I had to code is to send the .exe via a socket and write it to a file on the remote computer. Now it’s a bunch of folders full of DLL, pictures, sounds, etc… :stuck_out_tongue:

I build an installer that is pushed to the client. The updater runs the installer then exits the application.

It is the same. Just put that code in a loop that iterates throug the app folder, send each file and write it.

Improvement on that: Send a file with the signature of each of the files in the folder (MD5) and send only those that have changed.

NOTE: For the same Xojo version, usually ONLY the exe changes

1 Like

If silently or at the very least automating with the least clicks possible the installer is actually an option, then it would solve the entire process, indeed. That sounds like a nice compromise.

1 Like

Single file executables went away in 2008: Real Software Forums • View topic - Win32 Application Builder Changes

1 Like

My previous IDE before Xojo2021r3.1 was older than 2008.

Definitely possible. InnoSetup can make it happen, even better with some custom logic. Here’s my script. Use it as inspiration, don’t just copy it of course. In the [Run] section, the first line is to launch the app after install. But I have the Check: not CmdLineParamExists('/NOLAUNCH') flag on it too. The logic for that is under the [Code] section. This allows me a lot of flexibility from a single file. If the user downloads from the website and runs it, the installer behaves as normal with its user interface and all that. If my updater logic runs it, my updater will do so in one of two ways. If the user presses an “install now” button, my app quits and runs the installer with the switches /SILENT /SP- /NOICONS /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS which tells the installer to just do the installation without asking. Since there is no /NOLAUNCH switch, the installer will immediately launch my app again when completed. However, if the user quits my app after an update has been downloaded in the background, I run the installer with /VERYSILENT /SP- /NOICONS /CLOSEAPPLICATIONS /NOLAUNCH which causes the update to run completely in the background and will not launch my app when finished. So the next time the user launches my app, it’s all up to date. Presto, silent automatic updates. The user can opt out of this, of course.

This may be a bit advanced for what you’re looking to do, but the point I’m trying to make is that a good installer can have a lot of flexibility.

9 Likes

https://en.wikipedia.org/wiki/UPX
But external files are then still unpacked

This is a nice solution. Another one is to compress (e.g. zip) all files, send the single file and decompress it when updating.

It’s actually closer to what I initially wanted and I’ll be moving forward with the ZIP solution. I still don’t understand why all-in-one .exe are not a thing in Xojo anymore. It’s just so awkward to have all those hundreds of files in multiple folders.

The short answer is that Microsoft said so.

2 Likes

After seeing the mess they shat (Windows 11) I pretty much stopped listening to anything Microsoft has to say and I stopped buying their products (for additional reasons).

Microsoft did nothing. The way xojo was doing a “single exe” was just a hack, it was hiding the same DLLs inside the file, not making a real single exe. It was removed becaause it was slower, more unstable and other security problems.

1 Like

I have tested and used Enigma VirtualBox with Xojo Web apps and everything works correctly. It moves any file into a virtual drive. Can also include registry entries. Is free but paid version allows more features

https://enigmaprotector.com/en/aboutvb.html

Application virtualization system for Windows. Enigma Virtual Box enables application files and registry to be consolidated in a single executable file, without loss of efficiency and without virtualized files having to be extracted to the HDD. Enigma Virtual Box is a free application that supports both x86 and x64 binaries.

Paid version below with extra features

https://enigmaprotector.com/en/about.html

2 Likes

I initially wanted to do Arnaud’s solution (send a ZIP and expand it on the clients) but I couldn’t find any free way of doing this in Xojo (natively or with plugins) so I ended up doing Ivan_Tellez’s solution, which works beautifully, all things considered. And for some reason, Windows 10 doesn’t complain about it being a virus anymore (I think due to 64-bit compiling instead of 32-bit, not sure)

Thanks all for the suggestions.

1 Like

Turbo Studio: Virtualize Your Applications with Turbo Studio - Turbo.net