Community Forums
Results 1 to 5 of 5

Thread: Suite Uinstall/Install as one install experience

  1. #1
    Join Date
    May 2007
    Northern Minnesota

    Suite Uinstall/Install as one install experience


    I am uninstalling in a Suite (in preparation for new install). I have not figured out how to get rid of the popup "Are you sure you want to completely remove 'xxxxx' and all of its features?" This is easily done for a Basic MSI package or an MSI package. Is there a way to do it for an InstallScript MSI Setup.exe package? I do have access to the InstallScript MSI packages and could modify them, but public properties are not available in OnUninstall.

    I would like to make the uninstall of the old packages and the install of the new applications one install experience (upgrading without uninstalling will come later, but we have some very old packages for which that won't work).

    My problem is the flow… I can detect that the package(s) are already installed and uninstall them; but have not figured out how to switch to install after uninstall is done. Has anybody done anything like that?

    BTW, I am using IS 2013...posted a few questions over there recently, but does not seem to be much activity there.

    Thanks for any ideas!

  2. #2
    Join Date
    Dec 2001
    Bellheim, Rheinland-Pfalz, Germany
    Have you tried using a response file ?



  3. #3
    Join Date
    May 2007
    Northern Minnesota
    I tried a response file. That eliminates the user input, but is not a good choice because that does not remove the program from the ARP screen. Of course one could delete the registry keys for that... but that is even worse because then the Suite still thinks the package is installed!

    Running the uninstall twice with the response file does get it removed from the ARP screen... but that's not a good solution

    Edit 10/29/2015:
    Figured out how to get rid of Confirmation pop up and Finish screen. Need to use the -uninst option to Setup.exe (to get rid of entry in ARP). Then also need to bring in OnUinstall event and edit to remove those things. It works out in my case because ONUninstall only gets executed with -uninst and I only use -uninst in Suite.

    I still need to find a way to proceed with install after uninstall.
    Thanks Markus!
    Last edited by rguggisberg; 10-29-2015 at 09:06 AM.

  4. #4
    Join Date
    Jul 2003
    North Kingstown, RI, USA
    I am not certain what type of package you are trying to uninstall; It sounds like it is a MSI package, but the reference to a response file seems to indicate this is an InstallScript package you are attempting to uninstall.
    I had a scenario where we had an older package that was created with Wise Installer that I wanted to 'upgrade' during the install process.
    I ended up creating a C++ custom action to handle the uninstall of packages prior to version 7.0, which is our first InstallShield version.

    Here is the bulk of our C++ code:
    // AcRemovePkg.cpp : Defines the exported functions for the DLL application.
    #include "stdafx.h"
    #include <windows.h>
    #include <WinUser.h>
    #include <Msi.h>
    #include <iostream>
    #include <atlstr.h>
    using namespace std;
    #import "..\..\..\Redist\Language Independent\i386\SetupSuite.exe" no_namespace raw_interfaces_only named_guids
    // Prototypes
    HRESULT __stdcall AcRemovePackage(IDispatch *pAction);
    const int iGUID = 38;
    HRESULT __stdcall AcRemovePackage(IDispatch *pAction)
    	DWORD pcchProductName = iGUID;
    	DWORD pcchMaxPath = MAX_PATH;
    	// reserve storage for the package location and Product code
    	BSTR upgradeCode = ::SysAllocStringLen(NULL, 2*iGUID);
    	BSTR bstrUpgradeCode(_T("UPGRADE_PROPERTY"));
    	LPWSTR lpProductCode = new TCHAR[iGUID];
    	LPWSTR lpProductPackageName = new TCHAR[MAX_PATH];
    	INSTALLUILEVEL orignalUILevel;
    	HRESULT hRet;
    	WCHAR wMsgBuf[1024];
    	const int iIncrement = 100;
    	const int iTicksMax = 1000;
    	const wchar_t lpCommandLine[]=L"REMOVE=ALL";
    	// Create a smart pointer to the IsSuiteExtension COM interface
    	CComQIPtr<ISuiteExtension> spSuiteExtension = pAction;
    	CComQIPtr<ISuiteExtension2> spSuiteExtension2 = pAction;
    	EnumProgressFlags pfProgress;
    	pfProgress = epfProgressValid;
    		// Get the Product UpgradeCode from the Property
    		hRet = spSuiteExtension->get_Property(bstrUpgradeCode, &upgradeCode);
    		if (hRet != S_OK)
    			spSuiteExtension->LogInfo(L"Failed to locate UPGRADE_PROPERTY");
    		// Check to see if we have anything to upgrade (We should if we are here!)
    		UINT uProductCount = 0;
    		if(MsiEnumRelatedProducts(upgradeCode, 0, uProductCount, lpProductCode) == ERROR_SUCCESS )
    			if (MsiGetProductInfo(lpProductCode, INSTALLPROPERTY_LOCALPACKAGE, lpProductPackageName, &pcchProductName) == ERROR_SUCCESS)
    				wsprintf(wMsgBuf, L"ProductCode found is :%s", lpProductCode);
    					uProductCount += 1;
    					// we found so remove it
    					wsprintf(wMsgBuf, L"Removing product identified by :%s", lpProductCode);
    					// No UI Please
    					orignalUILevel = MsiSetInternalUI(INSTALLUILEVEL_NONE, 0);
    					// TODO: Send some message. Really should get this from the Install string table.
    					// TODO: This is not working yet
    					// spSuiteExtension2->SendProgressMessage(L"Remove prior install.....",iIncrement, iTicksMax, pfProgress);
    					UINT uRet = MsiConfigureProductExW( lpProductCode, 0 , INSTALLSTATE_ABSENT, lpCommandLine  );
    					// UI Please
    					MsiSetInternalUI(orignalUILevel, 0);
    					// Keep processing until done
    				}while (MsiEnumRelatedProducts(upgradeCode, 0, uProductCount, lpProductPackageName) != ERROR_NO_MORE_ITEMS);
    	catch(std::exception& e)
    		std::wcout <<"Exception caught" << endl;
    		std::wcout << e.what() << endl;
    // dllmain.cpp : Defines the entry point for the DLL application.
    #include "stdafx.h"
                           DWORD  ul_reason_for_call,
                           LPVOID lpReserved
    	switch (ul_reason_for_call)
    	return TRUE;
    This is used for uninstalling the previous version of the install during the Install of our newer InstallShield version of the package.
    To configure this for the Suite I added the event to the 'OnPackagesConfiguring' event.
    I set a condition on the event to 'MSI Upgrade', my Upgrade code, a Minimum and Max version (e.g., 1.0 Min, 6.9 Max) and made sure the flag for Include min and max are set to 'Yes'.

    This process works reliably for us. Hopefully it can offer some help for you.
    Dan Lee

    Release Engineer

  5. #5
    Join Date
    May 2007
    Northern Minnesota
    Thanks Dan!
    We are using InstallScript MSI projects. Fortunately the Product Code has not changed, so I did get the uninstall behavior I need (get rid of Confirmation pop up and Finish screen) by using the -uninst option to Setup.exe (to get rid of entry in ARP). Then also brought in OnUinstall event and edited it to remove those things. It works out in my case because OnUninstall only gets executed with -uninst and I only use -uninst in Suite.

    I still need to find a way to proceed with install after uninstall.

    BTW, I have another Suite challenge and I see from posts that you have Suite experience. I don't want to gobber up this post with another subject, so I will add new post over on IS 2013 forum soon. Please check it out and LMK if you have any thoughts on that one.

    Thanks again Dan

Posting Permissions

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