Skip to content

Commit

Permalink
Status checking, shield icon
Browse files Browse the repository at this point in the history
  • Loading branch information
ocdtrekkie committed Jul 28, 2024
1 parent 448bb1f commit 5d7944b
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ private string CheckInstall()
{
if (File.Exists(@"C:\Program Files\XRFAgent\XRFAgent.exe"))
{
InstallBtn.Visible = false;
lblServiceStatus.Text = "Agent Service: " + CheckService();
return "Agent present";
}
else
{
InstallBtn.Visible = true;
lblServiceStatus.Text = "Agent Service: Not installed";
return "Agent not present";
}
}
Expand Down Expand Up @@ -120,11 +124,13 @@ private void Form1_Load(object sender, EventArgs e)
{
Directory.CreateDirectory(@"C:\HAC");
OpenConfigTable();
if (CheckInstall() == "Agent not present")
{
InstallBtn.Visible = true;
}
lblServiceStatus.Text = "Agent Service: " + CheckService();

Bitmap shieldIcon = new Bitmap(System.Drawing.SystemIcons.Shield.ToBitmap(), new Size(14,14));
InstallBtn.Image = shieldIcon;
InstallBtn.ImageAlign = ContentAlignment.MiddleLeft;
InstallBtn.TextImageRelation = TextImageRelation.ImageBeforeText;

CheckInstall();
}

private void LoadBtn_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -176,6 +182,16 @@ private void InstallBtn_Click(object sender, EventArgs e)
Installer.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
Installer.StartInfo.FileName = AppDomain.CurrentDomain.BaseDirectory + "agentinstall.bat";
Installer.Start();
Thread.Sleep(2000);
CheckInstall();
Thread.Sleep(2000);
CheckInstall();
Thread.Sleep(2000);
CheckInstall();
Thread.Sleep(2000);
CheckInstall();
Thread.Sleep(2000);
CheckInstall();
}
catch (Exception err)
{
Expand Down

0 comments on commit 5d7944b

Please sign in to comment.