【发布时间】:2018-01-30 14:04:44
【问题描述】:
然后我安装我的设置并选中启动我的应用程序的复选框,然后按完成安装程序同时运行两个程序(setup.exe 和打开图片)。是运行setup.exe的方式,然后setup.exe是完成安装运行画面。我的意思是逐个执行操作而不是同时执行所有操作的方式?这是我的 .wxs 代码:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" UpgradeCode="xxxxxxxxxxxxxx" Version="$(var.ProductVersion)" Language="1033" Name="xxxxxx" Manufacturer="xxxx LTD">
<Package InstallerVersion="300" Compressed="yes"/>
<Media Id="1" Cabinet="myapplication.cab" EmbedCab="yes" />
<Property Id="ALLUSERS" Value="2" />
<Property Id="MSIINSTALLPERUSER" Value="1" />
<!-- Step 1: Define the directory structure -->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="InstallFiles" Name="My Application Name">
</Directory>
</Directory>
</Directory>
<UI>
<UIRef Id="WixUI_Mondo" />
<!-- set property and launch the first exe -->
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="PrepareLaunchApplication1">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication1">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
<!-- set property and launch the second exe -->
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="PrepareLaunchApplication2">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication2">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch My Application Name" />
<CustomAction Id="PrepareLaunchApplication1" Property="WixShellExecTarget" Value="[#Setup.exe]" />
<CustomAction Id="LaunchApplication1"
BinaryKey="WixCA"
DllEntry="WixShellExec"
Impersonate="yes"
Return="check"
Execute="immediate"/>
<CustomAction Id="PrepareLaunchApplication2" Property="WixShellExecTarget" Value="[#a.png]" />
<CustomAction Id="LaunchApplication2"
BinaryKey="WixCA"
DllEntry="WixShellExec"
Impersonate="yes"
Return="check"/>
<!-- Step 2: Add files to your installer package -->
<DirectoryRef Id="InstallFiles">
<Component Id="Setup.exe">
<File Id="Setup.exe" KeyPath="yes"
Name="Setup.exe" Source="$(var.AddinFiles)"></File>
</Component>
<Component Id="a.png">
<File Id="a.png" KeyPath="yes"
Name="a.png" Source="$(var.AddinFiles)"></File>
</Component>
</DirectoryRef>
<!-- Step 3: Tell WiX to install the files -->
<Feature Id="MainApplication" Title="Main Application" Level="1">
<ComponentRef Id="Setup.exe" />
<ComponentRef Id="a.png" />
</Feature>
</Product>
</Wix>
【问题讨论】:
标签: wix windows-installer wix3 wix3.6