Check for app.asar file
This commit is contained in:
parent
069fb6b05b
commit
95871691a0
|
@ -114,7 +114,7 @@ namespace BetterDiscordWI.panels {
|
||||||
AppendLog("Deleting " + dir);
|
AppendLog("Deleting " + dir);
|
||||||
Directory.Delete(dir, true);
|
Directory.Delete(dir, true);
|
||||||
} catch {
|
} catch {
|
||||||
AppendLog("Error Failed to Delete the '" + dir + "\\resources\\app' Directory.");
|
AppendLog("Error: Failed to Delete the '" + dir + "\\resources\\app' Directory.");
|
||||||
errors = 1;
|
errors = 1;
|
||||||
Finalize(errors);
|
Finalize(errors);
|
||||||
}
|
}
|
||||||
|
@ -144,15 +144,23 @@ namespace BetterDiscordWI.panels {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
AppendLog("Extracting app.asar");
|
AppendLog("Extracting app.asar");
|
||||||
AsarArchive archive = new AsarArchive(GetParent().DiscordPath + "\\resources\\app.asar");
|
string appAsarPath = GetParent().DiscordPath + "\\resources\\app.asar";
|
||||||
|
|
||||||
AsarExtractor extractor = new AsarExtractor();
|
if(File.Exists(appAsarPath)) {
|
||||||
//Add extraoffset of 3
|
AsarArchive archive = new AsarArchive(appAsarPath);
|
||||||
extractor.ExtractAll(archive, GetParent().DiscordPath + "\\resources\\app\\");
|
|
||||||
|
|
||||||
Splice();
|
AsarExtractor extractor = new AsarExtractor();
|
||||||
|
//Add extraoffset of 3
|
||||||
|
extractor.ExtractAll(archive, GetParent().DiscordPath + "\\resources\\app\\");
|
||||||
|
|
||||||
|
Splice();
|
||||||
|
} else {
|
||||||
|
AppendLog("Error: app.asar file couldn't be found in 'resources' folder. Installation cannot Continue.");
|
||||||
|
errors = 1;
|
||||||
|
Finalize(errors);
|
||||||
|
}
|
||||||
} catch {
|
} catch {
|
||||||
AppendLog("Error Extracting app.asar: Newtonsoft.Json.dll might not be present in the Installer Folder. Installation cannot Continue.");
|
AppendLog("Error: Extracting app.asar: Newtonsoft.Json.dll might not be present in the Installer Folder. Installation cannot Continue.");
|
||||||
errors = 1;
|
errors = 1;
|
||||||
Finalize(errors);
|
Finalize(errors);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue