start install process fails with Access denied
Posted: Thu Jun 07, 2018 9:33 am
I have a script that copies a setup file to the desktop and runs the install process. The script is truggered from Jenkins.
The problem is that, sometimes, the script fails with Access denied error:
[Error ][Module]: Access to the path 'C:\Users\builder\Desktop\setup.exe' is denied.
I have full administrator rights on the computer and as I mentioned, it does not happen all the times.
my code:
string fullCopyPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + +"\\setup.exe";;
System.IO.File.Copy(fullPath, fullCopyPath, true);
System.Diagnostics.Process installerProcess;
installerProcess = new System.Diagnostics.Process();
installerProcess.StartInfo.FileName = fullCopyPath;
installerProcess.StartInfo.Arguments = "/s /v/qn";
installerProcess.StartInfo.UseShellExecute = false;
installerProcess.Start();
Any idea how can I solve this issue?
The problem is that, sometimes, the script fails with Access denied error:
[Error ][Module]: Access to the path 'C:\Users\builder\Desktop\setup.exe' is denied.
I have full administrator rights on the computer and as I mentioned, it does not happen all the times.
my code:
string fullCopyPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + +"\\setup.exe";;
System.IO.File.Copy(fullPath, fullCopyPath, true);
System.Diagnostics.Process installerProcess;
installerProcess = new System.Diagnostics.Process();
installerProcess.StartInfo.FileName = fullCopyPath;
installerProcess.StartInfo.Arguments = "/s /v/qn";
installerProcess.StartInfo.UseShellExecute = false;
installerProcess.Start();
Any idea how can I solve this issue?