Skip to content

Node.js based forum software built for the modern web

installer - finally got it all working ;)

psychobunny24a11314dcbf
diff --git a/install/web.js b/install/web.js
index f86feddaad..cbfd87c8ac 100644
--- a/install/web.js
+++ b/install/web.js
@@ -96,10 +96,19 @@ function install(req, res) {
}
function launch(req, res) {
+ var pidFilePath = __dirname + '../pidfile';
res.json({});
-
server.close();
- require('child_process').fork('app', [], {});
+
+ var child = require('child_process').spawn('node', ['app.js'], {
+ detached: true,
+ stdio: ['ignore', 'ignore', 'ignore']
+ });
+
+ fs.writeFile(__dirname + '../pidfile', child.pid, function() {
+ child.unref();
+ process.exit(0);
+ });
}
function compileLess(callback) {
diff --git a/public/src/installer/install.js b/public/src/installer/install.js
index 26c757ea1f..15b3514f03 100644
--- a/public/src/installer/install.js
+++ b/public/src/installer/install.js
@@ -114,7 +114,11 @@ $('document').ready(function() {
$('#launch .fa-spin').removeClass('hide');
$.post('/launch', function() {
- console.log('launched');
+ setInterval(function() {
+ $.get('/admin', function(data) {
+ window.location = 'admin';
+ });
+ }, 750);
});
}
});
\ No newline at end of file