Wix ';记住财产';模式和RadioButtonGroup中使用的属性

Wix ';记住财产';模式和RadioButtonGroup中使用的属性,wix,Wix,我试图在安装期间将属性值保存在注册表中,并在下次运行安装时读取它。 我遵循所描述的“记住属性”模式 它基本上按照预期工作,但我无法让一个场景正常工作: 我运行安装程序(属性存储在注册表中) 我再次运行安装程序,但没有在命令行中输入属性值 我希望从注册表中读取属性值,但它被指定为默认值 我想,我知道问题出在哪里:我为属性指定了“值”,而我上面提到的示例声明的是“记住的”属性,没有“值”。在我的包中,我必须定义这个值,因为我将UI元素中的属性与RadioButtonGroup一起使用。如果我没有

我试图在安装期间将属性值保存在注册表中,并在下次运行安装时读取它。 我遵循所描述的“记住属性”模式

它基本上按照预期工作,但我无法让一个场景正常工作:

  • 我运行安装程序(属性存储在注册表中)
  • 我再次运行安装程序,但没有在命令行中输入属性值
  • 我希望从注册表中读取属性值,但它被指定为默认值
我想,我知道问题出在哪里:我为属性指定了“值”,而我上面提到的示例声明的是“记住的”属性,没有“值”。在我的包中,我必须定义这个值,因为我将UI元素中的属性与RadioButtonGroup一起使用。如果我没有声明属性的值字段,则会出现编译错误:

 error LGHT0204 : ICE34: Property LOCATION (of RadioButtonGroup control LocationSelection.InstallationLocation) is not defined in the Property Table.

有人能给我一个如何管理它的提示吗?

这是解决方案草案:

填充属性的自定义操作

<CustomAction Id='SaveCmdLineValueLocation' Property='CMDLINE_LOCATION'
              Value='[LOCATION]' Execute='firstSequence' />
<CustomAction Id='SetFromCmdLineValueLocation' Property="EFFECTIVE_LOCATION"
              Value='[CMDLINE_LOCATION]' Execute='firstSequence' />
<CustomAction Id='SetFromRegValueLocation' Property="EFFECTIVE_LOCATION"
              Value='[REG_LOCATION]' Execute='firstSequence' />

从注册表或msiexec命令行分配有效位置的执行序列:

<InstallExecuteSequence>
      <Custom Action='SaveCmdLineValueLocation' Before='AppSearch'>
        LOCATION
      </Custom>      
      <Custom Action='SetFromCmdLineValueLocation' After='AppSearch'>
        CMDLINE_LOCATION
      </Custom>
      <Custom Action='SetFromRegValueLocation' After='AppSearch'>
        REG_LOCATION AND (NOT CMDLINE_LOCATION)
      </Custom>
</InstallExecuteSequence>

位置
CMDLINE_位置
注册位置和(非CMDLINE位置)
物业声明:

<!-- Property used on command-line. -->
<Property Id="LOCATION" Secure="yes">
</Property>

<!-- Property used finally with ReadioButtonGroup. It must have Value assigned (required when used with RadioButtonGroup -->
<Property Id="EFFECTIVE_LOCATION" Value="OFFICE" Secure="yes">
</Property>

<!-- Read previous value from registy (from recent installation) -->
<Property Id="REG_LOCATION" Secure="yes">
  <RegistrySearch Id="loc" Root="HKLM" Key="SOFTWARE\Company\Product" Type="raw" Name="LOCATION"  Win64='yes'>
  </RegistrySearch>
</Property>


您应该发布您的代码。如果您确实声明了属性,那么它将位于属性表中。看来你可能是不知何故错报了。我用'Value=“something”'声明了属性-然后包按照预期编译和工作(我询问的问题除外)。从属性声明中删除值标记就足够了:您将得到ICE34。我猜为属性赋值是与RadioButtonGroup一起使用时必须的。这打破了读取默认值。好的-我最终用3个属性解决了它:一个用于从注册表读取/存储永久值,第二个用于在静默安装期间从命令行获取值,第三个是“有效”值,与RadioButtonGroup一起使用。前两个属性没有指定默认值,而“有效”属性有指定默认值。然后,使用CustomActions,我可以根据命令行和注册表中的值来指定“effective”属性。谢谢。