installer fixed for real
This commit is contained in:
parent
701ae43120
commit
8e5c36a863
|
@ -54,6 +54,7 @@ function install() {
|
||||||
|
|
||||||
console.log("Extracting app archive");
|
console.log("Extracting app archive");
|
||||||
|
|
||||||
|
|
||||||
asar.extractAll(_discordPath + _appArchive, _discordPath + _appFolder);
|
asar.extractAll(_discordPath + _appArchive, _discordPath + _appFolder);
|
||||||
|
|
||||||
fs.exists(_discordPath + _appFolder, function(exists) {
|
fs.exists(_discordPath + _appFolder, function(exists) {
|
||||||
|
@ -63,7 +64,7 @@ function install() {
|
||||||
|
|
||||||
var data = fs.readFileSync(_discordPath + _index).toString().split("\n");
|
var data = fs.readFileSync(_discordPath + _index).toString().split("\n");
|
||||||
data.splice(80, 0, 'var _betterDiscord = require(\'betterdiscord\');\n');
|
data.splice(80, 0, 'var _betterDiscord = require(\'betterdiscord\');\n');
|
||||||
data.splice(363, 0, '_betterDiscord = new _betterDiscord.BetterDiscord(mainWindow); \n _betterDiscord.init(); \n');
|
data.splice(409, 0, '_betterDiscord = new _betterDiscord.BetterDiscord(mainWindow); \n _betterDiscord.init(); \n');
|
||||||
|
|
||||||
|
|
||||||
fs.writeFile(_discordPath + _index, data.join("\n"), function(err) {
|
fs.writeFile(_discordPath + _index, data.join("\n"), function(err) {
|
||||||
|
@ -73,7 +74,7 @@ function install() {
|
||||||
console.log("Injecting package.json");
|
console.log("Injecting package.json");
|
||||||
|
|
||||||
var data = fs.readFileSync(_discordPath + _packageJson).toString().split("\n");
|
var data = fs.readFileSync(_discordPath + _packageJson).toString().split("\n");
|
||||||
data.splice(9, 0, ',"betterdiscord":"^0.1.2"');
|
data.splice(9, 0, '"betterdiscord":"^0.1.2",');
|
||||||
|
|
||||||
fs.writeFile(_discordPath + _packageJson, data.join("\n"), function(err) {
|
fs.writeFile(_discordPath + _packageJson, data.join("\n"), function(err) {
|
||||||
if(err) return console.log(err);
|
if(err) return console.log(err);
|
||||||
|
@ -90,8 +91,6 @@ function install() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
console.log("Discord resources not found at: " + _discordPath);
|
console.log("Discord resources not found at: " + _discordPath);
|
||||||
process.exit();
|
process.exit();
|
||||||
|
|
Loading…
Reference in New Issue