Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Win32: Add Inno Setup script for building a Windows installer #941

Closed
wants to merge 10 commits into from

Conversation

lotharsm
Copy link
Member

@lotharsm lotharsm commented Dec 7, 2017

This PR adds an Inno Setup script to build a Windows installer (fixes Bug 138).

Features

  • Prevent installation on pre-Vista systems
  • Option to add start menu and desktop shortcuts
  • Option to register .gb/.gbc/.gba files with mGBA allowing the user to start those files directly
  • Attempt to work around Bug Unintended change of the language interface. #906 by setting the correct language value in qt.ini depending on the selected language during the installation process instead of relying on the language auto detection. Seems to work pretty well for me, haven't experienced an unintentional language change since then. This workaround will be removed as soon as the bug is fixed.
  • Automation friendly - no hardcoded paths, simply copy the installer files to the Win32 distribution directory.
  • Release mode - when setting the "IsRelease" variable in the setup script to "Yes", the created setup file will be named mGBA-x.y.z-win32.exe while fetching the version information from the mGBA executable. When IsRelease is set to "No", then the filename mGBA-latest-win32.exe will be used.
  • Tested on Windows Vista, 7 and 10
  • Maintained by me :)

Demo

As a small demo, here's an installer file for mGBA 0.6.1.
mGBA-0.6.1-win32.exe.zip

@endrift
Copy link
Member

endrift commented Dec 14, 2017

I'd like to fix the language issue for real before looking closer at this.

@endrift
Copy link
Member

endrift commented Dec 14, 2017

Now that that's fixed you can remove the workaround 😀

@lotharsm lotharsm changed the title Win32: Add Inno Setup script Win32: Add Inno Setup script for building a Windows installer Dec 17, 2017
@lotharsm lotharsm force-pushed the inno-setup branch 2 times, most recently from 82aa61e to d21742e Compare December 19, 2017 11:05
@endrift
Copy link
Member

endrift commented Dec 25, 2017

So one of the things that's holding me off from looking closer at this is that at some point I may start shipping stripped down builds with the extra features (e.g. GIF and video recording, scripting, etc; the ones most people don't use) as DLLs that can be optionally added. I'm not sure how I'm going to handle that yet though so I'm not sure if it makes sense to merge this yet.

@lotharsm
Copy link
Member Author

Yeah, maybe you should decide that first. But in general, I see no problem in including all the "Plugin DLLs" inside the installer package and make those plugins optional during the installation process - that's fairly easy to do with Inno.

@lotharsm
Copy link
Member Author

Hi endrift, is there anything I can do to move this forward and maybe can get this ready for an upcoming 0.7 release?

@endrift
Copy link
Member

endrift commented Jan 24, 2018

I'll need to try it out first, which I keep forgetting to do.

@lotharsm
Copy link
Member Author

lotharsm commented Feb 7, 2018

...which I keep forgetting to do.

Friendly reminder... :P

@endrift endrift added this to the mGBA 0.7.0 milestone Apr 21, 2018
@endrift
Copy link
Member

endrift commented Apr 23, 2018

Before I forget: Is this updated for the new French translation?

@lotharsm
Copy link
Member Author

Ah, nope, I have to add the french translation. Update will follow ASAP.

@lotharsm
Copy link
Member Author

I should be more precise: The only thing what has to be done is to make French available during the installation process. For testing purposes, you can use the current code as-is.

Source: "mGBA.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "CHANGES.txt"; DestDir: "{app}\"; Flags: ignoreversion isreadme
Source: "LICENSE.txt"; DestDir: "{app}\"; Flags: ignoreversion
Source: "mGBA.exe"; DestDir: "{app}\"; Flags: ignoreversion
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this here twice?

;\tools\windows\ to the directory that contains the win32 distribution files!

;Set CurrentReleaseVersion to the number of the latest stable mGBA build.
#define CurrentReleaseVersion = '0.6.3'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might make sense to make this a .in file that's processed by CMake so it can get the current version number from the version scripts--unless there's a way to run a command in the .iss folder to get the version from CMake.

UsePreviousLanguage=False
DisableWelcomePage=False
VersionInfoDescription=mGBA is an open-source Game Boy Advance emulator
VersionInfoCopyright=� 2013�2017 Jeffrey Pfau
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source: "nointro.dat"; DestDir: "{app}\"; Flags: ignoreversion
Source: "README.html"; DestDir: "{app}\"; Flags: ignoreversion isreadme; Languages: english italian spanish
Source: "README_DE.html"; DestDir: "{app}\"; DestName: "LIESMICH.html"; Flags: ignoreversion isreadme; Languages: german
Source: "shaders\agb001.shader\agb001.fs"; DestDir: "{app}\shaders\agb001.shader\"; Flags: ignoreversion
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any way to copy a folder wholesale? This looks cumbersome.

@endrift
Copy link
Member

endrift commented Jun 9, 2018

Can you please update this for the new CMake-generated file layout?

@lotharsm
Copy link
Member Author

Do you mean the file layout as it is present in the current nightly builds created by the buildbot?

@endrift
Copy link
Member

endrift commented Jun 23, 2018

The current file layout is pretty much identical to what is created by just building it, so if we could get the installer to be built by a CMake-generated .iss file that would be pretty ideal. Previously there was stuff that the buildbot tossed in after building but I wanted to streamline things a bit.

@lotharsm
Copy link
Member Author

It seems that the last time I tried to do a wildcard entry for the build directory I just messed things up. I'll commit an improved version later today. Using this as a template, it should be easy to automate things using CMake.

rootfather and others added 10 commits September 1, 2018 13:32
Now you don't have to switch between IsRelease = yes and no.

Instead, you set the CurrentReleaseVersion variable to the
number of the latest stable release and Inno will decide
if the setup you are about to build is a stable or a development
package, so you have to alter the script only once for each release
cycle.

This is the highest level of automation I can currently imagine.
@lotharsm
Copy link
Member Author

lotharsm commented Sep 1, 2018

I think we now have as much simplification of the script as possible.

@lotharsm
Copy link
Member Author

lotharsm commented Sep 9, 2018

@endrift, do you consider this as ready for merging or is there something I should address in your opinion?

@endrift
Copy link
Member

endrift commented Sep 9, 2018

The version info is still wrong. Apart from that I haven't looked into how I'd integrate it with CMake yet and if it's possible to use CMake to keep the version number in sync.

@lotharsm
Copy link
Member Author

Seems that I finally should find some time to look deeper into how the CMake stuff works... might complicate things a bit unfortunately. :(

@endrift
Copy link
Member

endrift commented Sep 18, 2018

Yeah :( I may have time today to look into it to suggest changes for you.

@endrift
Copy link
Member

endrift commented Sep 21, 2018

Would it be possible to make an option to have it install the "portable" version that doesn't make the file associations and creates an empty "portable.ini" file instead?

Also .sgb should probably be added now.

@lotharsm
Copy link
Member Author

Yep, that's possible. I'll add .sgb to the list of the file associations.

Do I need to fill any values into portable.ini or is it really enough to simply create the file without any content?

@endrift
Copy link
Member

endrift commented Sep 23, 2018

Without content.

@endrift endrift closed this Oct 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants