diff --git a/NbfcSetup/Configs.wxs b/NbfcSetup/Configs.wxs index 3a6177b7..0db4089d 100644 --- a/NbfcSetup/Configs.wxs +++ b/NbfcSetup/Configs.wxs @@ -19,12 +19,21 @@ + + + + + + + + + @@ -73,6 +82,9 @@ + + + @@ -133,6 +145,9 @@ + + + diff --git a/NbfcSetup/Constants.wxi b/NbfcSetup/Constants.wxi index b65930bf..40c73d3a 100644 --- a/NbfcSetup/Constants.wxi +++ b/NbfcSetup/Constants.wxi @@ -5,5 +5,5 @@ - + diff --git a/NbfcSetup/Product.wxs b/NbfcSetup/Product.wxs index 6bcd8816..dda9fd8d 100644 --- a/NbfcSetup/Product.wxs +++ b/NbfcSetup/Product.wxs @@ -101,7 +101,10 @@ - + + + + - + Source="$(var.NbfcServiceClient.TargetDir)NoteBook FanControl.exe"> + Icon="Nbfc.ico" Advertise="yes" /> + + + + @@ -159,10 +165,13 @@ - + Source="$(var.ConfigEditor.TargetDir)ConfigEditor.exe"> + + + + diff --git a/StagWare.FanControl.Service/FanControlService.cs b/StagWare.FanControl.Service/FanControlService.cs index ce20bbec..8edd85e1 100644 --- a/StagWare.FanControl.Service/FanControlService.cs +++ b/StagWare.FanControl.Service/FanControlService.cs @@ -102,7 +102,7 @@ public void Stop() if (this.initialized) { initialized = false; - Dispose(); + DisposeFanControl(); using (var settings = ServiceSettings.Load(SettingsDir)) { @@ -157,26 +157,7 @@ private void Dispose(bool disposeManagedResources) { if (disposeManagedResources) { - if (fanControl != null) - { - try - { - using (var settings = ServiceSettings.Load(SettingsDir)) - { - settings.AutoStart = this.initialized; - settings.TargetFanSpeeds = fanControl.FanInformation - .Select(x => x.AutoFanControlEnabled ? AutoControlFanSpeedPercentage : x.TargetFanSpeed).ToArray(); - - settings.Save(); - } - } - catch - { - } - - fanControl.Dispose(); - fanControl = null; - } + DisposeFanControl(); } disposed = true; @@ -281,6 +262,30 @@ private bool Restart(ServiceSettings settings) return this.initialized; } + private void DisposeFanControl() + { + if (fanControl != null) + { + try + { + using (var settings = ServiceSettings.Load(SettingsDir)) + { + settings.AutoStart = this.initialized; + settings.TargetFanSpeeds = fanControl.FanInformation + .Select(x => x.AutoFanControlEnabled ? AutoControlFanSpeedPercentage : x.TargetFanSpeed).ToArray(); + + settings.Save(); + } + } + catch + { + } + + fanControl.Dispose(); + fanControl = null; + } + } + #endregion } }