-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.js
23 lines (18 loc) · 940 Bytes
/
install.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const colors = require('./colors');
var Service = require('node-windows').Service;
var svc = new Service({
name: 'StudentVue Mailer Beta',
description: 'The StudentVue Mailer will check for new Synergy emails at a set interval, and them forward them to other email addresses.',
script: `${__dirname}\\index.js`
});
svc.on('install', function () {
svc.start();
console.log(`[${new Date().toLocaleString()}] ${colors.green}StudentVue Mailer is now running as a Windows Service. It will run in the background until it is manually terminated.${colors.r}`)
});
svc.on('alreadyinstalled', function () {
console.log(`[${new Date().toLocaleString()}] ${colors.green}StudentVue Mailer is already installed.${colors.r}`)
})
svc.on('invalidinstallation', function () {
console.log(`[${new Date().toLocaleString()}] ${colors.green}StudentVue Mailer was installed incorrectly. Please retry installation.${colors.r}`)
})
svc.install();