Open Dragorn421 opened 3 years ago
Thanks a ton for sharing this issue edge case! We for sure don't want to break registration, appreciate all the details here - and a thousand times more if you're willing to do the PR! I'd be happy to review and give guidance if unsure where to start, but you should be able to make use of the error
and error_msg
fields for some of this, and also detecting if this is set within the draw window before drawing anything else.
I think it would be good to make sure there are stdout printouts, as well as a default label drawn in preferences in place of the rest of the UI indicating as you say, "Updater has no write permissions." with maybe some subtext for: "Try running blender as admin." Not sure if there's a nicely succinct way of describing "If you installed into the blender core addons folder, try installing to the user folder", as that could be wordy and just cause more confusion.
The other thing we should likely try to do in that state is still offer the "manual download" option, which is a button that just opens the according releases page, so it's still at least somewhat useful.
When an addon is mistakenly installed under a Blender installation folder which happens to be under
C:\Program Files\
, the updater addon will eventually raise an error during registering due to not having write access to the filesystem thereI'm using an old version of the updater addon but looking at current code this is probably still relevant. Sorry if it got addressed and I should just bother updating, lazy me
Here's the trace
Since this halts the registering, the addon doesn't unregister either and further registering attempts (eg by the user clicking the "enable addon" checkbox again) raise misleading errors about already-registered classes.
I think it would be nice to have the autoupdater handle "no file write permission" more gracefully. Maybe it should just disable itself and draw a message about "installed in the wrong directory, don't have write permissions" in the addon properties where the updater properties would be?
I can take care of PRing the necessary changes, I just want to find what the best way to handle this is first