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

Squirrel to NSIS migration #837

Closed
dustintownsend opened this Issue Oct 19, 2016 · 30 comments

Comments

Projects
None yet
@dustintownsend

dustintownsend commented Oct 19, 2016

I see that the previous Squirrel default is being moved to NSIS, so I was curious if there would be a path for people to migrate from Squirrel to NSIS?

For example, I do a new release to my current Squirrel set-up that would migrate the existing installation to NSIS. This would be so the end user wouldn't have to do an uninstall and reinstall.

I haven't dug into NSIS enough to know if something like this would be possible.

@develar

This comment has been minimized.

Member

develar commented Oct 19, 2016

if something like this would be possible.

Definitely it is possible and will be implemented in this way.

When NSIS will be set as default target — migration tutorial will be provided and some option to auto uninstall old Squirrel.Windows installation will be implemented.

Please do not worry — deprecation doesn't mean that we will not support Squirrel.Windows, you can continue to use Squirrel.Windows if it is suitable for your app. But do not expect enhancements.

@dustintownsend

This comment has been minimized.

dustintownsend commented Oct 19, 2016

@develar that is not the answer I was expecting, but I am glad to hear it!

My situation is I'm rewriting a legacy .NET app with Electron. I moved the .NET app to Squirrel last year to take advantage of the auto updates. My plan was to build the Electron app installer using Squirrel to upgrade users on the .NET app to the new Electron app. Then, I saw that you are going away from Squirrel so I was worried.

I'll continue on with my original plan, but I do want to migrate to NSIS due to the benefits I saw you outlined in other discussions. Mainly the reduction in installer size is what I would like.

@develar

This comment has been minimized.

Member

develar commented Oct 20, 2016

that is not the answer I was expecting

And what did you expect ;)?

@dustintownsend

This comment has been minimized.

dustintownsend commented Oct 20, 2016

And what did you expect ;)?

Well not knowing anything about NSIS and just enough about Squirrel to be dangerous... I assumed it would be a difficult task and may not be worth the effort to do. I'm glad my assumptions were wrong.

@willyb321

This comment has been minimized.

willyb321 commented Oct 22, 2016

@dustintownsend for me at least - migrating to NSIS was fairly simple if you are already using the default electron api for auto-updating. You effectively just have to change the module, and then remove the feedurl bits since its done from bintray (at the moment anyway!)
Edit: I should clarify that I was not using the default electron api for my application before i move to NSIS - I was using this for my updating as hosting my own server was not quite viable.

@TimvdEijnden

This comment has been minimized.

Contributor

TimvdEijnden commented Dec 14, 2016

@develar

Is there a tutorial available to migrate from Squirrel.Windows to NSIS? We would like our users to update and switch to NSIS automatically. How can we do this? We're also using https://github.com/Aluxian/squirrel-updates-server to fetch our updates from GitHub i guess we also need to change that.

Squirrel is reporting a lot of Errors and since the version is not updated anymore in Electron-builder we cannot update easily. Or is an update to the latest Squirrel.Windows easy to do?

We're open to switching to NSIS if we don't have to change a lot and more important our users won't notice it, meaning they don't have to uninstall and install a new version.

@develar

This comment has been minimized.

Member

develar commented Dec 14, 2016

is an update to the latest Squirrel.Windows easy to do?

@TimvdEijnden Squirrel.Windows updated to 1.5.1 As always, release will be available in 20 minutes. You are not forced to use NSIS if Squirrel.WIndows is suitable for you.

Is there a tutorial available to migrate from Squirrel.Windows to NSIS

Not yet.

@p4tb0l

This comment has been minimized.

p4tb0l commented Jan 23, 2017

Hello and thank you for your work.
We are also looking forward to this development.
Here is our scenario: we already have users on a Squirrel version, and some users can not install the application because they have neither admin rights nor .net framework (which is a dependency of Squirrel).
An automatic update from Squirrel to NSIS would prevent us from having to maintain 2 parallel versions.

Do you have a schedule to make this evolution available?

@develar

This comment has been minimized.

Member

develar commented Jan 23, 2017

Schedule depends on user demands. I will try to find time to implement migration (actually, I think, maybe it works even now, need to to test and tweak some settings).

@develar

This comment has been minimized.

Member

develar commented Feb 14, 2017

Sorry for delay :) I hope it will be addressed tomorrow morning CET.

@develar develar added feature and removed question labels Feb 14, 2017

@sklink

This comment has been minimized.

sklink commented Feb 23, 2017

How are things coming along with this? Anything I can do to help?

@p4tb0l

This comment has been minimized.

p4tb0l commented Apr 5, 2017

Hello,
Sorry to insist, but I really need to migrate from squirrel to NSIS.
Could you explain to me the principle you plan to implement? What can we do to help?

@cumajkeee

This comment has been minimized.

cumajkeee commented Apr 5, 2017

@p4tb0l, you can try to do it by yourself. The simple idea is to download NSIS installer manually (not as auto-update) and launch it by child process. Main process should follow uninstall flow.

