-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
46 lines (45 loc) · 1.46 KB
/
Copy pathProgram.cs
File metadata and controls
46 lines (45 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
namespace Launcher
{
internal class Program
{
[STAThread]
private static void Main(string[] args)
{
try
{
if (args.Length == 1 && string.Equals("install", args[0], StringComparison.OrdinalIgnoreCase))
{
if (Setup.Install())
{
HelpText.ShowInstalled();
}
}
else if (args.Length == 1 && string.Equals("uninstall", args[0], StringComparison.OrdinalIgnoreCase))
{
if (Setup.Uninstall())
{
HelpText.ShowUninstalled();
}
}
else if (args.Length == 2 && string.Equals("open", args[0], StringComparison.OrdinalIgnoreCase))
{
if (!args[1].StartsWith("extern", StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This program only accepts links starting with extern:// or externs://");
}
string url = "http" + args[1].Substring(6);
ChromeLauncher.OpenLink(url);
}
else
{
HelpText.ShowUsage();
}
}
catch (Exception e)
{
HelpText.ShowError(e);
}
}
}
}