Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

Commit

Permalink
Merge pull request #362 from Cyken-Zeraux/patch-2
Browse files Browse the repository at this point in the history
Canary 0.0.138 Support
  • Loading branch information
Jiiks committed Aug 12, 2016
2 parents eb58553 + 3361528 commit fe1a300
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions Installers/dotNet/BetterDiscordWI/panels/Panel2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,31 @@ public partial class Panel2: UserControl, IPanel {
}

private void Splice() {
string indexloc = $"{GetParent().DiscordPath}\\resources\\app\\app\\index.js";

string indexloc = null;
if(File.Exists($"{GetParent().DiscordPath}\\resources\\app\\app\\index.js"))
{
//Normal path
indexloc = $"{GetParent().DiscordPath}\\resources\\app\\app\\index.js";
} else if (File.Exists($"{GetParent().DiscordPath}\\resources\\app\\index.js"))
{
//Canary 0.0.138 changed path to app\\index.js
indexloc = $"{GetParent().DiscordPath}\\resources\\app\\index.js";
}

if(indexloc == null)
{
AppendLog($"Error: index.js not found");
Finalize(1);
return;
}

if(!File.Exists(@"splice"))
{
AppendLog($"Error: splice install file not found, this should be included with the installer.");
Finalize(1);
return;
}

Thread t = new Thread(() => {
List<string> lines = new List<string>();
Expand Down Expand Up @@ -216,9 +240,10 @@ public partial class Panel2: UserControl, IPanel {
int errors = 0;
string curPath = $"{GetParent().DiscordPath}\\resources\\app\\app\\index.js";
if(!File.Exists(curPath)) {
AppendLog($"ERROR: FILE: {curPath} DOES NOT EXIST!");
string curPath2 = $"{GetParent().DiscordPath}\\resources\\app\\index.js";
if (!File.Exists(curPath) && !File.Exists(curPath2))
{
AppendLog($"ERROR: index.js not found in {curPath} or {curPath2}");
errors++;
}
Expand Down

0 comments on commit fe1a300

Please sign in to comment.