Runt888
July 17th, 2006, 05:07 PM
I need to be able to launch an uninstaller from my code and wait until it is finished. Right now I use ShellExecuteEx with an open verb, and set the file to "c:\windows\system32\MsiExec.exe". Then I set the parameter string to be "/x{packageID}". This works great. However, I'm nervous about hardcoding in the path to the uninstaller. So I have a couple questions:
1. Obviously I should use a function to get the path to the system directory (ie, GetSystemDirectory). However, will MsiExec.exe always be there (assuming Windows Installer is installed on the machine)?
2. Would it be better to use the Windows Installer API? They have a couple functions that deal with uninstalling, but I haven't been able to find any examples of how to call those functions from C++.
Thanks for any help!
Kelly
1. Obviously I should use a function to get the path to the system directory (ie, GetSystemDirectory). However, will MsiExec.exe always be there (assuming Windows Installer is installed on the machine)?
2. Would it be better to use the Windows Installer API? They have a couple functions that deal with uninstalling, but I haven't been able to find any examples of how to call those functions from C++.
Thanks for any help!
Kelly