Unbrick OpenAsar installs
This commit is contained in:
parent
2eb8f3ae19
commit
0328966e0f
1 changed files with 8 additions and 5 deletions
|
@ -29,11 +29,13 @@ console.log("[Vencord] Starting up...");
|
||||||
// Our injector file at app/index.js
|
// Our injector file at app/index.js
|
||||||
const injectorPath = require.main!.filename;
|
const injectorPath = require.main!.filename;
|
||||||
// The original app.asar
|
// The original app.asar
|
||||||
const discordPath = join(dirname(injectorPath), "..", "app.asar");
|
const asarPath = join(dirname(injectorPath), "..", "app.asar");
|
||||||
// Full main path Discord uses
|
|
||||||
require.main!.filename = join(discordPath, "app_bootstrap/index.js");
|
const discordPkg = require(join(asarPath, "package.json"));
|
||||||
|
require.main!.filename = join(asarPath, discordPkg.main);
|
||||||
|
|
||||||
// @ts-ignore Untyped method? Dies from cringe
|
// @ts-ignore Untyped method? Dies from cringe
|
||||||
app.setAppPath(discordPath);
|
app.setAppPath(asarPath);
|
||||||
|
|
||||||
// Repatch after host updates on Windows
|
// Repatch after host updates on Windows
|
||||||
if (process.platform === "win32")
|
if (process.platform === "win32")
|
||||||
|
@ -121,5 +123,6 @@ if (readFileSync(injectorPath, "utf-8").includes('require("../app.asar")')) {
|
||||||
return loadModule.apply(this, arguments);
|
return loadModule.apply(this, arguments);
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
require(discordPath);
|
console.log(require.main!.filename);
|
||||||
|
require(require.main!.filename);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue