node-windows icon indicating copy to clipboard operation
node-windows copied to clipboard

Fixed uninstall process for services sharing same daemon directory.

Open jdziat opened this issue 7 years ago • 3 comments

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');

jdziat avatar Aug 30 '16 15:08 jdziat

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.

coreybutler avatar Sep 01 '16 22:09 coreybutler

The block of code was removed from lines 496 to 512 and replaced with just the me.emit('uninstall')

jdziat avatar Sep 02 '16 00:09 jdziat

@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).

coreybutler avatar Sep 14 '16 22:09 coreybutler