How to create a Wix Exepackage that only has a download link

隐身守侯 提交于 2019-12-03 06:48:10

If you set up your bundle to Compressed=no it will not include the source file in your final bundle. The reason you're getting the "File not found" is because when the installer is built, it requires a local version of the package EXE file in order to get information from it. If you want to build a project which only has a download URL, you need to specify a RemotePayload element, and supply some more defining information about the remote package.

This will allow you to build the install package without having to have the source file on the machine, but you'll need to be sure your payload is accurately described or your install will fail.

On your ExePackage element, be sure you include the Name attribute, which is one of the required attributes next to SourceFile, but SourceFile is not allowed with RemotePayload. Your example includes it, so you should be OK there.

Include the <RemotePayload> element as a child of ExePackage like so:

<RemotePayload Description="MyRemoteApp" ProductName="MyProductName" Size="size-in-bytes" Version="1.1.1.1" Hash="SHA-1-checksum-here"/>

Where all of the information required are attributes of your specific package. If this is not an option, you will need to make sure the source file is available locally at build-time, but ensure that it is not compressed, so the user can install and the payload will be downloaded from your URL.

See the RemotePayload reference for more info.

RyanJ's answer is great. It got me off square one after failing to find the right magic combo on my own. But it still took me some trial and error to create a bundle wxs file that actually worked. So, for the record, if you create a new bundle project in Visual Studio and then replace the bundle.wxs contents with:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle 
Name="BundleExperiment" 
Version="1.0.0.0" 
Manufacturer="Windows User" 
UpgradeCode="UNIQUE-GUID-GOES-HERE-YADADADA"
Compressed="no">

    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />

<Chain>
  <ExePackage Id="DymoLabelSoftware"
       SourceFile="DLS8Setup.8.5.1.exe"
       DownloadUrl="http://download.dymo.com/dymo/Software/Win/DLS8Setup.8.5.1.exe" />
</Chain>
</Bundle>

you can see how this works and then modify it to work with whatever exe package you are trying to bundle.*

It was really counterintuitive to me that you needed to specify values for SourceFile AND DownloadUrl AND still have a copy of the downloaded file in your project directory. Actually, it was more than counterintuitive. I was certain that NOT having the downloaded file in my project directory was how I told Burn to omit the file from the package. But here's how I now understand it:

  • 'Compressed="no"' -- tells Burn to not embed the exe in the bundled installer it is building
  • 'SourceFile="DLS8Setup.8.5.1.exe"' -- tells Burn to go out to the project directory and use the downloaded, local copy of the target package to generate all of the info you would otherwise have to figure out and put in your RemotePayload record
  • 'DownloadUrl=...' -- is the one part that seemed obvious to me from the start

*"With whatever exe you are trying to bundle" disclaimer: I originally tried, really hard, to use a Git Windows installer package for this example. And, using exactly the same syntax (and correct names and paths, really!), the bundled install always failed with an access error and a message something like 'failed to acquire the payload' in the log file. The only thing odd about the Git download that I noticed was that it wasn't really coming from the URL I was using but was redirecting the download to come from somewhere in the Amazon S3 cloud. My guess is that Burn / WIX / Windows Installer may object to that sleight of hand -- and kind of reasonably so. Hence, depending on what installer you want to bundle, you might have to give it a fixed URL under your own control to make it work with this feature.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!