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

Custom Action and Component condition

Using a Basic MSI Project,

I have created a Property named PRODUCT_INSTALLED with value "No".

I have a custom action which checks to see if a file exists and if it does it uses MsiSetProperty(hMSI,"PRODUCT_INSTALLED", "Yes"); to set the new value.

I also have a component called "Product" this has the condition PRODUCT_INSTALLED="Yes"

This works when running a normal install via the User Interface. However this does not work if i run via the command line - msiexec /i product.msi /quiet

I have tried the Custom Action to be both immediate and deferred. I have also changed the sequence in which the CA runs.

Any advice would be great.

Thanks
Labels (1)
0 Kudos
(2) Replies
RobertDickau
Flexera Alumni

(As an aside, a system search might be a better way to handle this.)

In any case, you'll want the action to be scheduled before CostFinalize if you're using it as a component condition; perhaps place it in both the UI and Execute sequences to ensure it runs for both graphical and silent installations?
0 Kudos
Anonymous
Not applicable

After some investigating in turns out that the test that I perform on a folder path does not work correctly.

I have my path set to INSTALLDIR ^ "Folder" ^ "SubFolder".

This only works after CostFinalize but like you said I need to set the PRODUCT_INSTALLED value before CostFinalize.

It is OK to hardcode the path as there is only one install location and this seems to work fine.

Although is there an alternative to using INSTALLDIR?
0 Kudos