-
-
Notifications
You must be signed in to change notification settings - Fork 570
System.ComponentModel.Win32Exception: The system cannot find the file specified when running on azure agent #3892
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
Comments
Related issue: #3900 |
@shirakaba I had a look at the issue you mentioned, I'm using pnpm and webpack (not vite). The script works on my local machine, but not in azure agents |
I’m experiencing this when building locally on an ARM VM (possibly cross-compiling to x64 – need to check), building with Webpack in a pnpm monorepo. However, I’ve set I’m hoping to attach a debugger to it to figure out which path it’s failing on. Just haven’t had a moment to look deeply into it yet. Need to compare to my two x64 machines and CI, too. I actually don’t have any working configuration yet – just failed like this on the first one I tried. |
Just checked. Happens locally on my x64 machine as well (same monorepo). Here are the log files I got from
The logs indicate that the following file was missing:
While
It sounds similar to Squirrel/Squirrel.Windows#539. I inspected "C:\Users\AdminUser\git\banana_native\node_modules\electron-winstaller\vendor\Squirrel.exe" --releasify "C:\Users\RootUser\AppData\Local\Temp\si-202535-21060-mina4t.5zwzm\electron_app.1.0.0.nupkg" --releaseDir "C:\Users\AdminUser\git\banana_native\apps\electron-app\out\make\squirrel.windows\x64" --loadingGif "C:\Users\AdminUser\git\banana_native\node_modules\electron-winstaller\resources\install-spinner.gif" --no-msi I set a breakpoint in a Node.js debugging terminal so that I could run the command manually without the temporary directory getting cleared away. I confirmed in Powershell (the shell I was running So given the inputs are all present, I wonder what it's failing on. Maybe it's something the Squirrel logic is doing internally. Of note, later on in the logs, it says it's going to extract to: It seems a lot of users solve problems, particularly in CI, by explicitly specifying So I tried passing $env:SQUIRREL_TEMP='C:\Users\AdminUser\git\banana_native\apps\electron-app\squirrel-temp'; "C:\Users\AdminUser\git\banana_native\node_modules\electron-winstaller\vendor\Squirrel.exe" --releasify "C:\Users\RootUser\AppData\Local\Temp\si-202535-21060-mina4t.5zwzm\electron_app.1.0.0.nupkg" --releaseDir "C:\Users\AdminUser\git\banana_native\apps\electron-app\out\make\squirrel.windows\x64" --loadingGif "C:\Users\AdminUser\git\banana_native\node_modules\electron-winstaller\resources\install-spinner.gif" --no-msi Unfortunately, although I can see it's honouring that environment variable (because it creates the |
I think I figured it out! I ran this command again: $env:SQUIRREL_TEMP='C:\Users\AdminUser\git\banana_native\apps\electron-app\squirrel-temp'; "C:\Users\AdminUser\git\banana_native\node_modules\electron-winstaller\vendor\Squirrel.exe" --releasify "C:\Users\RootUser\AppData\Local\Temp\si-202535-21060-mina4t.5zwzm\electron_app.1.0.0.nupkg" --releaseDir "C:\Users\AdminUser\git\banana_native\apps\electron-app\out\make\squirrel.windows\x64" --loadingGif "C:\Users\AdminUser\git\banana_native\node_modules\electron-winstaller\resources\install-spinner.gif" --no-msi And I looked closer at this error stack:
I looked into the Squirrel.Utility. method. I noticed that it searches for I recognised the "vendor" folder as belonging to the npm package named
Notice how there's no I'm using an x64-based computer, so I took a copy of vendor\7z-arm64.dll
vendor\7z-arm64.exe
vendor\7z-x64.dll
vendor\7z-x64.exe
+ vendor\7z.dll
+ vendor\7z.exe I re-ran the command and this time, there was no exception thrown! Curiously, it seems there's a script for automating exactly this in It seems it's supposed to run on the npm I believe this problem affects pnpm because, by default, it blocks all
So I expect that the fix, if you've not configured onlyBuiltDependencies:
- electron-winstaller Then:
|
I tried my suggested instructions. Still doesn't run the install script, at least on pnpm v9.15.9. No idea why. Feels like a bug in pnpm. Instead, we can forcibly run the 'install' script via: cd node_modules\electron-winstaller
pnpm run install
# or `npm run install` or `node --run install` - whichever you prefer. I created a little Node.js script (sorry, need permission to opensource) that checks whether That change finally makes my release build succeed! EDIT: I think this unexpected behaviour was happening to me simply because the |
@shirakaba Thanks, your solution works for me. Add {
"pnpm": {
"onlyBuiltDependencies": [
"electron",
+ "electron-winstaller"
]
},
} Thanks again. |
Add `electron-winstaller` in `onlyBuiltDependencies` when using pnpm. Related issue: electron#3892
* fix: add electron-winstaller in onlyBuiltDependencies Add `electron-winstaller` in `onlyBuiltDependencies` when using pnpm. Related issue: #3892 * style: format Co-authored-by: Kevin Cui <[email protected]> --------- Co-authored-by: Kevin Cui <[email protected]> Co-authored-by: Keeley Hammond <[email protected]> Co-authored-by: Erick Zhao <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Pre-flight checklist
Forge version
7.6.1
Electron version
35.0.2
Operating system
Windows server 2019, Windows server 2022, Windows server 2025
Last known working Forge version
7.6.1
Expected behavior
When running electron forge make script on azure pipeline agent, forge should create the distributable files for the application
Actual behavior
When I run 'make' script on azure pipeline agent, it fails on step 'Making a squirrel distributable for win32/x64'. The exception trace is:
× Making a squirrel distributable for win32/x64 [FAILED: Failed with exit code: 4294967295 Output: System.AggregateException: One or more errors occurred. ---> System.ComponentModel.Win32Exception: The system cannot find the file specified at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at Squirrel.Utility.<InvokeProcessAsync>d__11.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Squirrel.Utility.<CreateZipFromDirectory>d__23.MoveNext() --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at Squirrel.ReleasePackage.CreateReleasePackage(String outputFile, String packagesRootDir, Func
2 releaseNotesProcessor, Action1 contentsPostProcessHook) at Squirrel.Update.Program.Releasify(String package, String targetDir, String packagesDir, String bootstrapperExe, String backgroundGif, String signingOpts, String baseUrl, String setupIcon, Boolean generateMsi, Boolean packageAs64Bit, String frameworkVersion, Boolean generateDeltas) at Squirrel.Update.Program.executeCommandLine(String[] args) at Squirrel.Update.Program.main(String[] args) at Squirrel.Update.Program.Main(String[] args) ---> (Inner Exception #0) System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at Squirrel.Utility.<InvokeProcessAsync>d__11.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Squirrel.Utility.<CreateZipFromDirectory>d__23.MoveNext()<---
Steps to reproduce
Additional information
The process was working before, my last successful run was on October 18th, 2024. I searched for similar issues and I found that GitHub issue, and also that StackOverflow question, but none of the proposed fixes worked. It works fine on my machine, using Windows 11. I also tried to run that on an ubuntu agent, with mono and wine installed, and I got an error related to the graphics driver. I really don't know what's that related to, I tried running my previous commit, which triggered the last successful run and it also failed.
The text was updated successfully, but these errors were encountered: