如何确保在使用WiX显示UI后运行FindRelatedProducts?
我有一个MSI安装程序,我在安装程序UI中指定了每台机器的安装.每台机器也安装了以前的版本.
但是,FindRelatedProducts报告当前安装是按用户. MSI(c)(A4:F0)[13:33:20:490]:FindRelatedProducts:**当前安装是按用户**.产品’<< my guid>>’的相关安装是每台机器.跳绳… 从日志中我可以看到,只有在FindRelatedProducts运行后才会创建ALLUSERS属性(注意时间戳): MSI(c)(A4:A8)[13:33:25:032]:属性更改:添加ALLUSERS属性.它的值是’2′. ALLUSERS属性是根据用户选择的内容从UI发布的: <Publish Property="ALLUSERS" Value="2"><![CDATA[FolderForm_AllUsers="ALL" AND VersionNT>=400 AND Privileged=1 AND FolderForm_AllUsersVisible=1]]></Publish> <Publish Property="ALLUSERS" Value="{}"><![CDATA[FolderForm_AllUsers="ME" AND VersionNT>=400 AND Privileged=1 AND FolderForm_AllUsersVisible=1]]></Publish> <Control Id="AllUsersRadioGroup" Type="RadioButtonGroup" X="20" Y="175" Width="342" Height="42" Property="FolderForm_AllUsers" Text ="empty"> <RadioButtonGroup Property="FolderForm_AllUsers"> <RadioButton Value="ALL" X="0" Y="0" Width="342" Height="17" Text="$(loc.InstallForAll)" /> <RadioButton Value="ME" X="0" Y="18" Width="342" Height="17" Text="$(loc.InstallForMe)" /> </RadioButtonGroup> <Condition Action="show"><![CDATA[VersionNT>=400 AND Privileged=1 AND FolderForm_AllUsersVisible=1]]></Condition> <Condition Action="hide"><![CDATA[NOT (VersionNT>=400 AND Privileged=1 AND FolderForm_AllUsersVisible=1)]]></Condition> </Control> 因此,新版本与现有版本一起安装(添加/删除程序中存在两个条目). <InstallUISequence> <Custom Action="VSDCA_FolderForm_AllUsers" After="IsolateComponents"><![CDATA[Installed="" AND NOT RESUME AND ALLUSERS=1]]></Custom> <Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom> </InstallUISequence> <InstallExecuteSequence> <!-- Only schedule this custom action for the 32-bit MSI. --> <?if $(var.DependenciesPlatform)=x86 ?> <Custom Action="CA_Err32BitMsiOn64BitOS" After="LaunchConditions"> <![CDATA[MsiAMD64 OR Intel64]]> </Custom> <?endif ?> <!-- Prevent downgrading --> <Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom> <RemoveExistingProducts Before="InstallInitialize" /> <Custom Action="LaunchApp" After="InstallFinalize" /> <InstallInitialize></InstallInitialize> <RemoveShortcuts></RemoveShortcuts> <InstallFiles></InstallFiles> <CreateShortcuts></CreateShortcuts> <InstallFinalize></InstallFinalize> <ScheduleReboot After="InstallFinalize"/> </InstallExecuteSequence> 只有在每台机器上安装了两个版本的应用程序时才会出现这种情况,因为FindRelatedProducts显然假定每个用户安装(因为它在用户能够选择其中一个单选按钮之前运行,因此没有设置ALLUSERS属性它运行的时间). 如何确保只有在用户指定的UI中发布ALLUSERS后才执行FindRelatedProducts? 解决方法
我发现我需要添加以下内容以确保在用户做出选择后在UI中运行FindRelatedProducts:
<Publish Event="DoAction" Value="FindRelatedProducts">1</Publish> 从https://www.mail-archive.com/wix-users@lists.sourceforge.net/msg22960.html起 我发现使用suppress属性并不是非常需要 – 它似乎也可以在没有明确抑制InstallUISequence中的操作的情况下工作. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |