Jump to content

This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.

Waiting for uninstall to complete

1 reply to this topic


  • Members
  • 5 posts

Posted 05 August 2005 - 15:44

I'm working with the code below that my colleague wrote (who has now left the team) and I'm trying to find a more elegant way to wait for the uninstall process to finish. The code below has been generating some errors during upgrades because not enough time is given for the uninstall to complete.

// If there is a previous version installed uninstall it now.
if( g_PerformUninstall = TRUE ) then
    hInstance = ShellExecuteA(NULL, "open", "msiexec.exe", "/qn /x{EE778344-B6AF-4374-90AA-312961EC577E}", SUPPORTDIR, SW_HIDE);  

    // Wait for a while so that the uninstall can complete before we start installation.
    Sleep( 1500 );

Without guessing and testing for a more reasonable amount of sleep time (my last resort), is there another way to do this?

Stefan Krueger

Stefan Krueger


  • Administrators
  • 13,269 posts

Posted 09 August 2005 - 14:20

You could try (prototyping and) calling the MsiConfigureProduct API.