Update error (access denied)Solved

Hello.

Could you please implement in wyUpdate that if file copy operation fails that it goes to sleep for one second and tries again (maybe this should be repeated several times if it fails again). Optionally this functionality could be turned on or off by switch on wyUpdate.exe

For example, this is error that my users are receiving on application update:

http://www.shrani.si/f/2E/7R/2wWgkibB/wyupdateerror.png

Could you please implement in wyUpdate that if file copy operation fails that it goes to sleep for one second and tries again (maybe this should be repeated several times if it fails again).

wyUpdate already does that when the file is in use. This is something different -- it sounds like your user is elevating to a non-admin user. Or maybe they're elevating to an "admin" user that someone stripped of admin powers using the Group Policy Editor.

Did wyUpdate ask for UAC elevation? Are you running as an admin user or an elevated user (i.e. do you have UAC turned off)? Does the update ever succeed?

You are probably right. I was launching wyUpdate.exe programatically from my application when new version was detected. My application of course was not running with admin rights.

(when wyUpdate.exe was started from Windows Explorer it worked correctly)

Now I added "runas" verb which should start process with elevated permissions:

ProcessStartInfo psi = new ProcessStartInfo(wyUpdatePath); psi.Verb = "runas"; //process should be started with elevated permissions ...

I will check if this works correctly when I prepare new version.

Thank you for now!

I was launching wyUpdate.exe programatically from my application when new version was detected. My application of course was not running with admin rights.

(when wyUpdate.exe was started from Windows Explorer it worked correctly)

It shouldn't make a difference whether you run wyUpdate from explorer or from your app. wyUpdate will detect when it's not elevated and prompt the user for elevation. The "access denied" error usually happens when the user is (or elevates to) a "neutered" admin account -- that is, an admin account stripped of its privileges.

When I started wyUpdate.exe from application (in non admin mode) it did not ask for elevation. I can send you download url of my application and you can test it by yourself.

I am using 64-bit Windows 7

It's better if you just post the snippet you're using to start wyUpdate. Also, are you an admin user?

Of course, I am member of Administrators group.

Here is the snippet:

string wyUpdatePath = Path.Combine(appDir, "wyUpdate.exe"); if (!File.Exists(wyUpdatePath)) { Console.WriteLine(string.Format("Error: '{0}' does not exist.", wyUpdatePath)); return; }

ProcessStartInfo psi = new ProcessStartInfo(wyUpdatePath); psi.Verb = "runas"; //this was added today, and asks user for elevated permissions psi.WindowStyle = ProcessWindowStyle.Normal;

psi.Arguments = string.Format("-forcelang=\"{0}\" -skipinfo", language);

try { Process.Start(psi); } catch (Exception ex) { Console.WriteLine("Exception: {0}", ex.Message); }

Oh, ok -- this is a bug in wyUpdate. When the "-skipinfo" commandline argument is used the user is never prompted with the UAC prompt (because it skips over that step). Obviously this shouldn't happen. We'll have this fixed for the next version of wyUpdate (should be released Monday).

Once this is fixed you should remove the "runas" verb. The reason is that this will cause problems for admin users who are already elevated.

Great!

Thank you very much for your support!

wyBuild 2.6.12 is now out -- this bug has been fixed.