installationwixwindows-installerwindows-vistalaunch-condition

wix launchconditions on Windows vista not correct


My App should run on

So I added LaunchConditions to my MSI. Except on Win Vista everything works. On win Vista i get an error that it is not supported. Can you explain what is wrong with my LaunchConditions? Only Vista causes issues...

<!-- Verify not an Unknown OS -->
    <Condition Message="Das Setup wurde noch nicht auf diesem Betriebssystem getestet und wird aus Sicherheitsgründen beendet. Bitte wenden Sie sich an den Support.">
      <![CDATA[VersionNT=501 OR VersionNT=502 OR VersionNT=600 OR VersionNT=601 OR VersionNT=603]]>
    </Condition>
    <!-- Verify Vista SP2 or above -->
    <Condition Message="$(var.ProdName) benötigt mindestens Windows Vista mit installiertem ServicePack 2.">
      <![CDATA[NOT VersionNT=600 OR (WindowsBuild=6002 AND ServicePackLevel >=2)]]>
    </Condition>
    <!-- Verify XP SP3 or above -->
    <Condition Message="$(var.ProdName) benötigt mindestens Windows XP mit installiertem ServicePack 3.">
      <![CDATA[NOT VersionNT=501 OR (WindowsBuild=2600 AND ServicePackLevel >=3)]]>
    </Condition>
    <!-- Verify Windows Server 2003 SP2 or above -->
    <Condition Message="$(var.ProdName) benötigt mindestens Windows Server 2003 mit installiertem ServicePack 2.">
      <![CDATA[NOT VersionNT=502 OR (WindowsBuild=3790 AND ServicePackLevel >=2)]]>
    </Condition>
    <!-- Verify Windows Server 2008 -->
    <Condition Message="$(var.ProdName) benötigt mindestens Windows Server 2008.">
      <![CDATA[NOT VersionNT=600 OR WindowsBuild=6001]]>
    </Condition>
    <!-- Verify Windows Server 2008 R2 -->
    <Condition Message="$(var.ProdName) benötigt mindestens Windows XP mit installiertem ServicePack 3.">
      <![CDATA[NOT VersionNT=601 OR WindowsBuild > 7100]]>
    </Condition>
    <!--Verify Windows 7 SP1 or above-->
    <!--
    <Condition Message="$(var.ProdName) benötigt mindestens Windows 7 mit installiertem ServicePack 1.">
      <![CDATA[Installed OR ((VersionNT = 601) AND ((WindowsBuild > 7100) AND (ServicePackLevel >= 1)))]]>
    </Condition>-->

    <!--Verify Windows 7 SP1 or above-->
    <Condition Message="$(var.ProdName) benötigt mindestens Windows 7 mit installiertem ServicePack 1.">
      <![CDATA[NOT VersionNT=601 OR (WindowsBuild > 7100 AND ServicePackLevel >= 1)]]>
    </Condition>

    <!-- .Net Framework 4.0 wird benötigt -->
    <PropertyRef Id="NETFRAMEWORK40FULL" />
    <Condition Message="$(var.ProdName) benötigt das .NET Framework 4.0 Full.">
      <![CDATA[Installed OR NETFRAMEWORK40FULL]]>
    </Condition>

    <!-- Kein Downgrade erlauben -->
    <Condition Message='Eine aktuellere Version von "$(var.ProdName)" ist bereits installiert. Das Setup wird nun beendet.'>
      <![CDATA[Installed OR NOT NEWER_VERSION_FOUND]]>
    </Condition>

Solution

  • The overall problem with your launch conditions is that they are the wrong way around. A condition has to evaluate to true for the install to proceed. For example, your Server 2008 condition needs changing to be something like VersionNT=600 AND MsiNTProductType>1 so that it a) includes a server check and b) the entire expression evaluates to true if if it's Server 2008 version.

    Similarly, a Vista check should be something like VersionNT=600 AND WindowsBuild=6002 AND MsiNTProductType=1 because a) build alreasy includes SP level and b) the product type means it's not a server and c) the entire expression evaluates to true on a Vista SP2 system.