Fan Control does not run on windows startup when installing it on a non-administrator user
Describe the bug Fan Control does not run on windows startup when installing it on a non-administrator user
When I log into the administrator user it does start up the software, so what I think is happening is that because the software requires administrator rights it runs as the administrator user and not as the logged in user, so it sets up the startup configuration in the wrong user.
The easy fix is to set up the automatic start up for all users, regardless of which user was used to install it.
The easy fix is to set up the automatic start up for all users, regardless of which user was used to install it.
This doesn't work with Scheduled tasks. At least I've never found a way to do it. You can edit the task and try a few things, but AFAIK you can't run an admin scheduled task to launch a UI on a non-admin user.
The fundamental issue with how you designed your software is that it requires admin privileges to even start. I've never actually wrote a program that needed elevated permissions but software that require elevated permissions need to be designed in a way that they are launched as a service by the OS and then your GUI does not require elevation and calls the API of the elevated service.
I realize that you might not want to make such a change to your product, but i am currently stuck with running the program with a scheduled task, and as you said, i cannot launch the GUI unless i kill the process first and launch it from my own user.
A correct design would be a background service and the GUI completely detached, which is not what you are currently doing. You are running the GUI and the fan logic in the same process. You might want to refactor and separate the GUI and the main logic for it to work correctly with how windows operates.
, i cannot launch the GUI unless i kill the process first and launch it from my own user.
You could create a duplicate task for that specific user ( 1 task per user ) as a quick fix/workaround . The software will exit the other process in the other session automatically.
As for the service stuff, I know all of that. I just haven't refactored/rearchitected the whole app since its really basic beginnings. I do actually have a service version that works, which just runs the backend, but I have not wired up the UI with a IPC protocol just yet, which is what takes the most amount of time. It's a big project that targets a minority of users ( most people run a single account ), so I just haven't prioritized it/had the available time.
but I have not wired up the UI with a IPC protocol just yet, which is what takes the most amount of time. It's a big project that targets a minority of users ( most people run a single account ), so I just haven't prioritized it/had the available time.
I could gladly help you with that if you were to accept outside contributions.
I found a way to start FC with task scheduler - it's very simple. But it is running in background with no icon in tray.
So I made shortcut with PS script:
Set-ExecutionPolicy -ExecutionPolicy Bypass
Start-Process -FilePath "C:\Program Files (x86)\FanControl\FanControl.exe" -ArgumentList "-e" -Wait
Wait-Process -name FanControl
Start-Process -FilePath "C:\Program Files (x86)\FanControl\FanControl.exe" -ArgumentList "-w"
which sends "exit" to FC and then starts it with window on top.
Non-priveleged user still cannot start it, but I don't need that.
I have a similar solution - just using GUI of Task Scheduler:
- When running the task, use the following user account: [admin account]
- Run whether user is logged on or not (you will be asked for a password for admin account)
- Run with highest privileges
- (all other settings by default, as created by the program setting)
The problem is the same though, no icon in a task bar. To launch UI fancontrol.exe process needs to be killed and relaunched again manually. I would be great indeed to separate lifted privileges into system service and UI functions into program in user space.
Anyway - thanks for the program, it works great!