It is always a relief to see someone has already fought your struggles for you:
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.
- 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).
- 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.