Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update check doesn't work on Windows unless app is run as Administrator #20

Open
jmadren opened this issue Jul 10, 2020 · 2 comments
Open

Comments

@jmadren
Copy link

jmadren commented Jul 10, 2020

Hi Kem,

I had everything working great until I tried in on an "installed" version of my app (installed in the normal program files). When the app runs from there, it never shows that an update is available. But if I "run as administrator", then it works (update is detected/found, update/install process runs).

Also, when it does run (as Administrator), the install process is failing to completely remove the backup. Log files says "Access is denied" when trying to delete the executable. All other files in backup are removed successfully, only fails on the executable (and therefore the backup folder remains as well). This does not occur if running the app from somewhere besides the program files folder (like the Xojo build folder) - just like the update detection issue above.

I tried updating to the current release of Kaju (after fixing that same issue I reported before - "shZipper set to Synchronous mode instead of Asynchronous after copying classes from Admin app"), but get the same results. Both the no updates unless run as Administrator, and failing to delete backup when it does run.

This was tested with Windows 10 on two different computers.

Thanks,
Jay

@jmadren
Copy link
Author

jmadren commented Jul 11, 2020

Ok, found the issue (for Update check not working). In Precheck it tests if the folder and files are writeable, which they are not for a non-administrator. Is there a way to work around this? I'm guessing it needs to initiate a UAC elevation, but only when it tries to install an update. All the prior update checking needs to work with the assumption that the application folder is not writeable (so write/download any needed files to the app data folder or something).

Thing is, I was checking ResultType in the ExecuteAsyncComplete event, but never got any result. Turns out that if Precheck fails, it sets the result but then returns false. I didn't trace everything out, but apparently this is prevents ExecuteAsyncComplete from firing, so I was not getting any ResultType.

@stretch327
Copy link

I would think that for installed products, you would want to download the latest installer and that pre-check should just check if the temp directory is writable, download it there and the launch the new installer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants