如何设置将要安装的功能列表,如果按钮被按下?(How to set the list of feat

2019-09-20 12:42发布

我'使用WixUI_Mondo集。 我修改了“CompleteButton”按钮SetupTypeDlg

<Control Id="ServerButton" Type="PushButton" X="40" Y="120" Width="80" Height="17" ToolTip="!(loc.SetupTypeDlgServerButtonTooltip)" Text="!(loc.SetupTypeDlgServerButton)">
   <Publish Property="WixUI_InstallMode" Value="InstallServer">1</Publish>                  
   <Publish Property="SERVICE" Value="[SERVSTR]">1</Publish>
   <Publish Property="ADDLOCAL" Value="Feature1,Feature2,Feature3">1</Publish>
</Control>

<Property Id="ADDLOCAL" Secure="yes"></Property>

当我推ServerButton日志说:

(CLIENT)     MSI (c) (1C:88) [15:28:49:154]: PROPERTY CHANGE: Adding ADDLOCAL property. Its value is 'Feature1,Feature2,Feature3'. 
(UNKNOWN)     Действие 15:28:49: ServStrDlg. Dialog created 
(UNKNOWN)     Действие 15:28:53: ShortsDlg. Dialog created 
(UNKNOWN)     Действие 15:28:55: VerifyReadyDlg. Dialog created 
(CLIENT)     MSI (c) (1C:88) [15:28:55:966]: Note: 1: 2727 2: 
(UNKNOWN)     Действие закончено 15:28:56: WelcomeDlg. Код возврата 1. 
(CLIENT)     MSI (c) (1C:DC) [15:28:56:076]: Doing action: ProgressDlg 
(UNKNOWN)     Действие 15:28:56: ProgressDlg. 
(UNKNOWN)     Начало действия 15:28:56: ProgressDlg. 
(UNKNOWN)     Действие 15:28:56: ProgressDlg. Dialog created 
(UNKNOWN)     Действие закончено 15:28:56: ProgressDlg. Код возврата 1. 
(CLIENT)     MSI (c) (1C:DC) [15:28:56:091]: Doing action: ExecuteAction 
(UNKNOWN)     Действие 15:28:56: ExecuteAction. 
(UNKNOWN)     Начало действия 15:28:56: ExecuteAction. 
(CLIENT)     MSI (c) (1C:DC) [15:28:56:091]: PROPERTY CHANGE: Adding SECONDSEQUENCE property. Its value is '1'. 
(CLIENT)     MSI (c) (1C:DC) [15:28:56:091]: Grabbed execution mutex. 
(CLIENT)     MSI (c) (1C:DC) [15:28:56:091]: Incrementing counter to disable shutdown. Counter after increment: 0 
(CLIENT)     MSI (c) (1C:DC) [15:28:56:091]: Switching to server: NETFRAMEWORK40CLIENT="#1"INSTALLLOCATION="some dir" TARGETDIR="C:\"
 MANUFACTURERDIR="C:\Program Files\..\" CURRENTDIRECTORY="C:\.." CLIENTUILEVEL="0" CLIENTPROCESSID="6684" USERNAME="User" COMPANYNAME=".."
 SOURCEDIR=".." ACTION="INSTALL" EXECUTEACTION="INSTALL" SECONDSEQUENCE="1" ROOTDRIVE="C:\" INSTALLLEVEL="1" ADDLOCAL=Feature4,Feature5,Feature6 

特征1,特征2,特征水平超过3想不通为什么它传递INSTALLLEVEL="1"

UPD:

我做了下一个变化,结果是一样的。 安装程序在客户端修改INSTALLLEVEL的值,ADDLOCAL属性。 于服务器端:INSTALLLEVEL = 11,ADDLOCAL由与“级别”属性<= 11的功能。

<Control Id="ServerButton" Type="PushButton" X="40" Y="120" Width="80" Height="17" ToolTip="!(loc.SetupTypeDlgServerButtonTooltip)" Text="!(loc.SetupTypeDlgServerButton)">
   <Publish Property="WixUI_InstallMode" Value="InstallServer">1</Publish> 
   <Publish Event="SetInstallLevel" Value="11">1</Publish>                 
   <Publish Property="SERVICE" Value="[SERVSTR]">1</Publish>
   <Publish Property="ADDLOCAL" Value="Feature1,Feature2,Feature3">1</Publish>
</Control>

Answer 1:

我看了这个文章很多次,终于发现:我必须公布Event='AddLocal'不是一个Property感谢的,燕,你的时间非常多。 这里是工作的代码:

<Control Id="ServerButton" Type="PushButton" X="40" Y="120" Width="80" Height="17" ToolTip="!(loc.SetupTypeDlgServerButtonTooltip)" Text="!(loc.SetupTypeDlgServerButton)">
   <Publish Property="WixUI_InstallMode" Value="InstallServer">1</Publish>                  
   <Publish Property="SERVICE" Value="[SERVSTR]">1</Publish>
   <Publish Event="AddLocal" Value="ALL">1</Publish>
   <Publish Event="Remove" Value="Feature4">1</Publish>
   <Publish Event="Remove" Value="Feature5">1</Publish> 
   <Publish Event="Remove" Value="Feature6">1</Publish>
</Control>

并且我增加了一个事件到下一个对话框的“后退”按钮:

<Control Id="Back" Type="PushButton" X="192" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)">
   <Publish Event="SetInstallLevel" Value="3">WixUI_InstallMode="InstallServer"</Publish>
</Control>


Answer 2:

根据MSDN文档 ,由指定的安装水平INSTALLLEVEL性质可通过许多性质,包括覆盖ADDLOCAL 。 因此,据我了解,即使INSTALLLEVEL设置为1 ,它就会被重写ADDLOCAL属性,而不是Windows安装程序考虑。

如果您遇到任何错误或与此相关的错误的行为,添加更多关于它的细节,你的问题。



文章来源: How to set the list of features which will be installed if the button was pushed?
标签: wix