2016-04-14 70 views
2

我有维克斯安装程序,并增加了一个单选按钮组到我的TargetFolder选择-对话框:维克斯 - 功能 - 条件不工作

<Property Id="INSTALLATION_TYPE" Secure="yes" Value="Server"/> 
    <RadioButtonGroup Property="INSTALLATION_TYPE"> 
    <RadioButton Height="17" Text="Client" Value="Client" Width="342" X="0" Y="0" /> 
    <RadioButton Height="17" Text="Server" Value="Server" Width="342" X="0" Y="18" /> 
    </RadioButtonGroup> 

当服务器和客户端之间的切换,下面的输出打印到在MSI-日志文件:

MSI (c) (04:B4) [17:17:56:295]: PROPERTY CHANGE: Modifying INSTALLATION_TYPE property. Its current value is 'Server'. Its new value: 'Client'. 

我的特点,表锁状如下:

<PropertyRef Id="INSTALLATION_TYPE"/> 
    <Feature Id="CommonFeature" Level="1" Title="Common Feature"> 
    <ComponentGroupRef Id="Common"/> 
    <ComponentGroupRef Id="RegistryKeys"/> 

    <Feature Id="FeatureServer" Title="Server" Level="2"> 
     <Condition Level="1"><![CDATA[INSTALLATION_TYPE="Server"]]></Condition> 
     <ComponentGroupRef Id="Server"/> 
     <ComponentGroupRef Id="AdminConsole"/> 
    </Feature> 

    <Feature Id="FeatureClient" Title="Client" Level="2"> 
     <Condition Level="1"><![CDATA[INSTALLATION_TYPE="Client"]]></Condition> 
     <ComponentGroupRef Id="Client"/> 
    </Feature> 
    </Feature> 

但Feature客户和“服务器”在选择RadioButton“Client”时从不安装。功能服务器始终安装。日志文件说如下:

MSI (s) (DC:5C) [17:18:35:750]: Feature: FeatureServer; Installed: Absent; Request: Null; Action: Null 
MSI (s) (DC:5C) [17:18:35:753]: Feature: FeatureClient; Installed: Absent; Request: Null; Action: Null 
MSI (s) (DC:5C) [17:18:35:755]: Feature: CommonFeature; Installed: Absent; Request: Local; Action: Local 

我做错了什么?

回答

0

尝试在安装程序的<产品>部分中定义INSTALLATION_TYPE。

我认为正在发生的事情是您只在安装的客户端(UI)中定义INSTALLATION_TYPE属性,即使它被标记为安全。

在日志的小片段,我们可以看到

MSI(c)中

这表明记录的该部分的安装UI部分期间发生。而,

MSI(S)

表示此日志记录的安装服务器(升高的)部分期间发生。

在安装文件的末尾,你可能有一堆像这样开头

属性(S)

所有属性线(S)是什么抬高部分的安装有权访问。我打赌INSTALLATION_TYPE没有在(S)属性中列出,并且您只在技术上将其定义为安装的UI(客户端)部分。这可以解释为什么您的客户端或服务器功能都未安装。

此外,当使用默认情况下“不安装”的有条件安装的功能时,您需要在打开它们的情况下添加“OR Installed”。

当我编写一些安装程序时,我有一些默认的功能,如果我安装了它们,在卸载或升级过程中(我记不清哪些)会导致安装程序无法正确完全卸载。这使机器处于安装程序无法工作的怪异状态。将“OR已安装”条件添加到功能启用条件为我解决了这个问题。