Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
关于wix条件消息的有线问题_Wix - Fatal编程技术网

关于wix条件消息的有线问题

关于wix条件消息的有线问题,wix,Wix,下面是我的代码 <?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product Id="928a18b3-0f75-4b89-844f-a5699a549011" Name="ExperimentNew" Language="1033" Version="1.0.0.0" Manufacturer="Experimen

下面是我的代码

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="928a18b3-0f75-4b89-844f-a5699a549011" Name="ExperimentNew" Language="1033" Version="1.0.0.0" Manufacturer="Experiment" UpgradeCode="17929f52-f868-4164-96f6-c47b62781041">
        <Package InstallerVersion="200" Compressed="yes" />
    <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />   
    <Property Id="ODPNETINSTALLED" Value="1"></Property>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLLOCATION" Name="Experiment">
          <Component Id ="main_test_file" Guid="{914ED802-82EF-4296-85F2-4095DE0AAC1D}" KeyPath="yes">
            <File Id="file1" Source=".\try.bat"></File>
          </Component>
        </Directory>
      </Directory>
    </Directory>
    <Feature Id="ProductFeature" Title="Experiment" Level="1">
      <ComponentRef Id="main_test_file"/>
      <ComponentGroupRef Id="Product.Generated" />
    </Feature>
    <CustomAction Id ="SetProperty" Property="ODPNETINSTALLED" Value="0"></CustomAction>
    <InstallExecuteSequence>
      <Custom Action="SetProperty" Before="LaunchConditions" ></Custom>
    </InstallExecuteSequence>
    <Condition Message="SHOULD NOT APPEAR"><![CDATA[ODPNETINSTALLED="0"]]></Condition>
    <UI>
      <UIRef Id="WixUI_Minimal" />
    </UI>
    </Product>
</Wix>

我想更改自定义操作“SetProperty”中“ODPNETINSTALLED”的值 因此,我希望不会弹出条件消息。但每次安装开始时都会显示-为什么会这样

我还做了以下修改:

<Property Id="ODPNETINSTALLED" Value="0"></Property> 
<CustomAction Id  ="SetProperty" Property="ODPNETINSTALLED"  Value="1"></CustomAction>


然后,接受许可协议后会显示条件消息。

我不确定我是否完全理解您提到的代码,但我怀疑此特定案例中的问题可能与您希望您的操作运行的顺序有关。您可以在
InstallExecuteSequence
中计划它,但您可能希望它运行得更早
LaunchConditions
操作计划用于
InstallUISequence
InstallExecuteSequence
,因此除了在最小UI中,它首先在InstallUISequence中运行。只要你的行为影响了启动条件,我认为你也应该这样做

因此:

  • 在CA定义中添加
    Execute=“firstSequence”
    属性
  • 将您的操作安排为
    InstallUISequence
    InstallExecuteSequence
旁注:我将更改用于设置属性并检测其是否已设置的逻辑。您可以简单地避免默认设置,而不是将其设置为默认值,然后再更改为所需的值。然后让此CA在需要设置时设置ODPNETINSTALLED属性。所有检查和条件都将验证属性是否已定义,而不是检查特定值。也就是说,不是ODPNETINSTALLED,而是ODPNETINSTALLED 1或其他

希望这有帮助