Reply to Thread

Post a reply to the thread: Uninstalling services

Your Message

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

Additional Options

  • Will turn www.example.com into [URL]http://www.example.com[/URL].

Topic Review (Newest First)

  • 09-16-2009, 04:23 AM
    linder

    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
  • 09-16-2009, 04:18 AM
    mikedoris

    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

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •