-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm1.cs
218 lines (187 loc) · 7.83 KB
/
Form1.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
using MaterialSkin;
using MaterialSkin.Controls;
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace Project_Eru
{
public partial class Eru : MaterialForm
{
#region winget commands
// browsers
Dictionary<string, string> browsers = new Dictionary<string, string>()
{
{"Mozzila Firefox", "/C winget install -e --id Mozilla.Firefox" },
{"Google Chrome", "/C winget install -e --id Google.Chrome" },
{"Opera", "/C winget install -e --id Opera.Opera" },
{"Opera GX", "/C winget install -e --id Opera.OperaGX" },
{"Brave", "/C winget install -e --id BraveSoftware.BraveBrowser" },
{"Tor Browser", "/C winget install -e --id TorProject.TorBrowser" }
};
// gaming
Dictionary<string, string> gaming = new Dictionary<string, string>()
{
{"Discord", "/C winget install -e --id Discord.Discord" },
{"Steam", "/C winget install -e --id Valve.Steam" },
{"Epic Games", "/C winget install -e --id EpicGames.EpicGamesLauncher" },
{"League of Legends", "/C winget install -e --id RiotGames.LeagueOfLegends.EUNE" },
{"EA Desktop Client", "/C winget install -e --id ElectronicArts.EADesktop" }
};
// productivity
Dictionary<string, string> productivity = new Dictionary<string, string>()
{
{"Adobe Reader PDF", "/C winget install -e --id Adobe.Acrobat.Reader.64-bit" },
{"SumatraPDF", "/C winget install -e --id SumatraPDF.SumatraPDF" },
{"LibreOffice", "/C winget install -e --id TheDocumentFoundation.LibreOffice" }
};
// development
Dictionary<string, string> development = new Dictionary<string, string>()
{
{"Python 3.9", "/C winget install -e --id Python.Python.3.9" },
{"NodeJS", "/C winget install -e --id OpenJS.NodeJS" },
{"Git", "/C winget install -e --id Git.Git" },
{"Docker", "/C winget install -e --id Docker.DockerDesktop" }
};
// IDE's & text editors
Dictionary<string, string> ides = new Dictionary<string, string>()
{
{"VS Code", "/C winget install -e --id Microsoft.VisualStudioCode" },
{"PyCharm", "/C winget install -e --id JetBrains.PyCharm.Community" },
{"Vim", "/C winget install -e --id vim.vim" },
{"Notepad++", "/C winget install -e --id Notepad++.Notepad++" },
{"NeoVim", "/C winget install -e --id Neovim.Neovim" },
{"Atom", "/C winget install -e --id GitHub.Atom" },
{"SublimeText", "/C winget install -e --id SublimeHQ.SublimeText.4" },
{"Visual Studio", "/C winget install -e --id Microsoft.VisualStudio.2022.Community-Preview" }
};
//media
Dictionary<string, string> media = new Dictionary<string, string>()
{
//{"VLC", "/C winget install -e --id VideoLAN.VLC" },
{"Winamp", "/C winget install -e --id Radionomy.Winamp" },
{"Spotify", "/C winget install -e --id Spotify.Spotify" },
{"HandBrake", "/C winget install -e --id HandBrake.HandBrake" }
};
//utilities
Dictionary<string, string> utilities = new Dictionary<string, string>()
{
{"Greenshot", "/C winget install -e --id VideoLAN.VLC" },
{"Lightshot", "/C winget install -e --id VideoLAN.VLC" },
{"7-zip", "/C winget install -e --id VideoLAN.VLC" },
{"Winrar", "/C winget install -e --id VideoLAN.VLC" },
{"PowerISO", "/C winget install -e --id PowerSoftware.PowerISO" },
{"Bitwarden", "/C winget install -e --id Bitwarden.Bitwarden" }
};
#endregion
public Eru()
{
InitializeComponent();
var materialSkinManager = MaterialSkinManager.Instance;
materialSkinManager.AddFormToManage(this);
materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT;
materialSkinManager.ColorScheme = new ColorScheme(Primary.BlueGrey800, Primary.BlueGrey900, Primary.BlueGrey500, Accent.LightBlue200, TextShade.WHITE);
}
MaterialSkinManager ThemeManger = MaterialSkinManager.Instance;
private void Form1_Load(object sender, EventArgs e)
{
}
private void BrowsersCheckedList(object sender, EventArgs e)
{
BrowserList.CheckOnClick= true;
}
// function for the gaming check tab
private void GamingCheckedList(object sender, EventArgs e)
{
GamingList.CheckOnClick= true;
}
private void ProductivityCheckList(object sender, EventArgs e)
{
ProductivityList.CheckOnClick = true;
}
private void DevelopmentCheckedList(object sender, EventArgs e)
{
DevelopmentList.CheckOnClick = true;
}
private void IDESCheckList(object sender, EventArgs e)
{
IDESList.CheckOnClick = true;
}
private void MediaCheckList(object sender, EventArgs e)
{
MediaList.CheckOnClick = true;
}
private void UtilitiesCheckList(object sender, EventArgs e)
{
UtilitiesList.CheckOnClick = true;
}
private void InstallClick(object sender, EventArgs e)
{
foreach (string browser in BrowserList.CheckedItems)
{
if (browsers.ContainsKey(browser))
{
System.Diagnostics.Process.Start("PowerShell.exe", browsers[browser]);
}
}
foreach (string game in GamingList.CheckedItems)
{
if (gaming.ContainsKey(game))
{
System.Diagnostics.Process.Start("PowerShell.exe", gaming[game]);
}
}
foreach (string product in ProductivityList.CheckedItems)
{
if (productivity.ContainsKey(product))
{
System.Diagnostics.Process.Start("PowerShell.exe", productivity[product]);
}
}
foreach (string devel in DevelopmentList.CheckedItems)
{
if (development.ContainsKey(devel))
{
System.Diagnostics.Process.Start("PowerShell.exe", development[devel]);
}
}
foreach (string ide in IDESList.CheckedItems)
{
if (ides.ContainsKey(ide))
{
System.Diagnostics.Process.Start("PowerShell.exe", ides[ide]);
}
}
foreach (string med in MediaList.CheckedItems)
{
if (media.ContainsKey(med))
{
System.Diagnostics.Process.Start("PowerShell.exe", media[med]);
}
}
foreach (string util in UtilitiesList.CheckedItems)
{
if (utilities.ContainsKey(util))
{
System.Diagnostics.Process.Start("PowerShell.exe", utilities[util]);
}
}
}
private void UpgradeAllApps(object sender, EventArgs e)
{
string upgrade_all = "/C winget upgrade --all";
System.Diagnostics.Process.Start("PowerShell.exe", upgrade_all);
}
private void materialSwitch1_CheckedChanged(object sender, EventArgs e)
{
if (ThemeSwitch.Checked)
{
ThemeManger.Theme = MaterialSkinManager.Themes.DARK;
ThemeSwitch.Text = "Dark";
}
else
{
ThemeManger.Theme = MaterialSkinManager.Themes.LIGHT;
}
}
}
}