Squirrel.Windows icon indicating copy to clipboard operation
Squirrel.Windows copied to clipboard

"The system cannot find the file specified" when using releasify

Open DavidR91 opened this issue 5 years ago • 12 comments

When running

squirrel --releasify Updatetest.1.0.0.nupkg

I receive

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()
   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.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   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 System.Threading.Tasks.Task.Wait()
   at Squirrel.ReleasePackage.CreateReleasePackage(String outputFile, String packagesRootDir, Func`2 releaseNotesProcessor, Action`1 contentsPostProcessHook)
   at Squirrel.Update.Program.Releasify(String package, String targetDir, String packagesDir, String bootstrapperExe, String backgroundGif, String signingOpts, String baseUrl, String setupIcon, Boolean generateMsi, 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()
   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.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<CreateZipFromDirectory>d__23.MoveNext()<---

Looking at the log, it is creating and then copying Updatetest-1.0.0-full.nupkg to a temporary location:

2019-03-04 13:10:33> ReleasePackage: Creating release package: C:\Users\david.roberts\Documents\dev\updatetest\pack\Releases\Updatetest.1.0.0.nupkg => C:\Users\david.roberts\Documents\dev\updatetest\pack\Releases\Updatetest-1.0.0-full.nupkg
2019-03-04 13:10:33> ReleasePackage: Extracting dependent packages: []
2019-03-04 13:10:33> ReleasePackage: Removing unnecessary data
2019-03-04 13:10:33> Utility: Failed to extract file C:\Users\david.roberts\Documents\dev\updatetest\pack\Releases\Updatetest-1.0.0-full.nupkg to C:\Users\david.roberts\AppData\Local\SquirrelTemp\tempa
The system cannot find the file specified
2019-03-04 13:10:33> Unhandled exception: 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()
   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.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   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 System.Threading.Tasks.Task.Wait()
   at Squirrel.ReleasePackage.CreateReleasePackage(String outputFile, String packagesRootDir, Func`2 releaseNotesProcessor, Action`1 contentsPostProcessHook)
   at Squirrel.Update.Program.Releasify(String package, String targetDir, String packagesDir, String bootstrapperExe, String backgroundGif, String signingOpts, String baseUrl, String setupIcon, Boolean generateMsi, String frameworkVersion, Boolean generateDeltas)
   at Squirrel.Update.Program.executeCommandLine(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()
   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.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<CreateZipFromDirectory>d__23.MoveNext()<---

but Updatetest-1.0.0-full.nupkg is never visibly created on disk, and the destination (C:\Users\david.roberts\AppData\Local\SquirrelTemp\tempa) does not exist either

Is there something obvious I'm messing up here? My nupkg has valid metadata and all the standard content (net45, the squirrel DLLs etc.)

This is happening for me on Windows 10 17763.316 (1809)

DavidR91 avatar Mar 04 '19 13:03 DavidR91

Have you resolved this issue or is it still ongoing? @DavidR91

patrickklaeren avatar Apr 24 '19 20:04 patrickklaeren

I never resolved this issue but I haven't tried with any newer version of Squirrel etc.

DavidR91 avatar Apr 25 '19 07:04 DavidR91

@DavidR91 When you experienced this issue, what was the version of Squirrel used?

Thieum avatar May 07 '19 20:05 Thieum

@Thieum yeah I should have checked before saying I would re-test - this was against 1.9.1 which is still latest, so I wouldn't expect anything has changed

DavidR91 avatar May 09 '19 09:05 DavidR91

@DavidR91 it's kind of a shot in the dark, but the main dependency in the part of the code that fails is 7zip. We are using version 16.04, but I tried to use the latest version (19.00) available from https://www.7-zip.org/download.html

image

I tried to replace the version Squirrel is using by the latest, and it still works in my case. This would need further testing to be deemed ready for production, but you could try to replace the exe and the dll of 7-zip by their latest version counterparts, and see if it changes the behavior of Squirrel in your case.

image

Thieum avatar May 09 '19 13:05 Thieum

@DavidR91 if possible, you could list the filenames and the included paths that are supposed to be in the zip from your build folder here. Maybe there's a filename or a path that has something odd that could help us reproduce the issue.

Thieum avatar May 09 '19 14:05 Thieum

did you guys solve this yet? i tried replacing the 7z with version 19, but i still get the same error

maximilianschmidt avatar Nov 07 '19 19:11 maximilianschmidt

Works by declaring environment variable "SQUIRREL_TEMP" and pointing it to a temporary directory. I didn't dig much into it but seems like a bug in the way it creates temp directory before extracting zip file (i might be wrong)

rohitisinhk avatar Mar 09 '20 12:03 rohitisinhk

If you build from scratch to modify for your own use rather than using the nuget squirrel package it's missing a bunch of things from your output folder (equivalent of tools in the nuget). I just copied the missing bits over, 7z, wix, candle, light a bunch of dlls. Not sure how many were actually required but it works for me after that... I'd edit the main page to "Squirrel it's like click once, then mess around for a day, then google for two more then start to wish you just built something from scratch... yep it's like pretty much every project on github that you think is gonna save you some time!" The docs are not accurate at least for the latest version but with a bunch of messing about you can get it to work.

ken-sands avatar Oct 17 '21 20:10 ken-sands

I just copied the missing bits over, 7z, wix, candle, light a bunch of dlls. Not sure how many were actually required but it works for me after that..

That isn't in the docs because it's completely unnecessary and wrong

anaisbetts avatar Oct 17 '21 20:10 anaisbetts

Well the docs as they stand don't work which is why these threads exist with people trying such things. I did say "Not sure how many were actually required but it works for me after that" The obvious thought from the outside is "If it's wrong why are they all those files there in the squirrel release" Either they are there when they shouldn't be in the release or they are missing when building from source right? Unfortunately like most github projects the docs seem to be written from the developers machine where things just work. We've all done it, but start from a clean fresh machine and you get to once again do all those little things you forget along the way, adding a path to the environment here, pulling down some library there. Don't feel offended it's the same everywhere. Even big names like google with pdfium (it takes a hell of a lot of patience to do all the "fixes" needed to get that thing to actually build!) What would be more helpful than your comment above would be to give the necessary and right steps.

ken-sands avatar Oct 20 '21 10:10 ken-sands

Ran into this recently. We can't upgrade right now for various reasons, so we're still on 1.8.0. Setting SQUIRREL_TEMP to C:\Temp worked for us. Hope this might help anyone else that stumbles in here!

erik-source avatar Oct 26 '22 19:10 erik-source