Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Conditions for custom actions


3 replies to this topic

catrill

catrill
  • Full Members
  • 16 posts

Posted 24 June 2004 - 15:44

I created a merge module that is included in two MSIs. The question is, how can I ensure that some custom actions in my merge module only take place when the files in the merge module are first installed? And how can I make other custom actions that are only run when the files are finally removed?

I thought this would be done using conditions such as
?Component1=2 (TRUE if Component1 has not been installed)
$Component2=2 (TRUE if Component2 will be removed)

[This is slight simplification of what I am doing]

However, I install one product containing the merge module and this is fine. Then I install the second product, and the log tells me that all components are Absent, when I would expect MSI to find that the components are installed.

Can anyone explain this and suggest an alternative method? Thanks.

luke_s

luke_s
  • Full Members
  • 532 posts

Posted 25 June 2004 - 01:11

Have a look at using the

ModuleInstallExecuteSequence and ModuleAdminExecuteSequence

This allows you to place the custom action after something like Install Files, or even install finalize.



Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 25 June 2004 - 09:07

I think that these component install states indicate whether this component will be installed by this product. The actual install action will be increasing/decreasing a reference count, of course.

As a workaround, use AppSearch and search for a component (CompLocator).

catrill

catrill
  • Full Members
  • 16 posts

Posted 25 June 2004 - 12:50

I found this post on the installshield forum from RRanck (thanks RRanck):

"""
To detect when the component is being installed: $ComponentName=3

To detect when the component is being removed:
$ComponentName=2

The $ gives you the action state of the component, while the ? gives the current state. When installing the second product, if the component has already been installed with the first product, $ComponentName will evaluate to -1. Like wise, when uninstalling products, $ComponentName will remain -1 until the last product to be uninstalled actually removes the component.
"""

For me, the detection of component removal using $ComponentName=2 works, but detection of the first install using $ComponentName=3 doesn't work. Also the detection of the current install state (?ComponentName) does not give me 'Installed Local' when I expect it (after I have installed the first product containing the component).

I have worked around using AppSearch to check whether a registry entry is present.