/**************************************************************
*** Uninstalls APPX Connector service process for Windows, ****
************ Linux, and Mac operating systems *****************
**************************************************************/

//Detects OS and sets the Service variable accordingly.

var serverConnectorUnInstallVersionStr = "5.4.4";
var serverConnectorUnInstallVersionNum = 50404.010;

switch(process.platform){
	case 'win32':
		var Service = require('node-windows').Service; break;
	case 'linux':
		var Service = require('node-linux').Service; break;
	case 'darwin':
		var Service = require('node-mac').Service; break;
}

//Create new service object
var svc = new Service({
	name: 'appxConnector',
	script: require('path').join(__dirname,'appxConnector.js')
	});

//Listen for Uninstall event.
 svc.on('uninstall', function(){
	console.log('Uninstall complete.');
	console.log('The service exists: ', svc.exists);
});

//Runs uninstall
svc.uninstall();
