I am trying to build a electron installer for windows platform in Azure DevOps
. I have successfully ran the electron-package command with npm run build (look at my package.json
). After that when I try to run the command to create the RELEASES, .msi, .exe and .nupkg files with electron-winstaller
it throws an error saying:
The system cannot find the path specified. at Squirrel.Utility.d__23.MoveNext()<---
The command that I executed was npm run create-installer-win
which executes the command node build.js
.
The build runs in a on-premises agent with windows server 2014.
Locally everything works fine.
The was with Squirrel.
My agent is running with NT AUTHORITY\System user which does not have permission to create the SquirrelTemp folder in %appdata%. When it try to create de folder in current folder it throws the error because it does not find the SquirrelTemp folder.
The solution I have found was to set a environment variable SQUIRREL_TEMP in the build pipeline with the value to %currentfolder%\SquirrelTemp and it works.
Thanks to https://github.com/Squirrel/Squirrel.Windows/issues/1081#issuecomment-340958128