winutil icon indicating copy to clipboard operation
winutil copied to clipboard

Error when installing Spotify

Open Rasinzz opened this issue 2 years ago • 4 comments

Describe the bug Spotify does not install when installer is ran in administrator mode.

To Reproduce Steps to reproduce the behavior:

  1. Run the script
  2. Check Spotify under Multimedia Tools
  3. Click on Start Install
  4. Wait for error message to popup

Expected behavior The Spotify installer runs and successfully installs.

Screenshots image

Additional context A possible fix.

When installing all checked programs, check if Spotify is installed, if Spotify is checked then run Spotify installer in non-administrator Powershell, after Spotify is done installing, install other checked programs.

EDIT: Tried the fix above. First the installer started in non-administrator Powershell, but then I was prompted to open in administrator Powershell which then continued the install and resulted in the same error. I may have implemented this fix wrong, feel free to try your own way.

Rasinzz avatar May 21 '22 15:05 Rasinzz

@DeveloperDurp This looks right down your alley

Carterpersall avatar May 22 '22 20:05 Carterpersall

I am thinking of ways to handle it. By default the script will create an elevated shell for winget and install everything. The most simple way to handle this might be a way of tagging if an application requires admin or not and go from there. However the problem will then become if it's already in an elevated shell and at this moment I don't know of a method to return to a normal shell.

This will also happen in the test.ps1 as well since I force admin for now until I can figure out this privileges trap.

DeveloperDurp avatar May 22 '22 22:05 DeveloperDurp

Could do a catch and force it into usermode with runas

Example: runas /user:$env:UserName "winget install -e Spotify.Spotify --force"

Downside is it would require the user to enter their password.

ChrisTitusTech avatar Sep 06 '22 02:09 ChrisTitusTech

You can run as normal user without entering a password by running through explorer.exe or by making a task in task scheduler. Though running through explorer.exe has some problems as I haven't been able to run programs with arguments that way. I've gotten around this by running .bat files. I just don't know if either of these ways can run as blocking, if that is wanted.

ozokuz avatar Sep 14 '22 13:09 ozokuz

Removed from winutil.

ChaseKnowlden avatar Jun 30 '23 19:06 ChaseKnowlden