I'm creating an app that can uninstall, remove and rename applications.
I get a list of them from Registry functions. I can delete them from the Registry, or rename them, but I can't uninstall applications that have an MSI, like Python or MySQL, for example.
With ShellExecute()
, I can uninstall apps that have an uninstall string like "C:\Program Files\VideoLAN\VLC\uninstall.exe"
. But if an application has an uninstall string like MsiExec.exe /I{D5201299-C610-4861-BFB6-A85BCCC69046}
then nothing happens.
I can't understand what I should do.
I can launch an MSI just by calling system()
, like system("start MsiExec.exe /I{D5201299-C610-4861-BFB6-A85BCCC69046}")
, but it doesn't work with uninstall.exe
.
Official MSDN didn't help me in any way to understand that problem.
So my question is: How can I uninstall an MSI app with ShellExecute()
?
Here is my code:
wstring uninstall_string;
ShellExecute(NULL, L"open", uninstal_string.c_str(), NULL, NULL, SW_SHOW);