/ Published in: C++
URL: mfc uninstall
Add self-uninstall ability to MFC application by calling ShellExecute for MsiExec.exe. Useful for temporary apps that can be uninstalled after use. The installation's GUID is required. This GUID is auto-created by Visual Studio when a Setup/installation project is created.
Expand |
Embed | Plain Text
BOOL MyDlg::OnMenuUninstall( UINT nID ) { // WinExec is obsolete. ShellExecute( NULL, // hwnd "open", // operation/verb. "MsiExec.exe", // executable. "/x{FEF094C3-B58A-42e5-8170-659A670B25E6}", // parameters. "", // directory SW_SHOW ); // how to be displayed // GUID comes from setup.vdproj file. Search for... // "ProductName" = "8:DCT Upgrade" // "ProductCode" = "8:{FEF094C3-B58A-42e5-8170-659A670B25E6}" return TRUE; }
You need to login to post a comment.
