sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
804 stars 39 forks source link

"Unable to run with elevated privileges" when updating Windows version #3920

Open nriley opened 3 years ago

nriley commented 3 years ago

Description

I am not an administrator on my work Windows 10 machine. I have installed Sublime Text in my user profile directory on a local disk. The auto-updater prompts for administrative credentials which I do not have and fails when I cannot provide them, despite the filesystem permissions not requiring it.

Steps to reproduce

  1. Install (an old version of) Sublime Text 4.
  2. "Check for updates" and install the update.

Expected behavior

The installed version of Sublime Text updates.

Actual behavior

A UAC prompt, which when I cancel, gives me:

image

Moving the contents of Data\Update over the top of my installation to update manually from Windows Explorer works fine, without prompting for elevation.

Environment

wbond commented 3 years ago

Most likely this is the installer trying to set up registry keys for file associations. Previously we didn't do that.

I'll have to look and see if there is a way for us to get the installer to allow choosing between setting up associations at the machine level, or user level.

In the mean time, using the portable install may be a better fit, since that doesn't touch your registry at all and keeps everything in your install dir.

nriley commented 3 years ago

Hmm, thought I was using the portable install. But it'd be nice if file associations worked too!

wbond commented 3 years ago

It is possible I've interpreted this wrong. I'll have to see if I can reproduce.

nriley commented 3 years ago

Thanks. Let me know if I can provide any additional info to help (is there a way to tell if I have the portable install)?

nriley commented 3 years ago

The upgrade to build 4097 worked perfectly without any UAC prompting. Did this get fixed?

wbond commented 3 years ago

We didn't change anything on our end. I'm inclined to close and have you re-open if you run into this again.

nriley commented 3 years ago

Sounds good. This did happen with many upgrades before I reported it so either something changed on my end of which I am unaware or I just got lucky with a race condition.

nriley commented 3 years ago

This has happened with the last couple versions. This time I expanded the UAC prompt - it looks like it's trying to run the updater with --admin despite it being within my user profile directory. Writing to any of those directories should not require elevation.

image

capn-freako commented 4 months ago

Was there ever any resolution to this?

nriley commented 4 months ago

I still get it from time to time and have to manually download/replace Sublime Text rather than use the updater.