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

I am trying to create an ExePackage [using the DownloadUrl property] in my package that downloads Sql Express 2014 and installs it using the following code

<ExePackage Id="Sql2014Express" DisplayName="SQL Server 2014 Express" Cache="no" Compressed="no" PerMachine="yes" Permanent="no" Vital="yes" Name="SQLEXPRWT_x64_ENU.exe" DownloadUrl="http://download.microsoft.com/download/E/A/E/EAE6F7FC-767A-4038-A954-49B8B05D04EB/ExpressAndTools%2064BIT/SQLEXPRWT_x64_ENU.exe" InstallCommand="/ACTION=Install /INSTANCENAME=$(var.InstanceName) /FEATURES=SQL /SECURITYMODE=SQL [SqlVariable] /TCPENABLED=1 /SQLSVCACCOUNT=&quot;NT AUTHORITY\NETWORK SERVICE&quot; /SQLSVCSTARTUPTYPE=Auto /SQLSYSADMINACCOUNTS=BUILTIN\Administrators /ADDCURRENTUSERASSQLADMIN=FALSE /Q /HIDECONSOLE /SkipRules=RebootRequiredCheck /IAcceptSQLServerLicenseTerms" UninstallCommand="/Action=Uninstall /INSTANCENAME=$(var.InstanceName) /FEATURES=SQL /Q /HIDECONSOLE" DetectCondition="SqlInstanceFound" InstallCondition="$(var.ServerInstall)"> <ExitCode Value ="3010" Behavior="forceReboot" /> </ExePackage> 

When I try to create an installer package, I get the following error ....

 Error 2 The system cannot find the file 'SourceDir\SQLEXPRWT_x64_ENU.exe'. 

I can set the SourceFile property to a local file and include it in my installation, but I would prefer not to move the 800mb + file using my installer.

+8
wix burn
source share
2 answers

If you configure your package to Compressed=no , it will not include the source file in your last package. The reason you get "File not found" is because when the installer is built, a local version of the package's .exe file is required to get information from it. If you want to create a project that has only the download URL, you need to specify the RemotePayload element and provide additional information about the remote package.

This will allow you to create the installation package without having to have the source file on your computer, but you need to be sure that your payload is accurately described or your installation failed.

In the ExePackage element ExePackage make sure that you include the Name attribute, which is one of the required attributes next to the SourceFile , but the SourceFile not allowed using RemotePayload . Your example includes it, so you should be fine.

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

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

All the necessary information is an attribute of your specific package. If this is not an option, you need to make sure that the source file is available locally at build time, but make sure it is not compressed, so the user can install and download the payload from your URL.

See RemotePayload for details .

+12
source share

RyanJ's answer is great. This made me abandon the square after I could not find a suitable magic combination on my own. But it still took me some trial and error to create a wxs batch file that really worked. So, for the record, if you are creating a new package project in Visual Studio, then replace the contents of bundle.wxs as follows:

 <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 it works and then change it to work with any exe package you are trying to bundle. *

I was completely uninterested that you had to specify the values ​​for SourceFile AND DownloadUrl and still have a copy of the downloaded file in the project directory. In fact, it was not just illogical. I was sure that NOT having a downloaded file in my project directory is how I told Burn to omit the file from the package. But here is how I understand it now:

  • 'Compressed = "no" - indicates Burn, so as not to embed exe in the associated installer it builds
  • 'SourceFile = "DLS8Setup.8.5.1.exe" - tells the Record to go to the project directory and use the downloaded, local copy of the target package to generate all the information that you otherwise need to find out and insert the RemotePayload record
  • 'DownloadUrl = ...' is the part that seemed obvious to me from the very beginning.

* "With any exe you are trying to associate a" disclaimer ": initially I tried to really use the Windows Git installer package for this example. And, using exactly the same syntax (and the correct names and paths, really!), The linked installation is always failed with an access error and a message like “could not get the payload” in the log file. The only thing that was strange in the Git download that I noticed was that it wasn’t actually from the URL that I used, but redirected the download from somewhere o from Amazon S3 Cloud. I assume that the Burn / WIX / Windows Installer may object to this sleight of hand - and in part is reasonable. Therefore, depending on which installer you want to bind, you may need to provide a fixed URL under his own control, so that he works with this function.

+3
source share

All Articles