You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version: 19.49.0 (electron-builder and electron-builder-squirrel-windows).
Target: squirrelWindows
Summary of impact
If the productName contains spaces, it will be replaced with %20 in the final exe. Apart from the cosmetic issue, it also causes electron.autoUpdater.quitAndInstall() to break.
Technical details
Since the update to Squirrel.Windows 1.7.x, there seems to be a discrepancy in how spaces (and probably other characters) are escaped in the .nupkg file. Previously Squirrel.Windows escaped the spaces with %20, and unescaped when extracting. With the newer version, this escaping/unescaping has been removed. However, electron-builder-squirrel-windows still escapes the spaces when building, which means the filenames are still escaped after extracting.
For most files I can simply choose to not use spaces. However, for the exe this is more difficult:
The exe name can only be controlled by setting "productName": "My Application".
productName affects a whole bunch of other things, most significantly the desktop shortcut, and Roaming/... folder name.
Since I need spaces in my shortcut name (having "MyApplication" there is just weird), I can't feasibly remove them from the exe name because of the above.
So because of this, my application ends up as "My%20Application.exe".
If this was just a cosmetic change, it would still be ok. However, this also breaks the electron.autoUpdater.quitAndInstall() process (restarting the app after installing the update). Internally, this calls Squirrel's Update.exe --processStartAndWait "My%20Application.exe". Squirrel tries to be smart, and replaces the %20 with a space when it looks for the exe. Unable to find it, it crashes and shows a nasty error dialog on some machines.
2018-02-06 03:54:51> Program: Starting Squirrel Updater: --processStartAndWait My%20Application.exe
2018-02-06 03:54:51> Program: Want to launch '...\app-4.31.2\My Application.exe'
2018-02-06 03:54:51> Program: File ...\app-4.31.2\My Application.exe doesn't exist in current release
2018-02-06 03:54:51> Unhandled exception: System.ArgumentException: Value does not fall within the expected range.
at Squirrel.Update.Program.ProcessStart(String exeName, String arguments, Boolean shouldWait)
at Squirrel.Update.Program.executeCommandLine(String[] args)
at Squirrel.Update.Program.main(String[] args)
The text was updated successfully, but these errors were encountered:
Version:
19.49.0
(electron-builder
andelectron-builder-squirrel-windows
).Target:
squirrelWindows
Summary of impact
If the productName contains spaces, it will be replaced with
%20
in the final exe. Apart from the cosmetic issue, it also causeselectron.autoUpdater.quitAndInstall()
to break.Technical details
Since the update to Squirrel.Windows 1.7.x, there seems to be a discrepancy in how spaces (and probably other characters) are escaped in the
.nupkg
file. Previously Squirrel.Windows escaped the spaces with%20
, and unescaped when extracting. With the newer version, this escaping/unescaping has been removed. However,electron-builder-squirrel-windows
still escapes the spaces when building, which means the filenames are still escaped after extracting.For most files I can simply choose to not use spaces. However, for the exe this is more difficult:
"productName": "My Application"
.productName
affects a whole bunch of other things, most significantly the desktop shortcut, andRoaming/...
folder name.Since I need spaces in my shortcut name (having "MyApplication" there is just weird), I can't feasibly remove them from the exe name because of the above.
So because of this, my application ends up as "My%20Application.exe".
If this was just a cosmetic change, it would still be ok. However, this also breaks the
electron.autoUpdater.quitAndInstall()
process (restarting the app after installing the update). Internally, this calls Squirrel'sUpdate.exe --processStartAndWait "My%20Application.exe"
. Squirrel tries to be smart, and replaces the%20
with a space when it looks for the exe. Unable to find it, it crashes and shows a nasty error dialog on some machines.My proposed fix would be to simply remove the
encodeURI
step from https://github.com/electron-userland/electron-builder/blob/master/packages/electron-builder-squirrel-windows/src/squirrelPack.ts#L245. However, I don't know enough about this to know what else this would affect.Logs from
Update.exe
crashing:The text was updated successfully, but these errors were encountered: