daid / EmptyEpsilon

Open source bridge simulator. Build with the SeriousProton engine.
https://daid.github.io/EmptyEpsilon/
GNU General Public License v2.0
533 stars 180 forks source link

Windows Installer #1003

Open JonathanILevi opened 4 years ago

JonathanILevi commented 4 years ago

Some users find it difficult or confusing to use an app from a zip folder. It also comes off unprofessional or different which can give some users concern of the legitimacy or safety of the app. It can also be annoying for users unsure where to put the extracted folder. These are particularly problems for users not comfortable with folder structures, which are more common since the spread of smartphones.

@daid would you be open if I setup a system, that fits into your current build process, to create an .msi installer for the releases to replace (or reside along size) the current .zip download on the website? It shouldn't be too complicated to create an msi, and without using some junky freeware.

daid commented 4 years ago

It shouldn't be too complicated to create an msi

Automated? From linux?

JonathanILevi commented 4 years ago

I didn't remember how you built EE, so that was one of my questions.

I think it should be automatable on Linux, I think it is just a zip file with specific datafiles.

JonathanILevi commented 4 years ago

That, or maybe create an executable which downloads and installs the latest version from the website.

NinjaSpectre commented 4 years ago

Perhaps just create a self-extracting archive (SFX) with 7-zip. The 32-bit Windows installer 7-zip provides is just a SFX itself so it should be extractable on Linux. Then use the Windows binary 7z.sfx with the Linux 7z command.

7z a -mhe=on -p -sfx7z.sfx EmptyEpsilonInstaller.exe EmptyEpsilonFolder

JonathanILevi commented 4 years ago

That does sound like an option @NinjaSpectre. Can self-extracting archives install into the Program Files folder? (An uninstall would also be advantageous)

I found this Stack Overflow question: https://stackoverflow.com/a/55089464/2521261

There might be a better way, as the meta-data does not need to be changed. Several other places on the subject used Wine.

I'll fiddle with it and see what I can figure out. I'll probably create an Msi on Windows first and then either replicate the process on Linux, or modify the Msi on Linux.

gwaland commented 4 years ago

I'd tried to massage NSIS to create an installer package since NSIS is already supported in cmake and cpacker, but I've run into a lot of snags with it so not sure how viable it would be overall but would need someone with more knowledge than me in cpacker to get it going.

NinjaSpectre commented 4 years ago

The archive will extract to whatever path the user enters. The simple method I gave above only does that though... there are no "extras" (uninstaller, registry keys, start menu entries, etc.). It is simply an archive extractor. These "extras" are possible but that would require writing code that takes advantage of a SDK. If that is what is desired I would just use NSIS instead (or WiX Toolset).

JonathanILevi commented 4 years ago

@gwaland well, I am not that person. I know just about nothing about CMake. If you figure anything out, please share.

JonathanILevi commented 4 years ago

I got NSIS to create an exe installer through their GUI with Wine on Linux. It should be easy enough to translate the process to commands and config files. Stay tuned.

JonathanILevi commented 3 years ago

I knew there had to be Linux tools for creating Windows Installers. We are not the first ones to use Linux to build Windows Applications. This is what we are looking for:

msitools one thing it includes is a (partial) implementation of xml format used by WiX, a common tool used on Windows for making installers.

msi-packager is a simpler option, which simply creates a bare-bones, no UI installer, with a single command. msi-packager <source> <output> -n EmptyEpsilon -v EE-2021.03.31 -m <manufacturer> -a x86 -u f8a0882c-8113-47eb-9d83-01002de53f81 -i logo.ico -e EmptyEpsilon.exe

JonathanILevi commented 3 years ago

The -u option is a guid for the app, which I generated.

What would you make the manufacturer? Daid or EmptyEpsilon?

JonathanILevi commented 3 years ago

This should install EmptyEpsilon version 2021.03.31. With a Start Menu entry and native uninstall, etc.

(Note, if you have your manual install of EE in system ProgramFiles folder, then it might mess up the installer.)

https://drive.google.com/file/d/12i0oLII37MP0PqoJcEG7f3QvXn8ECqQT/view?usp=sharing

This is the exact command I used, assuming "./EmptyEpsilon" is the build output folder, and the "logo.ico" is in the local folder. I installed msi-packager locally with npm so I used npx to run it.

npx msi-packager $PWD/EmptyEpsilon Win32_EmptyEpsilon_EE-2021.03.31.msi -n EmptyEpsilon -v 2021.03.31 -m Daid -u f8a0882c-8113-47eb-9d83-01002de53f81 -i $PWD/logo.ico -e EmptyEpsilon.exe
JonathanILevi commented 3 years ago

@daid does this solution work for your build environment?

daid commented 3 years ago

I haven't tried yet which tools I ran run on linux.

JonathanILevi commented 3 years ago

Okay. I tested on my NixOS (Linux distro) rig (without needing Wine). What distro is your build environment? Debian or Ubuntu?

daid commented 3 years ago

Debian. Ubuntu just keeps breaking cross compilers so I keep away from it.