You can do this using properties. Use the Bitmap
control to set the icon.
<Binary Id="RightClick" SourceFile="Resources\Right.jpg" />
<Binary Id="WrongClick" SourceFile="Resources\Wrong.jpg" />
Use SetProperty
or CustomAction
to set the property value based on a condition and pass the value to the Bitmap
control.
<PropertyRef Id="NETFRAMEWORK40FULL" />
<Property Id="NETFramework_Icon" Value="WrongClick" />
<SetProperty Id="NETFramework_Icon" Value="RightClick" After="AppSearch">NETFRAMEWORK40FULL</SetProperty>
In dialog,
<Control Type="Bitmap" Id="NETFramewor40ico" Width="20" Height="20" X="240" Y="70" Text="[NETFramework_Icon]" />
Regarding the second query, disable the next button if any prerequisites are not installed or throw a custom error for silent installation.