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

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

问题描述

我正在尝试在我的包中创建一个 ExePackage [使用 DownloadUrl 属性],它下载 Sql Express 2014 并使用以下代码安装它

<ExePackage Id="Sql2014Express"DisplayName="SQL Server 2014 速成版"缓存="否"压缩=否"PerMachine="是"永久=否"生命=是"名称="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=安装/INSTANCENAME=$(var.InstanceName)/FEATURES=SQL/SECURITYMODE=SQL [SqlVariable]/TCPENABLED=1/SQLSVCACCOUNT=&quot;NT AUTHORITYNETWORK SERVICE&quot;/SQLSVCSTARTUPTYPE=Auto/SQLSYSADMINACCOUNTS=BUILTINAdministrators/ADDCURRENTUSERASSQLADMIN=FALSE/Q/HIDECONSOLE/SkipRules=RebootRequiredCheck/IAcceptSQLServerLicenseTerms"UninstallCommand="/Action=卸载/INSTANCENAME=$(var.InstanceName)/FEATURES=SQL/Q/HIDECONSOLE"DetectCondition="SqlInstanceFound"InstallCondition="$(var.ServerInstall)"><退出代码值=3010"行为=强制重启"/></ExePackage>

当我尝试构建安装程序包时,我收到以下错误....

错误 2 系统找不到文件'SourceDirSQLEXPRWT_x64_ENU.exe'.

我可以将 SourceFile 属性设置为本地文件并将其包含在我的安装中,但我希望不必使用我的安装程序来移动 800mb+ 的文件.

解决方案

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

这将允许您构建安装包,而不必在计算机上拥有源文件,但您需要确保准确描述您的有效负载,否则您的安装将失败.

在您的 ExePackage 元素上,确保包含 Name 属性,这是 SourceFile 旁边的必需属性之一,但 <RemotePayload 不允许使用 code>SourceFile.你的例子包括它,所以你应该没问题.

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

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

所需的所有信息都是您的特定包裹的属性.如果这不是一个选项,您将需要确保源文件在构建时在本地可用,但确保它没有被压缩,以便用户可以安装并且有效负载将从您的 URL 下载.

有关详细信息,请参阅 RemotePayload 参考.p>

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 AUTHORITYNETWORK SERVICE&quot; /SQLSVCSTARTUPTYPE=Auto /SQLSYSADMINACCOUNTS=BUILTINAdministrators /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 'SourceDirSQLEXPRWT_x64_ENU.exe'.  

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.

解决方案

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.

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

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