@p4tb0l

This comment has been minimized.

p4tb0l commented Apr 10, 2017

When the nsis install package is launched, it prompts the user to close the existing app but doesn't uninstall it.
Do I have to uninstall it manually or is there something that I'm missing?

@develar

This comment has been minimized.

Member

develar commented Apr 10, 2017

Do I have to uninstall it manually or is there something that I'm missing?

NSIS for now can automatically uninstall only NSIS apps.

@cumajkeee

This comment has been minimized.

cumajkeee commented Apr 14, 2017

Do I have to uninstall it manually or is there something that I'm missing?

Yes manually, but you can control your current launched app ;)

@esamelson

This comment has been minimized.

esamelson commented May 4, 2017

I'm trying to do something similar but with another complication - some of our users have used the Squirrel "Machine-Wide" installer and have the app installed on multiple user accounts. I'd like to remove all of these installations in favor of a single NSIS-based one in C:\Program Files.

I've written a custom NSIS script to loop through every user account and attempt to run Squirrel's own uninstaller. This removes the app from each account's AppData\Local folder, but it does not remove the registry entry or shortcuts for any account besides the current one. (I can't use runas since that prompts for a password.) Do I just need to add those steps into my script as well? Or is there a simpler way to do this?

@develar

This comment has been minimized.

Member

develar commented May 5, 2017

@esamelson you can simply call Squirrel Setup.exe (wrapper) as uninstaller passing some args (sorry, cannot provide details yet).

@esamelson

This comment has been minimized.

esamelson commented May 5, 2017

Do you mean Squirrel's Update.exe? If so, that's what I've been doing - calling %LOCALAPPDATA%\MyApp\Update.exe --uninstall in each user's folder. The problem is Update.exe doesn't remove the registry entry or shortcuts for any user besides the one I'm signed into.

I also tried running MyAppSetup.exe --uninstall but that gave me an error. Is there a different Squirrel Setup.exe I'm missing??

@eanders-MS

This comment has been minimized.

eanders-MS commented Jun 16, 2017

@esamelson May I ask how you're calling Squirrel Update.exe --uninstall? I also need to uninstall the old Squirrel-based app, and wondering where to put this call. Thanks!

@esamelson

This comment has been minimized.

esamelson commented Jun 17, 2017

I'm running that in an NSIS include script, as a macro (see https://github.com/electron-userland/electron-builder/wiki/NSIS). Here's a gist link to my code, in case you want to take a look. I've chosen to run it in customInit but it could easily be run in customInstall as well, I believe. It's a little bit hacky, especially the way it cycles through all of the users, but it has worked for me so far.

https://gist.github.com/esamelson/a6af4c7ad53ba52d96c4cffd36cc3981

An important note - this will NOT remove the registry entries for any user other than the one running the script. It will remove only the app and shortcuts.

@eanders-MS

This comment has been minimized.

eanders-MS commented Jun 17, 2017

Thanks esamelson, very helpful. That's an interesting ASM-like macro language. Thankfully I only need to do it for the current user!

@black-snow

This comment has been minimized.

Contributor

black-snow commented Jul 12, 2017

Is there anything left open here?

@PierBover

This comment has been minimized.

PierBover commented Aug 22, 2017

Any guide or tutorial on how to migrate from Squirrel to NSIS?

I just saw that NSIS has become the default win target, but I have no idea what the implications are.

Will NSIS still work with electron-release-server?

If compiling to both macOS and Windows, does my Node code need to account for each platform differently?

Quite frankly switching to NSIS by default seems like a very drastic move considering the Electron project still recommends Squirrel for Windows.

@AshDevFr

This comment has been minimized.

AshDevFr commented Sep 12, 2017

Is there a way to run DeleteRegKey HKCR ... commands with this custom script during the install.
I'd like to remove old protocol handler from the squirrel app.

@develar

This comment has been minimized.

Member

develar commented Sep 12, 2017

@AshDevFr

This comment has been minimized.

AshDevFr commented Sep 12, 2017

@develar I tried to run some DeleteRegKey commands in customInstall but they don't remove the keys from the registry.
I tried with and without perMachine: true

@develar

This comment has been minimized.

Member

develar commented Sep 12, 2017

@omichelsen

This comment has been minimized.

omichelsen commented Jan 6, 2018

I just moved from Squirrel.Windows to NSIS and needed to uninstall old the Squirrel installation as well. Digging through the good suggestions in this thread I came up with this basic solution:

Add a build/installer.nsh file with the following content:

!macro customInit
  nsExec::Exec '"$LOCALAPPDATA\MYAPPNAME\Update.exe" --uninstall -s'
!macroend

Remember to substitute "MYAPPNAME" for your own.

This will uninstall the Squirrel version for the current user when you install the new NSIS version.

Just a little input to whomever will take it upon themselves to write a transition guide at some point.

@develar develar added the help wanted label Jan 31, 2018

@develar

This comment has been minimized.

Member

develar commented Jan 31, 2018

Help-wanted if someone want to adds docs. Comments above is useful to migrate.

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