-
Notifications
You must be signed in to change notification settings - Fork 3
/
Program.cs
58 lines (54 loc) · 1.85 KB
/
Program.cs
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
47
48
49
50
51
52
53
54
55
56
57
58
/*
* Copyright (c) 2011-2018 FEELTeam - Maurizio Montel.
*
* This file is part of the FEEL (FrontEnd - Emulator Launcher) distribution.
* (https://github.com/dr-prodigy/feel-frontend)
*
* FEEL is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, version 3.
*
* FEEL is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* doc/info/contacts: http://feelfrontend.altervista.org
*/
using System;
using System.Threading;
using feel.fnet;
using System.Windows.Forms;
namespace feel
{
class Program
{
private static Mutex mutex;
[STAThread]
static void Main(string[] args)
{
if (args.Length > 1 && args[0] == "--update")
{
CUpdateManager.Update(args[1]);
}
else
{
bool imFirstInstance;
mutex = new Mutex(true, "F.E.E.L.", out imFirstInstance);
if (!imFirstInstance)
return;
GC.KeepAlive(mutex);
using (var feel = new Feel())
{
var newVersion = (args.Length == 1 && args[0].Equals("--newversion")) ||
(args.Length == 2 && args[1].Equals("--newversion")) ||
(args.Length == 3 && args[2].Equals("--newversion"));
feel.Main(newVersion);
}
}
}
}
}