ak2yny / OpenHeroSelectGUI

GUI for OpenHeroSelect based on MUAOpenHeroSelect by adamatti
GNU General Public License v3.0
4 stars 1 forks source link

Building a single exe is not possible #13

Open ak2yny opened 1 year ago

ak2yny commented 1 year ago

According to this question, building a single exe with an unpackaged WinUI3 project with Windows App SDK is not possible at the moment. Edit: Support for single .exe files was added in the meantime, but it might not work, depending on the project (citation needed). I tested it through the publish file, which didn't work for this project. I have yet to try it with the csproj configuration.

We can use the publish as single exe feature of Visual Studio's publish profiles (or is this Windows App SDK exclusive?), which makes a difference (with the self contained option, this creates a set of about 30 DLL files plus the exe and other files), but the app can't be started that way (and others suffer from the same issue). Somehow, this worked with the first preview version of OHSGUI, but I don't remember how I did it exactly (checking back at the first WinUI update of this repo, I find that publishing as single exe is not enabled, but IIRC, I changed it back because even then, I found that this wasn't working correctly).

I think here is how I did it:

Alternatively, the built project could be added to a self-extracting archive with a location picker dialogue and if possible shortcut creator.

Please let me know, if you have another idea.

ak2yny commented 1 year ago

With v0.2.5 we now have an installer that sets-up the GUI with a single folder and single symbolic link (plus the stages folder). Links with start in locations and a different location for the GUI (e.g. sub-folder in the OHS folder) have been tested and work. The wiki has been updated with instructions about how to make these shortcuts, should the symbolic link not be in a convenient location. Symbolic links, shortcuts, as well as the rest of the setup can be deleted normally, so they support the idea of a portable OHS with extract and run support.

The goal still is to have a single exe (optionally with a few folders and DLLs) which are added to the OHS folder to get rid of the 170+ files and folders next to the main .exe. A packaged version with automatic installation is not an option (yet).

OHS and the GUI are configured in such a way that there are no files left anywhere else in the system, except the ones that the user manually saves, copies or writes (e.g. through run as commands).