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

System.IO.IOException: The process cannot access the file 'C:\Users\patsupport\AppData\Local\SquirrelTemp\tempa\lib\net45\VirtualBlackBoard_ExecutionStub_ExecutionStub_ExecutionStub_ExecutionStub_ExecutionStub.exe'

Open StephanieLayton opened this issue 4 years ago • 3 comments

We've recently switched deploying one of our desktop apps from ClickOnce to Squirrel.Windows. The good news is that it is working successfully on most of the client servers. The not-so-good-news is that a few client servers are not happy and we are getting the following error.

System.IO.IOException: The process cannot access the file 'C:\Users\support\AppData\Local\SquirrelTemp\tempa\lib\net45\VirtualBlackBoard_ExecutionStub.exe' because it is being used by another process.

Having searched, I haven't seen anything that matches this error with the ..ExecutionStub.exe, but similar issues mention a possible anti-virus software being a problem Is this b/c of Anti-virus software?

Currently working in tandem to have customers turn off to experiment but we haven't had a customer response yet to do so. And if it is, is there a work around. And if it is something else, anyone provide a fix for this issue.

Hopefully this is enough info to get started on a discussion and any insight and help on getting this resolved is appreciated.

==========================================================

2020-03-05 10:19:57> Program: Starting Squirrel Updater: --releasify E:\Program Files (x86)\Generic Ed Company\genericEdApp 4.1\cabs\VirtualBlackBoard\VirtualBlackBoard.19.4.0.nupkg --releaseDir E:\Program Files (x86)\Generic Ed Company\genericEdApp 4.1\cabs\VirtualBlackBoard\SquirrelPackaging --no-msi --no-delta 2020-03-05 10:19:57> Program: Bootstrapper EXE found at:E:\Program Files (x86)\Generic Ed Company\genericEdApp 4.1\cabs\VirtualBlackBoard\squirrel.windows.1.9.1\tools\Setup.exe 2020-03-05 10:19:57> Program: Creating release package: E:\Program Files (x86)\Generic Ed Company\genericEdApp 4.1\cabs\VirtualBlackBoard\SquirrelPackaging\VirtualBlackBoard.19.4.0.nupkg 2020-03-05 10:19:57> ReleasePackage: Creating release package: E:\Program Files (x86)\Generic Ed Company\genericEdApp 4.1\cabs\VirtualBlackBoard\SquirrelPackaging\VirtualBlackBoard.19.4.0.nupkg => E:\Program Files (x86)\Generic Ed Company\genericEdApp 4.1\cabs\VirtualBlackBoard\SquirrelPackaging\VirtualBlackBoard-19.4.0-full.nupkg 2020-03-05 10:20:00> ReleasePackage: Extracting dependent packages: [] 2020-03-05 10:20:00> ReleasePackage: Removing unnecessary data 2020-03-05 10:20:00> ReleasePackage: No release notes found in C:\Users\patsupport\AppData\Local\SquirrelTemp\tempa\VirtualBlackBoard.nuspec 2020-03-05 10:20:01> Unhandled exception: System.AggregateException: One or more errors occurred. ---> System.IO.IOException: The process cannot access the file 'C:\Users\patsupport\AppData\Local\SquirrelTemp\tempa\lib\net45\VirtualBlackBoard_ExecutionStub_ExecutionStub_ExecutionStub_ExecutionStub_ExecutionStub.exe' because it is being used by another process. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)

StephanieLayton avatar Mar 05 '20 18:03 StephanieLayton

Yes, this error is typically caused by third-party antivirus blocking the installer from writing files. Are you signing your installer and executables? This typically dramatically reduces the amount of AV-related nonsense. Make sure that you're using the signing facility built into Squirrel, because it ensures that every file gets signed, including the execution stubs

anaisbetts avatar Mar 06 '20 06:03 anaisbetts

Ok. Thank you for the confirmation.

The AV software is told to skip a certain directory and we'd like the processing to happen there. Is there a way to tell Squirrel.Windows to do this processing in a specific/custom location?

StephanieLayton avatar Mar 17 '20 15:03 StephanieLayton

I'm getting the same error occasionally when releasifying and it's a big issue... signing the files won't help (haven't tried) simply cause at the Releasify method, the signing occurs AFTER the releasify process failes. It failed on: rp.CreateReleasePackage(Path.Combine(di.FullName, rp.SuggestedReleaseFileName), packagesDir, contentsPostProcessHook: pkgPath => { new DirectoryInfo(pkgPath).GetAllFilesRecursively() .Where(x => x.Name.ToLowerInvariant().EndsWith(".exe")) .Where(x => !x.Name.ToLowerInvariant().Contains("squirrel.exe")) .Where(x => Utility.IsFileTopLevelInPackage(x.FullName, pkgPath)) .Where(x => Utility.ExecutableUsesWin32Subsystem(x.FullName)) .ForEachAsync(x => createExecutableStubForExe(x.FullName)) .Wait();

and more specifically at: Utility.ExecutableUsesWin32Subsystem

Where it tries to open a stream of file but can't cause it's already in use (which I fail to understand how it happens only sometimes...)

Any suggestions? OP, did you ever solve this issue?

Alonzzzo2 avatar Aug 17 '21 15:08 Alonzzzo2