Skip to content

Commit 5e1aed0

Browse files
committed
fix(action): impl install
Signed-off-by: Me0wo <152751263+Sn0wo2@users.noreply.github.com>
1 parent 1dd4651 commit 5e1aed0

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

action/impl/Install.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
using System;
1+
using System.Windows.Forms;
22
using WinProxyEnvSync.notify;
33

44
namespace WinProxyEnvSync.action.impl;
55

6-
public class Install(Tray _) : ITrayAction
6+
public class Install(Tray tray) : ITrayAction
77
{
8-
public Tray Tray { get; } = _;
9-
108
public void Execute()
119
{
12-
throw new NotImplementedException();
10+
var result = MessageBox.Show("Do you want to install WinProxyEnvSync? This will add it to startup.", "Confirm Install", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
11+
if (result == DialogResult.Yes)
12+
{
13+
install.Install.AddToStartup();
14+
tray.ShowMessage(null, "WinProxyEnvSync has been installed to startup.");
15+
tray.UpdateContextMenu();
16+
}
1317
}
1418
}

0 commit comments

Comments
 (0)