我的WixInstaller正在安装两个不同的应用程序(编辑和/或查看器)。
安装完成后,用户可以选中一个复选框,查看是否要启动该应用程序。
默认情况下,WixShellExecTarget
属性的值为[#ViewerApp]
。如果用户已安装编辑器,则属性应具有值[#EditorApp]
。但它没有分配。
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<SetProperty Id="WixShellExecTarget" Value="[#EditorApp]" After="InstallExecute" Sequence="execute"><![CDATA[EditorFeature=3]]></SetProperty>
<Property Id="WixShellExecTarget" Value="[#ViewerApp]" />
答案 0 :(得分:0)
这是我的解决方案:
为每个可以/应该启动的应用/功能定义CustomAction
。
<CustomAction Id="SetLaunchApplicationEditor" Property="WixShellExecTarget" Value="[#EditorApp]" />
<CustomAction Id="SetLaunchApplicationViewer" Property="WixShellExecTarget" Value="[#ViewerApp]" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
在安装完成的最后一页上,定义开始
<Control Id="Finish" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Cancel="yes" Text="[ButtonText_Finish]">
<Publish Event="EndDialog" Value="Return">1</Publish>
<Publish Event="DoAction" Value="SetLaunchApplicationViewer"><![CDATA[&ViewerFeature=3]]></Publish>
<Publish Event="DoAction" Value="SetLaunchApplicationEditor"><![CDATA[&EditorFeature=3]]></Publish>
<Publish Event="DoAction" Value="LaunchApplication">LaunchApp = 1</Publish>
</Control>
如果仅安装了Viewer
或Editor
,则启动此应用。如果两者都已安装,则Editor
会启动,因为之后会触发DoAction
。
<Dialog Id="HtExitDialog" Width="370" Height="270" Title="[ProductName] [Setup]" NoMinimize="yes">
<Control Id="Finish" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Cancel="yes" Text="[ButtonText_Finish]">
<Publish Event="EndDialog" Value="Return">1</Publish>
<Publish Event="DoAction" Value="SetLaunchApplicationViewer"><![CDATA[&ViewerFeature=3]]></Publish>
<Publish Event="DoAction" Value="SetLaunchApplicationEditor"><![CDATA[&EditorFeature=3]]></Publish>
<Publish Event="DoAction" Value="LaunchApplication">LaunchApp = 1</Publish>
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Disabled="yes" Text="[ButtonText_Cancel]" />
<Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="[DialogBitmap]" />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Disabled="yes" Text="[ButtonText_Back]" />
<Control Id="Description" Type="Text" X="135" Y="70" Width="220" Height="20" Transparent="yes" NoPrefix="yes">
<Text>Click the Finish button to exit the [Wizard].</Text>
</Control>
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Title" Type="Text" X="135" Y="20" Width="220" Height="60" Transparent="yes" NoPrefix="yes">
<Text>{\VerdanaBold13}Completing the [ProductName] [Wizard]</Text>
</Control>
<Control Type="CheckBox" Id="StartApp" Width="142" Height="17" X="158" Y="120" Text="Launch Application" Property="LaunchApp" CheckBoxValue="1" />
</Dialog>