Order AppSearch entries? Sorry, but…

It is always a relief to see someone has already fought your struggles for you:

Things that seem to be impossible (or very difficult, or really bad ideas) to do with MSI

Can’t specify an order for LaunchConditions or AppSearches.

After hours of hopeless trying, I can confirm this. And: There is no workaround.

So, why would I need this?

To lookup the configuration files for Reporting Services.

Those have to be modified to add extensions, the rsreportserver.config to add the extension assembly, the rssrvpolicy.config to grant FullTrust.

I thought it was easy with WiX, using the XMLFile standard custom action.

It isn’t.

  1. Find the internal instance name for Reporting Services. This is in HKLMSOFTWAREMicrosoftMicrosoft SQL ServerInstance NamesRS. The key name is the "official" instance name and has to be specified by the Administrator, because we only know the most common ones: MSSQLSERVER (default instance) and SQLEXPRESS. A RegistrySearch will return something like MSSQL.2 or MSSQL.3 in the parent property (named maybe SSRSINSTANCE).
  2. Retrieve the actual program folder by doing a RegistrySearch for HKLMSOFTWAREMicrosoftMicrosoft SQL Server[SSRSINSTANCE]Setup. Now this has an order dependency on RegistrySearch #1. And therein, as the Bard would tell us, lies the rub.

But even if this would work reliably, we would then have to do the two file searches which depend on the result of #2. Can’t do that too. MSI would claim the freedom to do these searches before #1 and #2.

Re-ordering them manually in the MSI database using Orca is pointless.

What’s more, the XMLFile standard custom action is so utterly unusable for the purpose of adding an element with a name that already exists in the file to be modified, that developing a specific custom action is almost inevitable.

But remember: VBScript (and Jscript) MSI CustomActions suck.

Advertisements
This entry was posted in Coding Horror. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s