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

[FEAT]: Allow installation for non-admin users #455

Closed
2 of 6 tasks
ALERTua opened this issue Dec 22, 2022 · 3 comments
Closed
2 of 6 tasks

[FEAT]: Allow installation for non-admin users #455

ALERTua opened this issue Dec 22, 2022 · 3 comments
Labels
feature New feature or request on hold Will be done in the future

Comments

@ALERTua
Copy link

ALERTua commented Dec 22, 2022

Version

2.7.1

OS

Windows 11 22000

Device

doesn't matter

BIOS version

doesn't matter

What's wrong?

I am using my Windows 11 PC with a non-administrator user. When needed, UAC prompts me for administrator rights, and I enter the username and password of a user with administrator rights to authorize the action.
The installer doesn't count on administrator privilege given by UAC using another user and installs the application in the local appdata of the user that spawned the installation process. When UAC spawned the process from another user, the application appears to be installed in that user's local appdata and becomes unavailable.
My suggestion is if the application has and requires administrator privilege, it may be installed somewhere accessible to all users, for example in ProgramData. This way it will be accessible to all users.
Also, the shortcut that is generated on the Desktop, contains wrong target (local appdata, but for non-administrator user) but the right working directory (local appdata of the administrator user), this makes the shortcut unusable.

My workaround was to copy the application folder to the accessible folder for all users, but the application crashes with

---------------------------
Error
---------------------------
Unexpected exception occurred:

Couldn't read the AppsUseLightTheme setting.



Please report the issue on https://github.com/BartoszCichecki/LenovoLegionToolkit/issues/new/choose.
---------------------------
OK   
---------------------------

I suspect the reason for this is in that the user that spawns the process isn't logged in.

How to reproduce the bug?

  1. Launch the installer as a non-administrator user User.
  2. UAC will prompt for elevation. Elevate the installation using the other, Administrator user credentials.
  3. Try to launch the application via the shortcut on the desktop.
  4. Try to launch the application via its executable.

What is the behavior that you expected?

  • The application is installed in a folder that is accessible for all users.
  • The application can be launched using the other user's administrator rights.

Logs

=== Exception ===
System.InvalidOperationException: Couldn't read the AppsUseLightTheme setting.
at LenovoLegionToolkit.Lib.System.SystemTheme.GetDarkMode()
at LenovoLegionToolkit.WPF.Utils.ThemeManager.get_IsDarkMode()
at LenovoLegionToolkit.WPF.Utils.ThemeManager.SetTheme()
at LenovoLegionToolkit.WPF.Utils.ThemeManager.Apply()
at LenovoLegionToolkit.WPF.App.Application_Startup(Object sender, StartupEventArgs e)
at System.Threading.Tasks.Task.<>c.b__128_0(Object state)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

=== Exception demystified ===
System.InvalidOperationException: Couldn't read the AppsUseLightTheme setting.
at bool LenovoLegionToolkit.Lib.System.SystemTheme.GetDarkMode()
at bool LenovoLegionToolkit.WPF.Utils.ThemeManager.get_IsDarkMode()
at void LenovoLegionToolkit.WPF.Utils.ThemeManager.SetTheme()
at void LenovoLegionToolkit.WPF.Utils.ThemeManager.Apply()
at async void LenovoLegionToolkit.WPF.App.Application_Startup(object sender, StartupEventArgs e)
at void System.Threading.Tasks.Task.ThrowAsync(Exception exception, SynchronizationContext targetContext)+(object state) => { }
at object System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, object args, int numArgs)
at object System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, Delegate callback, object args, int numArgs, Delegate catchHandler)

Do you have Lenovo software installed?

  • Lenovo Vantage is installed
  • Lenovo Hotkeys is installed
  • None of the above

Did you disable any Lenovo software using Lenovo Legion Toolkit?

  • Lenovo Vantage
  • Lenovo Hotkeys
  • I disabled some things on my own (please write below what you did)

Additional information

Slava Ukraїni

@ALERTua ALERTua added the bug Something isn't working label Dec 22, 2022
@BartoszCichecki BartoszCichecki added feature New feature or request and removed bug Something isn't working labels Dec 22, 2022
@BartoszCichecki BartoszCichecki changed the title [BUG]: Application file system unavailable if installed using other user administrator rights [FEAT]: Allow installation for non-admin users Dec 22, 2022
@BartoszCichecki BartoszCichecki added the on hold Will be done in the future label Dec 22, 2022
@BartoszCichecki
Copy link
Owner

Related to #246.

Multi user setup are not supported very well and that includes your scenario. I don't have plans to add support for cases like yours any time soon so not sure if and when it will be done.

@BartoszCichecki
Copy link
Owner

Also if you already have access to admin credentials, why not make you account admin?

@ALERTua
Copy link
Author

ALERTua commented Dec 22, 2022

Also if you already have access to admin credentials, why not make you account admin?

Alas, I can't. Security policy on a corporate laptop.

@BartoszCichecki BartoszCichecki closed this as not planned Won't fix, can't repro, duplicate, stale Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request on hold Will be done in the future
Projects
None yet
Development

No branches or pull requests

2 participants