diff --git a/ControllerHelper/CmdParser.cs b/ControllerHelper/CmdParser.cs index 96b6fdd2b..c99697869 100644 --- a/ControllerHelper/CmdParser.cs +++ b/ControllerHelper/CmdParser.cs @@ -86,6 +86,7 @@ private bool CmdService(ProfileService option) break; case ProfileServiceAction.install: helper.ServiceManager.CreateService(helper.CurrentPathService); + helper.ServiceManager.SetStartType(System.ServiceProcess.ServiceStartMode.Automatic); helper.ServiceManager.StartService(); break; case ProfileServiceAction.uninstall: diff --git a/ControllerHelper/ControllerHelper.cs b/ControllerHelper/ControllerHelper.cs index 9af5ed51c..5a84b5339 100644 --- a/ControllerHelper/ControllerHelper.cs +++ b/ControllerHelper/ControllerHelper.cs @@ -138,21 +138,28 @@ public ControllerHelper(string[] Arguments, ILogger logger) if (FirstStart) { - DialogResult dr = MessageBox.Show(ServiceWelcome, "Please, gives us a minute", MessageBoxButtons.YesNo); - switch (dr) + if (IsElevated) { - case DialogResult.Yes: - Utils.OpenUrl("https://www.paypal.com/paypalme/BenjaminLSR"); - break; - case DialogResult.No: - break; - } + DialogResult dr = MessageBox.Show(ServiceWelcome, "Please, gives us a minute", MessageBoxButtons.YesNo); + switch (dr) + { + case DialogResult.Yes: + Utils.OpenUrl("https://www.paypal.com/paypalme/BenjaminLSR"); + break; + case DialogResult.No: + break; + } - this.args = new string[] { "service", "--action=install" }; + this.args = new string[] { "service", "--action=install" }; - FirstStart = false; - Properties.Settings.Default.FirstStart = FirstStart; - Properties.Settings.Default.Save(); + FirstStart = false; + Properties.Settings.Default.FirstStart = FirstStart; + Properties.Settings.Default.Save(); + } + else + { + Utils.SendToast("Please, gives us a minute", "Run Controller Helper as Administrator to complete first initilization process."); + } } } @@ -210,7 +217,8 @@ private void ControllerHelper_Load(object sender, EventArgs e) // display warning message toolTip1.SetToolTip(cB_RunAtStartup, "Run this tool as Administrator to unlock these settings."); - toolTip1.SetToolTip(gb_SettingsService, "Run this tool as Administrator to unlock these settings."); + toolTip1.SetToolTip(gb_SettingsService, "Run this tool as Administrator to unlock all settings."); + toolTip1.SetToolTip(gb_SettingsInterface, "Run this tool as Administrator to unlock all settings."); // disable run at startup button cB_RunAtStartup.Enabled = false; @@ -220,7 +228,7 @@ private void ControllerHelper_Load(object sender, EventArgs e) if (!Utils.IsDirectoryWritable(CurrentPathProfiles)) { b_ApplyProfile.Enabled = false; - toolTip1.SetToolTip(b_ApplyProfile, "Run this tool as Administrator to unlock these settings."); + toolTip1.SetToolTip(gB_XinputDetails, "Run this tool as Administrator to unlock these settings."); } } @@ -760,7 +768,7 @@ public void UpdateService(ServiceControllerStatus status, ServiceStartMode start if (cB_ServiceStartup.Enabled == false) cB_ServiceStartup.Enabled = true; break; default: - if (b_ServiceInstall.Enabled == false) b_ServiceInstall.Enabled = true; + if (b_ServiceInstall.Enabled == false) b_ServiceInstall.Enabled = IsElevated; if (b_ServiceDelete.Enabled == true) b_ServiceDelete.Enabled = false; if (b_ServiceStart.Enabled == true) b_ServiceStart.Enabled = false; if (b_ServiceStop.Enabled == true) b_ServiceStop.Enabled = false; diff --git a/ControllerHelper/ServiceManager.cs b/ControllerHelper/ServiceManager.cs index 9b256a5fe..eb424bcae 100644 --- a/ControllerHelper/ServiceManager.cs +++ b/ControllerHelper/ServiceManager.cs @@ -93,7 +93,7 @@ private void MonitorHelper(object sender, ElapsedEventArgs e) nextStatus = 0; prevStatus = 0; prevType = 0; - logger.LogError("{0} set to {1}", name, ex.Message); + logger.LogError("Service manager returned error: {0}", ex.Message); } }