Friday, November 05, 2010 10:23 AM
Ok, i have created an autoupdate system for my software. I download new version to \Local\Temp\ folder. And no problems occurs. But if i try to start .exe file that i downloaded, i get error "Access to the path 'C:\Users\xxx\AppData\Local\Temp\updater.exe' is denied." The code that i use is:
ProcessStartInfo upgradeProcess = new ProcessStartInfo("updater.exe"); upgradeProcess.WorkingDirectory = System.Environment.ExpandEnvironmentVariables("%TEMP%"); <br/> Process.Start(upgradeProcess);
What steps i should take to eliminate that problem?
Thanks in advance!
Friday, November 05, 2010 10:31 AMHas the code that downloaded the updated file still got it open? Did you call Dispose() or Close() on the download stream?
Friday, November 05, 2010 10:37 AM
Did you already try this one
Friday, November 05, 2010 10:38 AM
Yes, the webclient that downloads the file is disposed before i try to run it!
Actually. Sorry, the exe file is not downloaded. exe file is copied from "program files" to temp. (.msi is downloaded)
exe file start the msi which is in temp folder. but i can't start exe file!
Friday, November 05, 2010 11:10 AMI tried Path.gettemppath, but everything stays the same! access denied.
Tuesday, November 09, 2010 8:39 AMModerator
Thank you for posting.
Based on your description, please check if update.exe has been set Read-only. This can cause an access denied exception to be thrown.
If you wouldn’t like to use ClickOnce to update your clients’ app, you could refer the following link that is very detail and useful links. http://digitalformula.net/articles/c-self-updating-application-without-clickonce
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
- Marked As Answer by Larcolais GongModerator Friday, November 12, 2010 5:14 AM