Program failed to run: The file cannot be accessed by the system

(Olafur) #1


I’m deploying a WPF application and in our process we are trying to use DesktopAppConverter to package our files into a .MSIX package.

My process is:

  1. Package deployment
  2. Run a powershell script that builds .MSIX package using Desktop App Converter (Inline source code)
  3. Run a powershell script that signs the .MSIX package (Inline source code)

My deployment fails in step 2, when running

desktopappconverter -installer C:\Octopus-Tentacle… C:\temp -Version -Makemsix -verbose -MyClient.exe -AppId “Demo3” -PackageName “TestApp” -Publisher “SomePublisher”

As the error is message (see screenshot below):

The user running the Octopus tentacle is admin and has all necessary privileges. The script and the program “appconverter.exe” are both on same drive (C:).

What I’m thinking is that octopus tentacle always deletes its work files where the inline powershell script is located. Can it be that it has already been deleted by the tentacle before desktopappconverter runs, or finishes its task, resulting in “File cannot be accessed by the system…” error?

Any idea would be appreciated.


(Dalmiro Grañas) #2

Hi @olafurhj,

Thanks for reaching out!

In my experience, every time I got this File cannot be accessed by the system error it meant that the file I was trying to use was somehow corrupted. Or even the entire directory/drive in the worst cases.

Have you tried running the script from Step 2 by logging into that VM and using some static content as replacement for the package deployment files from Step 1 of your process? I’m wondering if after your package gets extracted during step 1, some kind of anti-virus software starts checking the new files and somehow locks them down in a way that Step 2 cannot use them (though that would normally throw something like File is un use by another process, but its still worth trying).

While you test that, I’m gonna ask my teammates if they have more ideas about why this could be happening.

Best regards,

(Olafur) #4

Hi @Dalmiro thanks for your response
Yes I’m able to run the script in powershell (or cmd) when I log in to my VM. I’m only running the same script command not exactly the same script file as the Octopus tries to run since it deletes its work files. But that works fine and it executes properly.

I’m going to contact my system admin and ask him about our anti-virus software. I know that we’ve had trouble with our anti-virus on our local machines in recent history. I will let you know when we have investigated that.

We’ve tried uninstalling our anti-virus software on our VM but we are still getting the same error, so it looks like it was not the problem.

Best regards

(Olafur) #5

Hi again @Dalmiro

Do you have any update for me? We are still running into this problem. Since my last update I’ve gotten a new VM and also setup a tentacle on my on desktop resulting in the same problem. I think that debunks the idea that the drive or directory is corrupted. Still there might be that the powershell script in the work directory, that is deleted after every deployment, is corrupted.

Best Regards