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

Canary 0.0.138 Support #362

Merged
merged 1 commit into from
Aug 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ private void DownloadResource(string resource, string url) {
}

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 @@ private void Splice() {
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