Post a reply to the thread: Uninstalling services
Click here to log in
What's the name of our main installation product (in uppercase letters), directly followed by the current year?
You may choose an icon for your message from this list
Will turn www.example.com into [URL]http://www.example.com[/URL].
Re: Uninstalling services Mike, I would suggest to develop a custom uninstall that tries to stop and remove the service before the uninstall application removes the service file(s). Does this help? Friedrich
Re: Uninstalling services
Uninstalling services Hi, I've got what looks like a race condition or something like it and I'm sure its down to the way that the SCM (Service control manager works). I install a service using the following code within an sbi : ! Stop and remove service to cope with case where service is still installed from a failed uninstall. Stop Service "IncaCfgBackup" Remove Service "IncaCfgBackup" Install File "[SB_PROJECT]\..\CfgBackup\x64\Release\CfgBackupGUI.exe" to "%_SB_INSTALLDIR%\CfgBackupGUI.exe" (Always Install) Install File "[SB_PROJECT]\..\CfgBackup\x64\Release\CfgBackup.exe" to "%_SB_INSTALLDIR%\CfgBackup.exe" (Always Install) Create Service "IncaCfgBackup" (Always Install) Start Service "IncaCfgBackup" When the user removes the installation using Add/Remove programs they receive the message "The following file is in use and cannot be updated". If you hit retry it continues without any issue. This leads me to believe that a request to the SCM to stop the service is issued followed by the uninstall attempting to remove the file. The uninstall request into the SCM must be asynchronous and hasn't completed by the time we try to remove the binary. Has anyone any advice with regards to working around this. If I unistall silently the user will always have to reboot which isn't ideal. Thanks, Mike
Uninstalling services
Forum Rules