如何创建仅具有下载链接的Wix Exepackage [英] How to create a Wix Exepackage that only has a download link

查看:194
本文介绍了如何创建仅具有下载链接的Wix Exepackage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的捆绑软件中创建一个ExePackage [使用DownloadUrl属性],该捆绑软件下载Sql Express 2014并使用以下代码进行安装

I am trying to create an ExePackage [using the DownloadUrl property] in my bundle 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 and build the installer package I receive the following error....

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

我可以将SourceFile属性设置为本地文件,并在安装中包含该文件,但我不想在安装程序中随处移动超过800mb +的文件.

I can set the SourceFile property to a local file and include that in my install but I would prefer to not have to move around an 800mb+ file with my installer.

推荐答案

如果将捆绑软件设置为Compressed=no,它将不会在最终捆绑软件中包含源文件.您得到找不到文件"的原因是因为在构建安装程序时,它需要软件包EXE文件的本地版本才能从中获取信息.如果要构建仅具有下载URL的项目,则需要指定RemotePayload元素,并提供有关远程软件包的更多定义信息.

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.

ExePackage元素上,请确保包含Name属性,该属性是SourceFile旁边的必需属性之一,但是RemotePayload不允许使用SourceFile.您的示例包括它,因此您应该可以.

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.

<RemotePayload>元素包括为ExePackage的子元素,如下所示:

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"/>

所需的所有信息都是您特定软件包的属性. 如果不这样做,则需要确保在构建时源文件在本地可用,但请确保未压缩该源文件,以便用户安装并从您的URL下载有效负载.

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.

有关更多信息,请参见 RemotePayload 参考.

See the RemotePayload reference for more info.

这篇关于如何创建仅具有下载链接的Wix Exepackage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