2013-08-29 83 views
0

在继续我的安装之前,我需要检查是否安装了.NET 4.5版。这是我的.wxs文件。我已将propertyref和condition放置在标记下。为什么这个检查不起作用?检查在WiX安装程序中安装的.NET?在哪里放置条件?

即使目标系统上不存在.NET 4.5,安装仍然继续。

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 
    <Product Id="*" 
      Name="SolidFire Hardware Provider" 
      Language="1033" 
      Version="1.0.0.0" 
      Manufacturer="SolidFire" 
      UpgradeCode="0c60967f-f184-4b8b-a96a-b1caa4a8879e"> 
     <Package InstallerVersion="200" 
       Compressed="yes" 
       InstallScope="perMachine" /> 
     <!--Media Id='2' Cabinet='provider.cab' EmbedCab='yes'/--> 
     <PropertyRef Id="NETFRAMEWORK45"/> 

     <Condition Message="This application requires .NET Framework 4.5. Please install the .NET Framework then run this installer again."> 
      <![CDATA[Installed OR NETFRAMEWORK45]]> 
     </Condition> 

     <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> 
     <MediaTemplate EmbedCab='yes'/> 

     <Feature Id="ProductFeature" Title="InstallProvider" Level="1"> 
      <ComponentGroupRef Id="ProductComponents" /> 
     </Feature> 
     <!-- IRef Id="WixUI_Minimal"/--> 

     <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" ></Property> 
     <!--Property WixUIDialogBmp = "logo.bmp"></Property--> 
     <UIRef Id="WixUI_InstallDir"/> 

     <InstallExecuteSequence> 
      <Custom Action="RunInstallScript" After="InstallFiles" >NOT Installed</Custom> 
     </InstallExecuteSequence> 
     <InstallExecuteSequence> 
      <Custom Action='BeforeUninstall' Before='RemoveFiles'>REMOVE="ALL"</Custom> 
     </InstallExecuteSequence> 
     <CustomAction Id="RunInstallScript" 
         ExeCommand="cmd /c install-solidfireprovider.cmd" 
         Directory="INSTALLFOLDER" 
         Execute="deferred" 
         Return="check"/> 
     <CustomAction Id="BeforeUninstall" 
         ExeCommand="cmd /c uninstall-solidfireprovider.cmd" 
         Directory="INSTALLFOLDER" 
         Execute="deferred" 
         Return="check"/> 
    </Product> 

    <Fragment> 
     <Directory Id="TARGETDIR" Name="SourceDir"> 
      <Directory Id="ProgramFilesFolder"> 
       <Directory Id="INSTALLFOLDER" Name="solidfireinstall" /> 
      </Directory> 
     </Directory> 
    </Fragment> 

    <Fragment> 
     <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> 
      <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. --> 
      <Component Id="ProductComponent"> 
       <!-- TODO: Insert files, registry keys, and other resources here. --> 
       <File Id="restinterfacedll.dll" 
         Source="..\vssprovider\x64\$(var.build)\RESTInterfacedll.dll"></File> 
      </Component> 

      <Component Id="vssdll"> 
       <File Id="vsssolidfireprovider.dll" 
        Source="..\vssprovider\x64\$(var.build)\vsssolidfireprovider.dll"></File> 
      </Component> 

      <Component Id="installscript"> 
       <File Id="installscript" 
        Source="install-solidfireprovider.cmd"></File> 
      </Component> 

      <Component Id="uninstallscript"> 
       <File Id="uninstallscript" 
        Source="uninstall-solidfireprovider.cmd"></File> 
      </Component> 

      <Component Id="registerprovider"> 
       <File Id="registerprovider" 
        Source="register_app.vbs"></File> 
      </Component> 

      <Component Id="vshadow"> 
       <File Id="vshadow" 
        Source="vshadow.exe"></File> 
      </Component> 
     </ComponentGroup> 
    </Fragment> 
</Wix> 

回答

0

这看起来不错,所以你可能还需要:

“呼吁light.exe时包括在MSI联过程中WixNetfxExtension添加-ext命令行参数”

相关问题