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

Feature Request: non-uac per-user installer for winget #271

Closed
soredake opened this issue Jun 13, 2023 · 9 comments
Closed

Feature Request: non-uac per-user installer for winget #271

soredake opened this issue Jun 13, 2023 · 9 comments

Comments

@soredake
Copy link

Description

It would be nice if there is installer that don't require UAC so i can install gsudo from winget without UAC like in scoop package.

Proposed technical details

@gerardog
Copy link
Owner

Do you have an app as an example that has that behaviour?
Isn't every single app on winget asking for uac?

@soredake
Copy link
Author

Isn't every single app on winget asking for uac?

No, UAC is needed only for privileged actions like writing to some parts of registry or program files, software is slowly switching to per-user installer when it's possible.

Do you have an app as an example that has that behaviour?

Here is my list of per-user software:
https://github.com/soredake/dotfiles_windows/blob/7025ecb8259462e715ccef0b3944c8256ba453d2/setup.ps1#L2

Programs in AppData\Local\Programs:
image

@gerardog
Copy link
Owner

gerardog commented Jun 14, 2023

If it were done, the following scenarios would need to be tested

  • installing per user/ per machine using UI / command line.
  • upgrade previous versions <= v2.0.10 using the new installer.
  • once installed as per-user, doing a winget upgrade gerardog.gsudo should keep it per-user
  • once installed as per-machine, doing a winget upgrade gerardog.gsudo should keep it per-machine
  • Crossing fingers that re-testing different windows versions, or platforms (x86. x64, arm64) wont be required...

Modifying the installer is a lot of work... Every user has a different setup and each change tends to trigger unintended consequences and requires additional support.

I currently don't have spare time, and this feature already exists, if you use scoop to install gsudo.

If anyone is interested in contributing with a pull request, I would be really grateful. But the correct changes may need to be applied to the current installer in order to not break the existing flows.

@soredake
Copy link
Author

soredake commented Jun 14, 2023

  • once installed as per-user, doing a winget upgrade gerardog.gsudo should keep it per-user
  • once installed as per-machine, doing a winget upgrade gerardog.gsudo should keep it per-machine

You can do separate per-user/global installers.

I currently don't have spare time, and this feature already exists, if you use scoop to install gsudo.

Understandable, that's what i've done for now.

@soredake soredake changed the title Feature Request: non-uac user-mode installer for winget Feature Request: non-uac per-user installer for winget Jun 14, 2023
@gerardog
Copy link
Owner

gerardog commented Jun 15, 2023

  • once installed as per-user, doing a winget upgrade gerardog.gsudo should keep it per-user
  • once installed as per-machine, doing a winget upgrade gerardog.gsudo should keep it per-machine

You can do separate per-user/global installers.

😢 So much trouble!

If this can be done without turning 3 installers (x64,x86,arm64) into 6 (x64-per-user, x64-global,...), I would consider a PR!

New users arriving here: If you want to install gsudo per-user, without uac, use scoop or install the portable version manually.

... or upvote the first comment (here)!

@ALERTua
Copy link

ALERTua commented Dec 22, 2023

@gerardog I'll describe my automation case using gsudo and my thoughts.
I want to set up a fresh machine using several of my favorite programs. Ideally, I would like to provide the administrator password only once: for gsudo cache on. But to get there, I need gsudo. If to install gsudo, the user would need to have administrator rights, it's like distributing a 7zip install in a .7zip archive :D
Yes, portable gsudo exists, but then why does the installation exist in the first place?
For example with Chocolatey, all I need is to winget install chocolatey, and it gets installed without an administrator password into C:\ProgramData\chocolatey, and adds itself to the current user PATH. So by default, it's a winget --scope user install (they do not have --scope machine install at the moment).
But your idea is to have gsudo.exe (or its sudo alias) to be machine-wide, and I support it. User scope installation cannot do this. Maybe the winget installation compromise would be to make the default installation of user scope (like Scoop does) and provide a gsudo CLI command to make the current gsudo.exe machine-wide, like Nircmd does
image
C:\ProgramData\gsudo\gsudo.exe --install would create C:\Windows\System32\gsudo.exe and C:\Windows\System32\sudo.exe symlinks, or just append the current gsudo.exe path to the system PATH variable.
This way one would just

winget install gsudo
(installs to C:\ProgramData\gsudo, adds itself to the current user's PATH)
(Chocolatey-like "refreshenv" is needed here, I understand this. This is a separate topic.)
gsudo cache on
gsudo winget install directx
gsudo winget install Nvidia.GeForceExperience
...

I would appreciate this simplification. Without it, I am forced to store, distribute along with the automation scripts, and update manually, a portable gsudo installation, and avoid the installation.
I appreciate your work very much. Your product makes my work a lot easier. <3

@soredake
Copy link
Author

Maybe the winget installation compromise would be to make the default installation of user scope (like Scoop does)

I'll try to do this as winget now supports portable programs.

@soredake
Copy link
Author

microsoft/winget-pkgs#131849

@gerardog
Copy link
Owner

This change broke the winget release step, and now new versions are not being published to Winget.

Logs
Reference: vedantmgoyal9/winget-releaser#289

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

3 participants