-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Comments
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. |
@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. |
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. |
@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!) |
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. |
@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.
Not yet. |
Hello and thank you for your work. Do you have a schedule to make this evolution available? |
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). |
Sorry for delay :) I hope it will be addressed tomorrow morning CET. |
How are things coming along with this? Anything I can do to help? |
Hello, |
@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. |
When the nsis install package is launched, it prompts the user to close the existing app but doesn't uninstall it. |
NSIS for now can automatically uninstall only NSIS apps. |
Yes manually, but you can control your current launched app ;) |
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 |
@esamelson you can simply call Squirrel Setup.exe (wrapper) as uninstaller passing some args (sorry, cannot provide details yet). |
Do you mean Squirrel's Update.exe? If so, that's what I've been doing - calling I also tried running |
@esamelson May I ask how you're calling Squirrel |
I'm running that in an NSIS 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. |
Thanks esamelson, very helpful. That's an interesting ASM-like macro language. Thankfully I only need to do it for the current user! |
Is there anything left open here? |
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 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. |
Is there a way to run |
@AshDevFr you can do anything — https://www.electron.build/configuration/nsis#custom-nsis-script |
@develar I tried to run some |
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
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. |
Help-wanted if someone want to adds docs. Comments above is useful to migrate. |
Thanks @omichelsen for your macro. This did work for me on the initial installation of the new The solution for me is to remove the leftover files. I modified @omichelsen
Remember to substitute "MYAPPNAME" for your own. |
I've just noticed this file is left behind in Roaming as well (Windows 10):
|
A possible solution to make auto update Squirell.Windows to NSIS could be (not tested):
The Electron auto updater will install the |
I've been working on that. I extract the nupkg electron-builder makes, replace the executable, archive/pack it again, and update the filesize hardcoded in the One issue I found is the NSIS installer is opened multiple times by Squirrel and electron-builder uses NSIS scripts to only allow one instance of the installer. I've commented out some of that stuff but I'm still getting errors. I'll reply here again if I get this to work. Edit: I might also need to update a checksum in RELEASES but I'm not sure. The errors I'm getting right now are related to the NSIS scripts I think |
I couldn't quite get that to work because the installer is being ran inside the directory that the Squirrel uninstall step tries to delete. I couldn't figure out how to get NSIS to run the (Squirrel) uninstall at the end of a successful install, like a post-install hook. That might have been a workaround. Anyway, this is my solution:
NSIS custom initialization stepsThis is my !macro customInit
${ifNot} ${isUpdated}
; Create uninstall marker if Squirrel app exists
${if} ${FileExists} "$LOCALAPPDATA\${APP_PACKAGE_NAME}"
FileOpen $9 "$LOCALAPPDATA\${APP_PACKAGE_NAME}\.shouldUninstall" w
FileClose $9
${endIf}
; Delete the start menu shortcut
Delete "$APPDATA\Microsoft\Windows\Start Menu\Programs\${COMPANY_NAME}\${PRODUCT_NAME}.lnk"
; Delete the parent directory if it's not empty (because there's no /r)
RMDir "$APPDATA\Microsoft\Windows\Start Menu\Programs\${COMPANY_NAME}"
${endIf}
!macroend I explained what it does above. I just want to point out that those variables work for me, but they might not for you. E.g. for me, Keep in mind that the files installed on an existing user's disk were installed by something else (a Squirrel installer, which may have been created by something else or even if it was electron-builder, it could've been an older version of it). Or if you're sure, you could hardcode the paths yourself. Other notes
|
Quick follow-up... it is possible to only have the new installer in This also means you could get away without setting electron-builder to build for the squirrel target and create this dummy nupkg yourself. You'd have to copy some code from electron-builder (the template for the |
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.
The text was updated successfully, but these errors were encountered: