node-windows
node-windows copied to clipboard
Fixed uninstall process for services sharing same daemon directory.
If multiple services exist for the same daemon directory the current uninstall method tries to remove all documents within the daemon directory. Not just the one being uninstalled. This may leave an artifact from extra files created and the folder itself but that would be preferable to the other services '.exe' getting deleted.
changed
// Remove all other files
var _files = fs.readdirSync(me.root);
_files.forEach(function(f){
rm(f);
});
if (me.root !== path.dirname(me.script)){
fs.rmdir(me.root,function(){
sleep(1);
me.emit('uninstall');
});
} else {
me.emit('uninstall');
}
to
me.emit('uninstall');
Did anything actually change in the daemon.js (first commit)? It looks like the code didn't actually change, but it got moved all over the place.
The block of code was removed from lines 496 to 512 and replaced with just the me.emit('uninstall')
@jdziat - could you rebase to prevent merge conflicts? I'll merge this and make you a maintainer as soon as that happens. Sorry for the delay (had alot come up over the last week and a half).