Reputation: 109
I have a windows application which when you run ,first checks if there's a new version of the application. If there is a new version it downloads the exe then tries to run it. When it tries to run the exe, if the user did not run the application as an administrator an error occurs. But if they did run it as an administrator everything works fine. Please find below the code I am using to open the exe. Am not sure what I am doing wrong. Please assist. Thank you.
Private Sub DownloadFileCompletedCallBack(ByVal sender As Object, ByVal e As AsyncCompletedEventArgs)
Dim processStartInfo As ProcessStartInfo = New ProcessStartInfo()
processStartInfo.FileName = _tempPath
processStartInfo.Verb = "runas"
Process.Start(processStartInfo)
Close()
End Sub
The error i get is as follows System.ComponentModel.Win32Exception (0x80004005): The requested operation requires elevation at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
Upvotes: 0
Views: 224
Reputation: 36
Where is the new version downloaded from and does that location have restricted access rights ? Also, where is the users local installation located, it may be updating that location is restricted and that is what prevents the self-update. So you will need to deal with the permissions requirements of your deployment environment if the program requires this elevated right. Also check the Windows Eventlog on the user machine to get further details of what caused the exception, it may be a more specific error.
Upvotes: 0
Reputation: 15
what happen if you launch your application with admin access?
i think the application is launched with the caller application access.
Upvotes: 0