Search code examples
node.jsnpmazure-devopselectronelectron-packager

electron-winstaller throws The system cannot find the path specified. at Squirrel.Utility.<CreateZipFromDirectory>d__23.MoveNext()<---


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.

Image of my build.js

Image of my package.json

enter image description here


Solution

  • 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