microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
109.73k stars 6.47k forks source link

Support installing as SYSTEM #8523

Open nicedevil007 opened 3 years ago

nicedevil007 commented 3 years ago

Heya,

I installed powertoys over SCCM as SYSTEM User on every client because non of the users got installation rights.

If powertoys starts up on windows boot it seems to start with SYSTEM User priviliges instead of the users own rights. So the user can edit fancy zones but they are not used after a reboot, because the SYSTEM User's account profile folder isn't available to the "normal" user.

Any advice for company deployment?

My own try to fix this for my users was to disable autostart of powertoys in the settings and just put a link to the shell:startup folder of every user by GPO. This seems to work with the behaviour that the settings window of powertoys will be opened on every startup...

crutkas commented 3 years ago

@enricogior this seems very close to https://github.com/microsoft/PowerToys/issues/8622

enricogior commented 3 years ago

@crutkas yes, probably the same issue.

Creating the scheduled task as SYSTEM does not work, it has to be created under the user account that will log in.

alicemq commented 3 years ago

I would like to second on this issue, as run at startup option is off, when deployed through SCCM.

There needs to be a solution, how to make it run at startup for every user. As this is domain computer, what are the options on doing that? Even pre-creating config file does not work, because it is overwritten when PT is launched. Right now I am looking for a solution by creating a scheduled task on logon of any user, to check if the user has PowerToys folder in AppData, and if not, to create task for that user, in the same manner, that PT creates task. If there would be better guides, or even more CMD flags - control through CMD, ie: launch PT with flag - /runonstartup:true - and it would create task for user.

I guess right now application is focused towards user, who knows this app. And I am trying to introduce to people, who would never find such application, because they are too "dumb".

TheToor commented 2 years ago

As I'm currently investigating other enterprise focused issues I'd like to revist this request too. Also I heard that there are plans to move to a user based installer. My idea for the current installer is noted below. If the user based installer is comming soon let me know so we can fit the idea for then new installer.

If I understand correctly the current schedule task is installed during installation in the following custom action: https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetupCustomActions/CustomAction.cpp#L195 To support installation as SYSTEM (or an ALLUSER deployment either way) the schedule task can't be installed during setup. I suggest that the setup instead creates a run once key for every user (& DEFAULT user) or an ActiveSetup entry. This "starter" routine will launch the PowerToys runner and installs the schedule task for the current user (if not disabled by enterprise settings?) as well as launch PowerToys like the normal schedule task.

If the setup is launched as non SYSTEM user (or interactive) the schedule task could be installed by the Installer as before.

The draft PR for this would look the following:

  1. Change installer to Install the schedule task for non SYSTEM / interactive users only
  2. Create a new schedule task / ActiveSetup / RunOnce that is only installed when running as SYSTEM / non interactive
  3. Create a new startup flag for the PowerToys runner which will install a schedule task for the current user

I think this way the installation and tool is only modified minimally while still providing the requested feature.

Happy to hear your feedback.