DLee65
Level 13

SUITE package configured runs when install fails

I have a Suite / Advanced UI installer. In this installer I have our primary MSI package within its own Transaction. The package has both Package Configuring and Package Configured events.

I need a method to exclude certain events from executing if the install happens to fail.
My expectation was that because this is labeled 'Package Configured' that it would require that the Package be 'configured' successfully before executing the events. However, this is not true.
I have one condition on the events already to only execute if the install mode is not 'Remove'.

I look through the suite install log and did not see any particular property indicated that allows me to use it as a condition. I suppose I can have the last action of the MSI set a property for the suite; but I am hopeful that I do not have to add that layer of complexity.

Thanks.
Labels (1)
0 Kudos
3 Replies
DLee65
Level 13

So far, I have come up empty with this.

I have a request in with Flexera InstallShield help, but their initial response is that I have to create a custom action to handle this.

I find this a bit frustrating.
First, the setup.exe already has some type of internal method to detect if the install was successful or not because it selects the correct string for the finish dialog.
Next, this seems like a critical piece of information that would be important to a developer of a InstallShield Suite / AdvancedUI project.

Now it looks as if I will need to create a custom action that will open my primary MSI package, query for the ProductCode and Version, then query the registry to see if this product is installed.

Is there a better way to handle this scenario that someone else has come across?
In my earlier post I indicated that I was going to attempt to use the MSI to set a property, but I have not found a way to do this either.
0 Kudos
rguggisberg
Level 13

I have done this in my Suite. Unfortunately I no longer have access to that work I have done in the past. Pretty sure you do what you want at the 'Package' level. Send me a private message and we can discuss further.
0 Kudos
DLee65
Level 13

I created an InstallScript custom action that compares two version values.
The MSI always has the same version value as the suite package. I already write that value to the registry for use by other processes. If the install is successful then I assume the suite version is equal to the registry version. My guess is this will catch most all of the errors except for rare cases where the install doesn't roll back after writing registry entries. Below is my code:

/*
@brief: Checks that primary package has been installed correctly

@arg oExtension, Suite object

@description: Checks registry for ProductVersion to see if it is the same as the suite productversion

@author: Daniel Lee
@version: 1.0
@date: 2017-11-09
@update: DAL, 2017-11-09, AC-12128 - Created to address issues of custom actions running if the
amazing charts msi install fails. This will set a property MSISUCCESS to 1 (TRUE) if successful.
*/
function ConfirmSuccessfulInstall(oExtension)
NUMBER nResult, nvSize, nRegValueType;
STRING sCurrentVersion, sInstalledVersion, sIsSuccessful;
begin
SuiteLogInfo("INFO: Attempting to confirm successful msi install");
sIsSuccessful = "0";
nResult = SuiteGetProperty("ProductVersion", sCurrentVersion);
if (nResult == ISERR_SUCCESS) then
SuiteLogInfo("INFO: Current product version: %s", sCurrentVersion);
//Get the msi installed version from registry
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
nResult = RegDBGetKeyValueEx("SOFTWARE\\AmazingCharts\\AmazingCharts", "Version", nRegValueType, sInstalledVersion, nvSize);
if (nResult == 0) then
SuiteLogInfo("INFO: Installed product version: %s", sInstalledVersion);
//Vercompare requires four fields, need to concatenate '.0' to our version format
sCurrentVersion = sCurrentVersion + ".0";
sInstalledVersion = sInstalledVersion + ".0";
//'2' should be the value of constant EQUALS but this test failed for me so I inserted the numeral instead
if (VerCompare(sCurrentVersion, sInstalledVersion, VERSION) == 2) then
SuiteLogInfo("INFO: Current version and installed version are equal.");
sIsSuccessful = "1";
else
SuiteLogInfo("INFO: Current version and installed version are NOT equal.");
endif;
endif;
endif;
SuiteSetProperty("MSISUCCESS", sIsSuccessful);
end;
0 Kudos