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

Custom Action Limited to Install Only

I am trying to package a plotting program for our Architecture department. The package removes an existing plotting printer forces a reboot, and then completes 2 custom actions after the reboot to install the new printer, finally scheduling a final reboot. The problem I am having is that the package works fine on install but fails during uninstall because it is trying to execute the custom actions. When I attempted to add a NOT(REMOVE="ALL") it skips the ca's completely. The log doesn't say conditions not met skipping so I don't know

The sequence Looks like
Remove Legacy
Remove Printer (DLL CA)
Remove Existing Products
Install Initialize
Publish Product
Force Reboot
Run CA
Schedule Reboot
Install Finalize

The Forecereboot executes only if it finds and existing legacy or this is a major upgrade:
ACROPLOTUNINSTALLSTRING <> null or IS_MAJOR_UPGRADE

The ca's both have the same conditions but execute either after the reboot as would be the case if this was a legacy upgrade or msi major upgrade or if the sytem search for the legacy returned nothing or this wasn't an upgrade.
AFTERREBOOT or ((ACROPLOTUNINSTALLSTRING = NULL) or (NOT(IS_MAJOR_UPGRADE))

That worked fine; however this would execute during an uninstall. So I attempted to add the Not(REMOVE="ALL"):
(Not(REMOVE="ALL")) AND (AFTERREBOOT or ((ACROPLOTUNINSTALLSTRING = NULL) or (NOT(IS_MAJOR_UPGRADE))))

Now it doesn't run at all.

Any help would be appreciated, I have attached a VMWare movie of the install and the log.
(4) Replies
The condition to have something only execute on first install is 'Not Installed'.
I am familiar with that, but at what point is it considered Installed. After the reboot with that Condition it is not installing. I thought it was install finalize but if its Registry or FIles or another point I'll have to move my sequence to run this before it.
I'm not sure exactly where the Installed property gets set. If you are having problems with using just 'Not Installed' in a scenario where a reboot is required then you may want to try sequecning this action before the RegisterProduct action. After RegisterProduct has been run the MSI product registration will be in the registry, so it is possible that the initialization of the setup in AFTERREBOOT mode may set Installed if it sees the product entries in the registry.

I didn't test, I just thought I'd throw the idea out there to see if it helps.
Thanks for all of your help David I resolved the issue by doing a couple of things including what you recommended
The ForceREBOOT was a big issue but was required for upgrades. I moved it in the sequence to right after install initialize. As the Custom Actions needed to be after that and it was freed up to the bginning I had more leeway where to run them. I Sequenced the Not INstalled dependant CA's after StartServices but before RegisterUser
RegisterProduct
and Subsequent Publish........

This allowed them to see that the product was not installed, which eliminated the Remove issue. Thank you again.