totalspectrum / flexprop

Simple GUI for Propeller development (both P1 and P2)
Other
38 stars 15 forks source link

Created an installer for Windows using Inno Setup. #8

Closed jacgoudsmit closed 3 years ago

jacgoudsmit commented 4 years ago

The flexgui.iss file can be used with Inno Setup 6.0.3, which is an open-source installer generator (see http://www.jrsoftware.org/isinfo.php for more information).

First, you have to do "make zip" to create the flexgui directory with all the files in it that are needed to create the installer. Alternatively, if you can't (or don't want to) build FlexGUI from scratch, you can unzip the zip file from the latest release in the top directory of the Github repository; it will restore the same situation as what's used to create that zip file in the first place.

Then, the .iss file can either be loaded into InnoSetup using File-Open, and then compiled and executed from there, or it can be compiled from the command line by using the command:

"%programfiles(x86)%\Inno Setup 6\iscc.exe" d:\path\to\flexgui.iss

The installer executable will be generated in the same directory as the .iss file. EDIT: With the latest version of this pull request, the installer automatically extracts the version number from the TCL code and uses it as part of the generated install wizard screens and the output file name (e.g. FlexGUISetup-4.3.1.exe)

Something similar to the following can be added to the makefile (I didn't test this; I don't have a working Cygwin/MingW build environment at this time):

ISCC ?= $(PROGRAMFILES(X86))/iscc.exe

winstaller: flexgui.zip $(ISCC) winstaller/flexgui.iss

NOTE: The installer puts the binary files and the include files in a directory that is only accessible for administrators. The samples are stored in a directory flexgui under your Documents directory (and aren't deleted on uninstall).

I changed the gui.tcl file to use the $HOME directory to store the configuration file. (EDIT: The latest version of this pull request automatically does this at install time).

I did testing with my own Propeller 1 projects in Spin and it looks like everything is working as expected. I haven't tested with P2 (yet) and I haven't tested any other languages.

totalspectrum commented 4 years ago

Wow, this looks pretty interesting. Thank you for the work! I know some users would like a proper installer like this. Others prefer the "portable application" style of just putting the app + all files into one directory. So if I do adopt this I'll have to support the old installation method too. I'll have to think on this for a bit, I'm not sure what the best way forward is. But I do like the idea of an Inno Setup based installer, thanks!

jacgoudsmit commented 4 years ago

You're welcome!

The existing installation method will also still work; in fact the installer is based on the content of the zip file, so it actually depends on the old method, in a way.

(EDIT: Obsolete comments removed. The latest version of this pull-request automatically generates the correct version number based on the TCL code, and automatically modifies the location of the configuration file so that the program doesn't try to store it in a read-only location).

jacgoudsmit commented 4 years ago

I made a few changes to the installer code. It now automatically generates the version number from the version.tcl file, and it automatically makes the modification to the gui.tcl file to save the configuration file to the user's home directory ($::env(HOME)) instead of $ROOTDIR which is read-only after the installation is complete. Just to be clear: the change that I had made in the gui.tcl file before to change the config file location, is no longer in my tree and no longer needed.

Reminder: The installer can be used standalone: Simply unzip the flexgui.zip file into the top directory where the Github project is stored, and load the WindowsInstaller\flexgui.iss file into InnoSetup. Compiling from the command line is also possible; see earlier remarks.

jacgoudsmit commented 3 years ago

I re-created this pull request in a different branch because this one was getting very messy.