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

Commit

Permalink
installer fixed for real
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiiks committed Sep 2, 2015
1 parent 701ae43 commit 8e5c36a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions NodeInstaller/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ function install() {

console.log("Extracting app archive");


asar.extractAll(_discordPath + _appArchive, _discordPath + _appFolder);

fs.exists(_discordPath + _appFolder, function(exists) {
Expand All @@ -63,7 +64,7 @@ function install() {

var data = fs.readFileSync(_discordPath + _index).toString().split("\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) {
Expand All @@ -73,7 +74,7 @@ function install() {
console.log("Injecting package.json");

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) {
if(err) return console.log(err);
Expand All @@ -90,8 +91,6 @@ function install() {
}
});



} else {
console.log("Discord resources not found at: " + _discordPath);
process.exit();
Expand Down

0 comments on commit 8e5c36a

Please sign in to comment.