I have an updater that is called through the main program after detecting the update (from a remote XML file), it first checks if the process is open
if (clsProcess.ProcessName.ToLower().Contains("conkinator-bot.exe")) { clsProcess.CloseMainWindow(); return true; }
(this starts for each process until it finds it (foreach loop))
the updater downloads the file:
client.DownloadFile(url, "Conkinator-Bot-new.exe");
and then he tries to delete the current one and rename it:
File.Delete("Conkinator-Bot.exe"); File.Move("Conkinator-Bot-new.exe", "Conkinator-Bot.exe");
but the error I get when this happens is the following:
Unhandled exception: System.UnauthorizedAccessException: denied access to the path "D: \ Conkinator Skype Tool \ Conkinator-Bot.exe".
however, a new version of the program is being downloaded.
source share