Add Windows startup and draggable fan curve control#77
Closed
ciresnave wants to merge 1 commit into
Closed
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds Windows sign-in startup registration (via a scheduled task that runs run.bat) and replaces the temperature-to-fan-speed curve editor with a draggable 5-point graph, while also persisting/restoring fan control state and curve settings more reliably during startup.
Changes:
- Added startup registration support (scheduled task + minimized-to-tray launch) and bundled
run.batinto GUI output. - Added a draggable temperature curve graph editor and updated interpolation/application logic to match the graph.
- Persisted fan-control enablement + curve enablement/values and bumped versioning/docs (README + CHANGELOG).
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| run.bat | Adds an elevation + PsExec launcher flow used by sign-in startup and systems requiring SYSTEM context. |
| README.md | Documents new startup registration option and curve editor behavior/requirements. |
| CHANGELOG.md | Adds release notes for 1.1.0/1.2.0 changes. |
| AsusFanControlGUI/StartupRegistration.cs | Implements scheduled-task based sign-in startup registration and legacy Run-key cleanup. |
| AsusFanControlGUI/Properties/Settings.settings | Adds persisted settings for control enablement and temperature curve. |
| AsusFanControlGUI/Properties/Settings.Designer.cs | Adds strongly-typed accessors for new persisted settings. |
| AsusFanControlGUI/Properties/AssemblyInfo.cs | Bumps GUI assembly version to 1.2.0.0. |
| AsusFanControlGUI/Program.cs | Adds --minimized argument parsing and passes it into the main form. |
| AsusFanControlGUI/Form1.cs | Integrates startup registration UI, tray/minimized startup, curve enablement, and curve-based control loop. |
| AsusFanControlGUI/FanCurveGraphControl.cs | Adds draggable line-graph control for editing the 5-point curve. |
| AsusFanControlGUI/FanCurve.cs | Adds fan-curve model, serialization, parsing, and interpolation helpers. |
| AsusFanControlGUI/AsusFanControlGUI.csproj | Includes new curve/startup sources, copies run.bat to output, adds net472 reference assemblies package. |
| AsusFanControlGUI/App.config | Adds default values for the new persisted user settings. |
| AsusFanControl/Properties/AssemblyInfo.cs | Bumps core library assembly version to 1.2.0.0. |
| AsusFanControl/AsusFanControl.csproj | Adds net472 reference assemblies package. |
| AsusFanControl/AsusControl.cs | Changes fan multi-set pacing to synchronous Thread.Sleep between fan updates. |
Files not reviewed (1)
- AsusFanControlGUI/Properties/Settings.Designer.cs: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+143
to
+151
| try | ||
| { | ||
| fanCurve = new FanCurve(points); | ||
| return true; | ||
| } | ||
| catch (ArgumentException) | ||
| { | ||
| return false; | ||
| } |
Comment on lines
+33
to
42
| public void SetFanSpeeds(byte value) | ||
| { | ||
| var fanCount = AsusWinIO64.HealthyTable_FanCounts(); | ||
| for(byte fanIndex = 0; fanIndex < fanCount; fanIndex++) | ||
| for (byte fanIndex = 0; fanIndex < fanCount; fanIndex++) | ||
| { | ||
| SetFanSpeed(value, fanIndex); | ||
| await Task.Delay(20); | ||
|
|
||
| if (fanIndex + 1 < fanCount) | ||
| Thread.Sleep(20); | ||
| } |
Comment on lines
+90
to
+96
| return string.Format("\"{0}\" {1}", launcherPath, StartMinimizedArgument); | ||
| } | ||
|
|
||
| private static string BuildCreateScheduledTaskScript() | ||
| { | ||
| var targetUserName = EscapeForPowerShellSingleQuotedLiteral(GetTargetUserName()); | ||
| var actionArguments = EscapeForPowerShellSingleQuotedLiteral(string.Format("/c \"\"{0}\"\" {1}", GetLauncherPath(), StartMinimizedArgument)); |
Comment on lines
+208
to
+214
| return output.IndexOf("cannot find", StringComparison.OrdinalIgnoreCase) >= 0 || | ||
| output.IndexOf("cannot find the file specified", StringComparison.OrdinalIgnoreCase) >= 0 || | ||
| output.IndexOf("does not exist", StringComparison.OrdinalIgnoreCase) >= 0; | ||
| } | ||
|
|
||
| private static SchtasksResult RunSchtasks(string arguments) | ||
| { |
Comment on lines
+208
to
+214
| private void SyncStartupRegistrationState() | ||
| { | ||
| try | ||
| { | ||
| var isEnabled = StartupRegistration.IsEnabled(); | ||
| if (isEnabled) | ||
| StartupRegistration.RefreshCurrentExecutablePath(); |
Author
|
Pull request #75 has most of what I added. Probably consider merging that one instead of this. Sorry for the duplicate work. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds two user-facing improvements to Asus Fan Control:
It also fixes a curve persistence issue where saved curve values could be overwritten during startup before the saved settings were fully restored.
What Changed
run.batrun.batwith the GUI build output1.2.0README.mdand addedCHANGELOG.mdWhy
Some ASUS laptops only expose working fan control when the app is launched through the existing elevated
run.bat/PsExecflow. A plain Run-key startup was not sufficient on the affected machine, so startup registration now preserves that working launch path.The new graph editor also makes the temperature curve much easier to use, and the startup fix ensures saved curve settings are preserved correctly across restarts.
Validation
built successfully with:
msbuild AsusFanControl.sln /t:Build /p:Configuration=Releasemanually verified:
Notes
On systems that require the original launcher flow, the app still needs to be started through
run.bat, which elevates and launches the GUI in the context required for hardware access.