My current project involves deploying an upgraded .exe file that runs as a Windows Service. In order to overwrite the existing .exe with the new version, I currently need to: (1) stop the service (2) uninstall the service (3) reboot the system (so Windows releases it's hold on the file) (4) deploy the new .exe (5) reinstall the service (6) start the upgraded service. I'd like to avoid the reboot, so that this can be a fully scripted/automated upgrade.
Is there any way to avoid rebooting? Maybe a command-line tool that will force Windows to give up it's death grip on the old .exe?