Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/jshackles/RetroGOG
Browse files Browse the repository at this point in the history
  • Loading branch information
jshackles committed Sep 2, 2020
2 parents 177fb3f + 50b05f9 commit d4b0319
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
Binary file modified RetroGOG.exe
Binary file not shown.
70 changes: 35 additions & 35 deletions src/RetroGOG/frmPluginSelect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,45 +151,45 @@ private void btnNext_Click(object sender, EventArgs e)
client.DownloadFile("https://raw.githubusercontent.com/jshackles/RetroGOG/master/galaxy_api.zip", Globals.GOGPluginPath + "\\galaxy_api.zip");
}

foreach (string item in chbPlaylists.Items)
foreach (string item in chbPlaylists.CheckedItems)
{
// Create Plugin directory
Directory.CreateDirectory(Globals.GOGPluginPath + "\\" + plugin_codes[item] + "\\");
// Create Plugin directory
Directory.CreateDirectory(Globals.GOGPluginPath + "\\" + plugin_codes[item] + "\\");

using (var client = new WebClient())
using (var client = new WebClient())
{
// Download Plugin from Github
client.Headers.Add("user-agent", "RetroGOG");
client.DownloadFile("https://raw.githubusercontent.com/jshackles/RetroGOG/master/plugins/" + plugin_codes[item] + "/manifest.json", Globals.GOGPluginPath + "\\" + plugin_codes[item] + "\\" + "manifest.json");
client.DownloadFile("https://raw.githubusercontent.com/jshackles/RetroGOG/master/plugins/" + plugin_codes[item] + "/plugin.py", Globals.GOGPluginPath + "\\" + plugin_codes[item] + "\\" + "plugin.py");
client.DownloadFile("https://raw.githubusercontent.com/jshackles/RetroGOG/master/plugins/" + plugin_codes[item] + "/version.py", Globals.GOGPluginPath + "\\" + plugin_codes[item] + "\\" + "version.py");

// Download Galaxy API and decompress
if (Directory.Exists(Globals.GOGPluginPath + "\\" + plugin_codes[item] + "\\galaxy\\"))
{
Directory.Delete(Globals.GOGPluginPath + "\\" + plugin_codes[item] + "\\galaxy\\", true);
}
System.IO.Compression.ZipFile.ExtractToDirectory(Globals.GOGPluginPath + "\\galaxy_api.zip", Globals.GOGPluginPath + "\\" + plugin_codes[item] + "\\galaxy\\");

// Write user_config.py file
string[] lines = new string[3];
lines[0] = "# This file automatically generated by RetroGOG";
lines[1] = "emu_path = \"" + Globals.RAPath.Replace("\\", "/").Replace("retroarch.exe", "") + "\"";
if (File.Exists(Globals.RAPath.Replace("retroarch.exe", "cores\\") + core_codes[item]))
{
// Download Plugin from Github
client.Headers.Add("user-agent", "RetroGOG");
client.DownloadFile("https://raw.githubusercontent.com/jshackles/RetroGOG/master/plugins/" + plugin_codes[item] + "/manifest.json", Globals.GOGPluginPath + "\\" + plugin_codes[item] + "\\" + "manifest.json");
client.DownloadFile("https://raw.githubusercontent.com/jshackles/RetroGOG/master/plugins/" + plugin_codes[item] + "/plugin.py", Globals.GOGPluginPath + "\\" + plugin_codes[item] + "\\" + "plugin.py");
client.DownloadFile("https://raw.githubusercontent.com/jshackles/RetroGOG/master/plugins/" + plugin_codes[item] + "/version.py", Globals.GOGPluginPath + "\\" + plugin_codes[item] + "\\" + "version.py");

// Download Galaxy API and decompress
if (Directory.Exists(Globals.GOGPluginPath + "\\" + plugin_codes[item] + "\\galaxy\\"))
{
Directory.Delete(Globals.GOGPluginPath + "\\" + plugin_codes[item] + "\\galaxy\\",true);
}
System.IO.Compression.ZipFile.ExtractToDirectory(Globals.GOGPluginPath + "\\galaxy_api.zip", Globals.GOGPluginPath + "\\" + plugin_codes[item] + "\\galaxy\\");

// Write user_config.py file
string[] lines = new string[3];
lines[0] = "# This file automatically generated by RetroGOG";
lines[1] = "emu_path = \"" + Globals.RAPath.Replace("\\","/").Replace("retroarch.exe","") + "\"";
if (File.Exists(Globals.RAPath.Replace("retroarch.exe", "cores\\") + core_codes[item]))
{
lines[2] = "core = \"" + core_codes[item] + "\"";
}
else
{
Form frmCoreSelect = new frmCoreSelect();
frmCoreSelect.Text = item;
frmCoreSelect.ShowDialog(this);
lines[2] = "core = \"" + Globals.TempCore + "\"";
}
System.IO.File.WriteAllLines(Globals.GOGPluginPath + "\\" + plugin_codes[item] + "\\" + "user_config.py", lines);

barProgress.Value = barProgress.Value + 1;
lines[2] = "core = \"" + core_codes[item] + "\"";
}
else
{
Form frmCoreSelect = new frmCoreSelect();
frmCoreSelect.Text = item;
frmCoreSelect.ShowDialog(this);
lines[2] = "core = \"" + Globals.TempCore + "\"";
}
System.IO.File.WriteAllLines(Globals.GOGPluginPath + "\\" + plugin_codes[item] + "\\" + "user_config.py", lines);

barProgress.Value = barProgress.Value + 1;
}
}
}
}
Expand Down

0 comments on commit d4b0319

Please sign in to comment.