Skip to content

Commit 0ae9c31

Browse files
Updated Installer
1 parent 523b901 commit 0ae9c31

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

Installer/Install.cs

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,65 @@ void install(string name, string shortcutname, string appname, bool shortcut) //
133133
Program.CreateStartMenuShortcut("EZCode", shortcutname, Path.Combine(decompressDirectory, appname));
134134
}
135135
}
136+
137+
void install(string name, string shortcutname, string appname, bool shortcut) // Install
138+
{
139+
Working($"\n\nInstalling {name} From {githubRepoUrl}.git... This may take a second.");
140+
141+
Directory.CreateDirectory(tempDirectory);
142+
143+
string installFile = $"{name}_v{releaseTag}.zip";
144+
145+
string downloadUrl = $"{githubRepoUrl}/releases/download/v{releaseTag}/{installFile}";
146+
147+
string decompressDirectory = Path.Combine(filepath, $"{name} {releaseTag}");
148+
149+
WebInstaller($"{installFile}.zip", downloadUrl, tempDirectory, true);
150+
151+
string[] d = Directory.GetFiles(Path.Combine(tempDirectory, name));
152+
Directory.CreateDirectory(decompressDirectory);
153+
for (int i = 0; i < d.Length; i++)
154+
{
155+
FileInfo info = new FileInfo(d[i]);
156+
string t_decompress = Path.Combine(decompressDirectory, info.Name);
157+
File.Move(d[i], t_decompress, true);
158+
}
159+
Directory.Delete(tempDirectory, true);
160+
161+
if (shortcut)
162+
{
163+
Program.CreateShortcut(shortcutname, Path.Combine(decompressDirectory, appname));
164+
Program.CreateStartMenuShortcut("EZCode", shortcutname, Path.Combine(decompressDirectory, appname));
165+
}
166+
}
167+
168+
void lang_converter() // Install Language Converter
169+
{
170+
Working($"\n\nInstalling IDE From {githubRepoUrl}.git... This may take a second.");
171+
172+
Directory.CreateDirectory(tempDirectory);
173+
174+
string installFile = $"Language_Converter_v{releaseTag}.zip";
175+
176+
string downloadUrl = $"{githubRepoUrl}/releases/download/{releaseTag}/{installFile}";
177+
178+
string decompressDirectory = Path.Combine(filepath, $"Language_Converter {releaseTag}");
179+
180+
WebInstaller($"{installFile}.zip", downloadUrl, tempDirectory, true);
181+
182+
string[] d = Directory.GetFiles(Path.Combine(tempDirectory, $"Language_Converter"));
183+
Directory.CreateDirectory(decompressDirectory);
184+
for (int i = 0; i < d.Length; i++)
185+
{
186+
FileInfo info = new FileInfo(d[i]);
187+
string t_decompress = Path.Combine(decompressDirectory, info.Name);
188+
File.Move(d[i], t_decompress, true);
189+
}
190+
Directory.Delete(tempDirectory, true);
191+
192+
Program.CreateShortcut("Language Converter", Path.Combine(decompressDirectory, "LanguageConverter.exe"));
193+
Program.CreateStartMenuShortcut("EZCode", "Language Converter", Path.Combine(decompressDirectory, "LanguageConverter.exe"));
194+
}
136195
}
137196
catch (Exception ex)
138197
{

0 commit comments

Comments
 (0)