cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
DanielEgleston
Level 3

Skip Custom Action when Re-running Setup

I am an InstallShield novice and I am new to custom actions, so I apologize in advance if this is a trivial issue.

I have a single setup.exe that installs a windows application and lays down several database script files that are run using through a custom action which calls a custom MSBuild script.

When I run the setup.exe for the original installation or an update, the application files are installed properly and the custom action runs as expected. However, when I run the re-run the setup.exe, as expected, no files are laid down, but the custom action still runs. Since the database scripts files don't exist, the custom action fails.

I would like to skip the custom action when the setup.exe is re-run, but I can't figure out what condition to use. I want the CA to run during an install and an update, but not when the setup.exe is being re-run.

Is there a condition that would allow me to skip the CA in this case?

Thanks in advance for your assitance.
Dan
Labels (1)
0 Kudos
(3) Replies
RobertDickau
Flexera Alumni

To detect a first-time (MSI) installation, there's the condition Not Installed.

Depending on your update type, you can use the same condition that's on the SetupResume dialog to detect a minor upgrade, or use ISACTIONPROP1 (or whatever the "action property" in your major-upgrade item is) after FindRelatedProducts to detect a major upgrade.
0 Kudos
DanielEgleston
Level 3

I have lived with this problem for months, but I am following up on the reply because the issue is becoming more problematic for us.

Robert, I have read the Installation and Uninstallation Conditions article you authored, but the conditions seem to miss the one condition that applies to my situation.

The Not Installed condition works great if I want to run the custom action only for first-time installations.

Let me add some details that may help explain the issue.

We develop several Windows applications that get built when a change is checked into source control, packaged (using InstallScript MSI), and bundled into a self-extracting ZIP file for deployment to test environments on a nightly basis.

On any given evening, only the applications that had changes are built, getting a new revision number (i.e. 2.1.1.####). The rest of the applications in the bundle remain the same as the previous night, yet are re-bundled with the changed applications and deployed.

To perform the deployment, we have a process that copies the self-extacting ZIP file to a test server and runs a generated script, which performs a silent install of each application in the bundle.

Here is the command we use to perform the silent install of an application:
"[ApplicationName]_Setup.exe" /s /V"/qn /l* \"[LogFilePath]""

Everything works as desired if the application being installed has an updated version number.

The issue occurs when the same version of an application is getting installed again. Windows Installer knows not to install any files, since the correct version of the files have already been installed. However, all of the custom actions execute. In this case, I don't want the custom actions to run.

But, I haven't been able to determine an installation condition that allows me to catch this condition. I only see conditions for Not Installed and Installed.

In a silent install, why would the custom actions execute, but the installation of files get skipped when determined that the version has already been installed? And how can I get the custom actions to not execute?

Thanks in advance,
Dan
0 Kudos
RickRogers
Level 5

Are the CA's in question created by your development team?

If yes, it may be best to add logic to your CA's that verifies if it is safe and/or necessary for the CA to execute...

Rick
0 Kudos