Question

I want to display Prerequisites are installed or not in UI dialog. IIS installed with ASP.NET feature enabled is one of the Prerequisite to install my setup.

I have set the image (right click or wrong click) in property based on the condition.

<Property Id="ASPNETENABLED">
        <RegistrySearch Id="IIS_ASPNET_RegKey" Root="HKLM" Type="raw" Key="SOFTWARE\Microsoft\InetStp\Components" Name="ASPNET" />
</Property>

<Property Id="IISico" Value="RightClick" />
<SetProperty Id="IISico" Value="WrongClick"  After="CostFinalize"><![CDATA[Installed OR ASPNETENABLED OR (IISMAJORVERSION AND (IISMAJORVERSION = "#6" OR IISMAJORVERSION = "#7"))]]></SetProperty>

<Control Type="Bitmap" Id="IISico" Width="35" Height="17" X="154" Y="105" Text="[IISico]" />

Setproperty condition is working fine as expected without ASPNETENABLED property. But it is always failed and shows ASP.NET is not enabled. I have checked the log, it shows the ASPNETENABLED property is set when the AppSearch action is running.

Action start 18:47:31: AppSearch.
AppSearch: Property: ASPNETENABLED, Signature: IIS_ASPNET_RegKey
MSI (c) (90:E4) [18:47:31:927]: PROPERTY CHANGE: Adding ASPNETENABLED property. Its value is '#1'.

But the IISico property is running when after CostFinalize only and it shows like below in logs.

Action 18:47:31: SetIISico. 
Action start 18:47:31: SetIISico.
MSI (c) (90:E4) [18:47:31:930]: PROPERTY CHANGE: Modifying IISico property. Its current value is 'RightClick'. Its new value: 'WrongClick'.
Action ended 18:47:31: SetIISico. Return value 1.

I am unable to find the root cause of the issue. Could you please help me to resolve this issue? Is there any other way to show the Prerequisite is installed or not? Thanks in advance.

Was it helpful?

Solution

It sounds like you want the IISico property to be set to "WrongClick" when ASP.NET is not enabled. If so your condition should look more like:

<SetProperty Id="IISico" Value="WrongClick" After="CostFinalize">
    ASPNETENABLED AND (IISMAJORVERSION = "#6" OR IISMAJORVERSION = "#7")
</SetProperty>

That condition says, "Run the SetProperty custom action if ASPNETENABLED is defined (aka: not an empty string) and that IISMAJORVERSION is either #6 or #7."

I don't know why you included Installed in the condition originally. It would make the WrongClick set any time that the package was already installed. That doesn't sound like what you described.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top