Skip to content

Commit

Permalink
quality of life update
Browse files Browse the repository at this point in the history
  • Loading branch information
Valkirie committed Dec 13, 2021
1 parent 0c8320e commit fba090e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
1 change: 1 addition & 0 deletions ControllerHelper/CmdParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
38 changes: 23 additions & 15 deletions ControllerHelper/ControllerHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
}
}

Expand Down Expand Up @@ -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;
Expand All @@ -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.");
}
}

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ControllerHelper/ServiceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit fba090e

Please sign in to comment.