My customers run a c# bootstrap program remotely on windows 10 desktops.
There is one firm who's users all experience the same issue. No other firm reports the problem and we are unable to reproduce the issue in our test environment.
I can not determine the cause of the problem.
The problem is that each user is forced to start a C# program manually because the program fails to start automatically when the user logs in to his PC.
The current mechanism to auto-start the program is to provide a short cut in the Start-up folder during installation.
C:\Users\[Username]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
The C# program is just a bootstrap program that is used to launch a Java Swing UI so it can not be run as a Windows Service (as far as I know) because it produces an interactive display.
The program runs continuously unless it is explicitly killed by the user or he logs-off, the PC is rebooted, etc.
The error occurs when the bootstrap program tries to delete and copy an executable file during start-up.
My guess is that either the file is in use or the user doesn't have permission to delete the file.
The program is installed under the User's home directory (C:\Users\[Username])
The user's IT admin has confirmed that the user has full control and all permissions (except Special permissions) on the sub folders and executable.
The user is not an Admin user.
System.UnauthorizedAccessException: Access to the path 'C:\Users\username\UI\jre\bin\filename.exe' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalDelete(String path, Boolean checkHost)
at UI.Client.RetryDeleteFile(String filename) in Z:\Perforce\Head\main\src\dotnet\UIStartUp\UI\Client.cs:line 852
2019-04-02 06:59:05.SSS [ERROR] UI.Client:852: Not able to delete file (retrying): C:\Users\username\UI\jre\bin\username@company.com.exe:
Looking for suggestions on how to pin-point and resolve this.
The IT Admin in charge of the User desktops is not very cooperative and is rightfully running out of patience as we have been shooting in the dark.
I suppose we can come up with an installation option to avoid deleting files but this would disable a feature by which we are able to remotely upgrade our software without going through the installation process.