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

Associating Custom Actions with a feature


1 reply to this topic

BRY

BRY
  • Members
  • 44 posts

Posted 02 May 2002 - 09:42

Hi there,

I am creating a Basic MSI project.

Is there any way to run a Custom Action only if a certain feature has been installed?

I have a merge module for my feature, but it needs to do some clever things like look for a file and only install a file if the search was unsuccessful.
I can't see any way to do that within the module (my preferred option), so can I create a custom action in my main install, and run it only if the associated feature has been installed?

Thanks...
Bryan Dickson
[br]Senior Software Engineer
[br]Fugro-UDI Limited

hteichert

hteichert
  • Members
  • 158 posts

Posted 02 May 2002 - 10:52

Yes, there is a possibility to run a CA only if a certain feature has been installed. Further info about conditions may be found by searching for "Conditional Statement Syntax" in the windows installer help (msi.chm, also delivered with ISWi or Developer).

But for the second thing:
You can't have build a merge module for a feature; merge modules can only contain components. It would be necessary to run a CA depending on the installation state of a component - not a feature.

To include a CA in merge module you have to create the CA as usual in the merge module. Afterwards it's necessary to include the CA to the right sequence table. For merge modules there are special sequence tables (accessible through Powereditor) called ModuleAdminUISequence, ModuleAdminExecuteSequence, ModuleAdvtUISequence, ModuleAdvtExecuteSequence, ModuleInstallUISequence and ModuleInstallExecuteSequence. In these tables you enter a so called base action (like LaunchConditions or AppSearch) and your CA. The time your CA will be executed depends on the base action and if you want it to be executed before or after this base action. When the merge module is merged into the MSI, your CA will be included in the right sequence table just at the base action you specified. For example:

ModuleInstallExecuteSequence table:
Action         Sequence       BaseAction     After     Condition
AppSearch      100
MyCA                          AppSearch      1


You can also give a condition on MyCA, it will only be executed if the condition evaluates to true.

As an example how it looks like you could have a look at Installshields MDAC26.msm using Orca.

Further info can be found in the Windows installer help file under "Merge Modules/Merge Module Reference"
h.teichert-ott