[Feature Request]: Split editor and functional components of FanControl, add to Task Scheduler
Would it be possible to split FanControl into two applications, one for editing/viewing your profiles, and another for actually running the application? The way I have FanControl setup as of right now is that instead of having it boot up on user login, I have it run on OS start via Task Scheduler. This means that the program is completely hidden from users, and quietly runs in the background even without a user logged in.
To me, that's perfect. However, the downside of it is that as of right now is that, because the editor software and the actual fan control software is combined, I can't edit my fan curves or update the program without closing my background task via task manager, then booting up the app manually, updating it or changing my fan curves, then rebooting to have it go back into the background. This works fine, but it would be better if the two parts of the program were separate, and one just booted up quietly when the system got turned on via Task Scheduler.
Would this be possible as a future direction for the program?
In other words, what you are asking is a service architecture for FanControl. https://github.com/Rem0o/FanControl.Releases/issues/135
Without explicitly working towards that direction, I have made the "core" of fancontrol work without the UI application. Service is thus a possibility.
But that would still require a lot of work, as a lot can go wrong with a service, the interoperability with a second UI application, and so on. It's not in the near-term plans. Right now I'm working on www.getfancontrol.com. Trying to get a better presentation, and eventually some documentations.
However, in your specific scenario, what happens if you just double click FanControl while an other instance is running? Bonus question: What "user" is running that background instance from the Task Scheduler? Same as your main user?
For Question 1: In previous versions, another instance would boot up, and the two would "fight". However, having updated to V133 yesterday, from something like V117 or something, that behaviour no longer exists, and the second instance does not boot, and does not show up in task manager. The background task continues running, and seems to continue functioning correctly. Please note that I do not use FanControl for GPU fan curve functionality (I have an AMD gpu and the driver tends to try and fight for control over GPU fans), so I cannot test whether GPU fan profiles continue to function via this service approach.
For Question 2: I use my personal windows account, with "Run whether user is logged on or not" set to true, "Do not store password" set to true, and "Run with highest privileges" set to true.
Try and set SYSTEM as the user which starts the scheduled Task. Then from your regular user, open up FanControl on top. It "should" close the SYSTEM instance, then open up a new instance with your user.
This is not the behaviour that occurs. The instance for the user simply doesn't open, and the system instance continues to operate.
Tbh this behaviour isn't great but it's not particularly terrible either. I think if it is possible to have fan control as a service as a goal to work towards then that'd be great, but if that is unfesible I don't think that my specific use case has to be catered to very much. As of right now, I'm more than content to occasionally have to shut it down from task manager, open it up, update it, and reboot.
I agree this feature request is necessary. Like the OP, I've tried launching FanControl at windows startup and have experienced the same behaviors already documented. It runs, but there is no way to access it once in Windows other than killing the task, even if it was launched under your own user before logging in. A true Windows service with UI interface is the most sensible solution to all this. The service would auto-launch at startup and the UI auto-launch at login to provide the system tray icons and easy access to the UI. Otherwise the fans in my system are like zombies waiting for a command until I finally log in for the first time. Not everyone auto logs in with a single user at Windows bootup. What do you think the fans are doing before then? They certainly aren't being controlled by "Fan Control" in its current state. Let's upvote this!
I would like to add my desire for FanControl to run as a service, with a user context UI application. Not having my cooling solution run until someone actually logs in, is a big limitation. The cooling needs are not tied to a user being actually at the computer. I also run best practice security by having my normal daily driver user account be a standard account, not an admin account. This means FanControl will refuse to start even after login. Without hacky workarounds, I have to manually start it with a UAC prompt.
Using a service architecture will allow for:
- the smarts(FanControl) for the devices cooling solution to start with the device itself, and not wait for a user login.
- work nicer with multiuser scenarios.
- not require an administrative user to start the cooling solution.
- allow for headless scenarios, like servers or building/rendering setups.
I love what FanControl is trying to do, so I'm waiting for some of these last core features before using it across the board.
Completely agreed, this would be a big improvement. I appreciate all the work you did to create this program and would love to recommend it to others as well! I can imagine there are too many issues and there's too little time to implement everything, so I am a bit hesitant to ask something as well. My two main issues are that I cannot run the program automatically on login and that it is not open source so I can improve it myself. I'm sure you have your reasons for that, so I'll just give my experience below.
The task scheduler option did not work for me on Windows 10. I have a normal local account and an administrator account. If run as an elevated task under the normal account, Fancontrol will no longer start the normal way afterwards any more. This means I have to end the task in task scheduler and rerun it as a program. The task is set to start after login and load my profile as an administrator, but it somehow does not actually seem to run (my fans would go silent otherwise). Maybe the problem is that explorer is not running as an administrator or the GUI is somehow still required, I wouldn't know. I am using the Corsair plug-in, so that could be another reason.
It seems code is missing to run the program as a service. I would assume that this can be solved by creating a service architecture, as everyone else mentioned. Luckily it's well documented by Microsoft how to implement this.
Hopefully you'll have the time to implement this feature and thanks again for putting so much of your own time into this project!
For those looking for a more complete guide on how to make this work as a service, here goes. Firstly, install FanControl, I would recommend doing it via scoop for ease of installation. Set up all your fan curves, and save it, verifying that it all loads correctly when you start up fan control. Then, go to task scheduler, and create a new task. Call it "Fan Control" or something along those lines, set the user who is running the application to SYSTEM, and check the "run with highest priveleges" box. Make the trigger "run at system startup", and set the action to "start a program", and use the fan control executable as the executable to be ran. If you're using scoop, this will be "C:\ProgramData\scoop\apps\fancontrol\current\FanControl.exe". Uncheck all of the conditions, so that it starts and continues to run under all circumstances, and configure the settings to your liking.
To modify your fan curve, you should just be able to open up fancontrol as a user as normal, and edit the fan curve. Then, close it and either restart the service manually or reboot your system, and your modifications will run in the background.
There are only two things that need to be changed in order for this entire process to become a seamless user experience.
- Automate the creation of the service from within FanControl, by making the "start with windows" checkbox create/delete the service whenever checked/unchecked.
- Automate the resumption of the service once the user-side FanControl instance is closed, so that FanControl is always running in the background.
Optionally, there could be a check box to allow FanControl to automatically update itself if running in the background like this, without user input, but that isn't a neccesity.
It seems like maybe an easier solution would be to just add an admin password to prevent unauthorized users from accessing/modifying FC, then run it with Windows normally. So other users won't be able to mess with it, while those requesting this can simply launch it, enter the password, make any modifications, then exit, at which point the changes will take effect immediately, without necessitating restarting a service or the computer, like normal, and FC will relock. Of course, the password would be optional, as most wouldn't need it.
@Rem0o should I close this issue given it's a duplicate of #135?
@Jackaed yes.