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

Replace NSIS by Inno Setup installer #2102

Merged
merged 1 commit into from
Jul 5, 2020

Conversation

McGiverGim
Copy link
Member

@McGiverGim McGiverGim commented Jul 1, 2020

Fixes #1750
Follow up of #1755

The actual installer is too slow as analyzed in the PR. There we proposed some solutions but I don't see any of them good enough. Pass from the actual system to a new one that erases the complete folder has some risks and the NSIS code is not too easy...

I decided to spend some hours with Inno Setup, another tool to make installers.

It has several benefits:

  • Easier to use. The major part of things can be made with simple directives and the documentation is good, so others developers can help adding features in a future to the Betaflight installer.
  • It accepts some kind of Pascal code to customize things, an old language but far better than the registry oriented NSIS commands.
  • Very fast installing and updating. It does take care of all of this directly.
  • The installer file is smaller, from 93Mb to 67Mb (maybe better compression?)
  • No need of external dependencies (like NSIS that needs the makensis). All of them are in the npm package. Easier for users/devs to build the installer.
  • Easy management of x86/x64 installers. If in a future we decide go this way we can made two installer or one with both systems.

Some cons:

  • We must "migrate" from one to another. I'm trying to do it directly uninstalling the old as part of the new installer.
  • NSIS comes with a lot of languages included. The translations are very bad but comes out of the box. Inno comes with some languages by default and there are others supported "not officially" or can be added by translators.

This code works as is, some things pending:

  • Add languages, only English and Spanish are now available.
  • Now the uninstaller of the old NSIS version is executing before starting the install wizard but it does not wait until it finish for some strange reason.
  • Test with users with and without admin rights.
  • Other little adjustments to texts, images, icons, etc.

Before spending more hours fighting against all of this, I want to know if the migration from NSIS to Inno can be an accepted solution, this is the reason why I opened this PR in a draft form.

What do you think @mikeller ?

@McGiverGim McGiverGim force-pushed the inno_setup branch 4 times, most recently from 62103f7 to b0081c6 Compare July 2, 2020 13:52
@McGiverGim
Copy link
Member Author

Now is more or less ready. Some things to notice:

  • It tries to uninstall the old Configurator, but it seems the old uninstaller is not working very well, so it can left some file. Is not a problem, it will be overwritten by the new files if installed in the same folder, but the user will receive the message that the folder is not empty.
  • If installed without admin rights, it works (now it asks when starting the app), but the uninstaller needs to be executed with admin rights. I don't know if this can be acceptable. If not we can look for some workaround (let the user decide if add to add/remove programs, portable mode, distribute a zip like linux, etc.).

For the rest, it is ready to be tested in depth by the users, to see if I forgot something...

@McGiverGim
Copy link
Member Author

After playing with it, I've more info to share.

Some others benefits:

  • There are tools to help, like a debugger, theme editor, etc. availables. Some are not free.
  • The iss file is very basic, only the latest code needed to uninstall the old NSIS installation. In a future can be removed.
    And cons:
  • Less control of what we do. With NSIS we can do anything (manually, a nightmare of sentences using registry records) and here only "almost" anything (but a lot simpler).

@McGiverGim McGiverGim marked this pull request as ready for review July 2, 2020 14:08
@DusKing1
Copy link
Contributor

DusKing1 commented Jul 2, 2020

Nice job! @McGiverGim I'm also suffering this slow installation issue, I thought that was my hardware issue. Glad to know!

But I see that the zh_TW translation is not the same as zh_CN version. zh_TW version seems based on an older version. I think I need to check it by myself, otherwise it might tears the user experience.

How can I “elegantly” review this Chinese translation lively? Can we have a "live" version for this?

@McGiverGim
Copy link
Member Author

McGiverGim commented Jul 2, 2020

I think that yes, but step by step. First we need to merge this, and after that see if we have some way to use translations for this.

@McGiverGim
Copy link
Member Author

Doing more tests with users without admin privileges... the problem is Windows 10 and no Inno Setup...

In Windows 10, if you start the uninstaller from the Settings app (and not from the Control Panel), it will always be started with the administrator privileges. I've tried to uninstall it from the Control Panel directly and it worked perfectly. The user can uninstall it. If we want we can add directly an uninstall icon to the programs group too, I suppose it will work too.

So the latest big problem for the migration I think has been solved.

@McGiverGim
Copy link
Member Author

Added uninstall shortcut for non admin users.

Windows 10 hides this icon, but is there. Now in the right button of the executable shortcut appears an "uninstall" option that goes to the add/remove programs Panel Control option.

An ugly workaround is to add this uninstall icon twice with two different names... But I think is not necessary.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 3, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.5% 0.5% Duplication

@McGiverGim
Copy link
Member Author

After doing a lot more of tests, only one thing remains:

  • The installer UPDATES the old installation each time, but it only "adds and replaces" files. It does not remove old files that are not at this new version.
  • This makes the updating faster, and we don't have usually a lot of files that need to be removed and usually don't hurt...
  • But if we want, I can uninstall the old version in the same way I'm uninstalling the old NSIS version before installing the new version.
  • There is no hurry to decide that or search a better solution, this will only affect us when the upgrade need to remove a lot of old files.

@mikeller
Copy link
Member

mikeller commented Jul 5, 2020

I think changing this is a good idea, if it gets us out of the dilemma we are having in NSIS with respect to how to deal with files to uninstall.

@@ -60,6 +60,7 @@
"universal-ga": "^1.2.0"
},
"devDependencies": {
"@quanle94/innosetup": "^6.0.2",
Copy link
Member

Choose a reason for hiding this comment

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

What is the reason to not use the innosetup package, which seems to be a lot more commonly used than this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because it is outdated. It is using version 5 and not 6. Several users asked to update but the developer seems not answer, so I search for one fork (there are several, all of them the same fixing precisely the version).
If at some time the original code updates we can change the library.

Copy link
Member

Choose a reason for hiding this comment

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

👍

Interesting that the vast majority of users is still using the innosetup package.

@mikeller mikeller added this to the 10.8.0 milestone Jul 5, 2020
@mikeller
Copy link
Member

mikeller commented Jul 5, 2020

@McGiverGim: Is this ready to be merged?

@McGiverGim
Copy link
Member Author

I think that yes. Only need to decide what to do with the uninstallation each release but this can be done later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10.6.0 Installation on Windows 10 1903 very slow took over 15min
3 participants