Yuo could create custom errors like this:
<Error Id="2000">This is my error message</Error>
and create a custom action to trigger it like this:
<CustomAction Id="MyError" Error="2000" />

You can call this in the InstallExecuteSequence like this:
<Custom Action="MyError">NOT WANTED_CONDITION </Custom>

The additional problem is how do you stop them triggering if the UI ran?
You can create another CA like this:
<CustomAction Id="setUI_RAN" Property="UI_RAN" Value="1" />
and schedule it at some point in the InstallUISequence (as long as it's before 
ExecuteAction). 
There's no need to declare the UI_RAN property; it will be created when the CA 
is run.  The 
condition on your CA would then be something like:
<Custom Action="MyError">NOT WANTED_CONDITION AND NOT UI_RAN</Custom>

Rob



Mailinglist wrote:
> Hi WiX-Users,
> 
>  
> 
> in our Setup we use a personalized GUI, that checks in its first dialog 
> several conditions and shows messages, if one condition fails. Most of 
> this conditions handle previously needed software, like “MMC 3.0” and 
> “Powershell 1.0”.
> 
>  
> 
> This just works fine for us, but if the install is done with “/quiet” 
> parameter, those checks won’t ever be run, since the dialog is not 
> initialized anyway. So I tried of checking those conditions in the 
> product itself, which works, but even while install with gui the 
> messages pop up from the msi and not in our gui. How can I trigger the 
> conditions to only be checked if the installation is done in quiet mode?
> 
>  
> 
> Snippet of the project itself:
> 
>  
> 
>             <!-- Launch conditions -->
> 
>             <Condition Message='You have to be a local administrator to 
> install $(var.AppName).'>
> 
>                   Privileged
> 
>             </Condition>
> 
>             <Condition Message="Windows XP or Windows Server 2003 or 
> later is required.">
> 
>                   <![CDATA[VersionNT >= 501]]>
> 
>             </Condition>
> 
>             <Condition Message='This setup requires the .NET Framework 
> 2.0 or higher.'>
> 
>                   <![CDATA[MsiNetAssemblySupport >= "2.0.50727"]]>
> 
>             </Condition>
> 
>             <Condition Message="Microsoft SQL Server 2005 or SQL Server 
> Express have to be present for this version to be installed.">
> 
>                   <![CDATA[ NOT(VERSIONFULLSQL) AND 
> NOT(VERSIONEXPRESSSQL) ]]>
> 
>             </Condition>
> 
>             <Condition Message='This setup requires the Microsoft 
> Management Console 3.0 or higher.'>
> 
>                   <![CDATA[NOT(MMC3) AND NOT(VersionNT >= 600)]]>
> 
>             </Condition>
> 
>             <Condition Message='This setup requires the Microsoft 
> Powershell v1.0 or higher.'>
> 
>                   <![CDATA[NOT (POWERSHELL)]]>
> 
>             </Condition>
> 
>  
> 
> Snippet of the GUI with its conditions:
> 
>  
> 
> <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" 
> Height="17" Default="yes" Text="!(loc.WixUINext)">
> 
>                   <Publish Event="NewDialog" 
> Value="[WixUI_WelcomeDlg_Next]">1</Publish>
> 
>  
> 
>                   <Condition Action="disable">
> 
>                         <![CDATA[ ((VersionNT < 502) OR (VersionNT = 502 
> AND NOT(ServicePackLevel >= 1))) ]]>
> 
>                   </Condition>
> 
>                   <Condition Action="disable">
> 
>                         <![CDATA[ NOT(VERSIONFULLSQL) AND 
> NOT(VERSIONEXPRESSSQL) ]]>
> 
>                   </Condition>
> 
>                   <Condition Action="disable">
> 
>                         <![CDATA[NOT(MMC3) AND NOT(VersionNT >= 600) ]]>
> 
>                   </Condition>
> 
>                   <Condition Action="disable">
> 
>                         <![CDATA[NOT POWERSHELL]]>
> 
>                   </Condition>
> 
>                   <Condition Action="enable">
> 
>                         <![CDATA[ ALLOWSERVER
> 
> AND (VERSIONFULLSQL OR VERSIONEXPRESSSQL)
> 
> AND (MMC3 OR (VersionNT >= 600))
> 
> AND (POWERSHELL)
> 
> AND NOT((VersionNT < 502) OR (VersionNT = 502 AND NOT(ServicePackLevel 
>  >= 1)))
> 
> ]]>
> 
>                   </Condition>
> 
>  
> 
>                   <Publish Property="IDIR" 
> Value="[NEWINSTALLDIR]Aldi-Ews\">MSSERVER</Publish>
> 
>  
> 
>                   <Publish Property="WixUI_InstallMode" 
> Value="InstallComplete"></Publish>
> 
>             </Control>
> 
>  
> 
>  
> 
> Any hints welcome.
> 
>  
> 
>  
> 
> */Oliver Friedrich/*
> 
> /Consultant - Software Solutions/
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to