Wix:在指定位置创建sql server数据库 [英] Wix: create a sql server database at a specified location

查看:33
本文介绍了Wix:在指定位置创建sql server数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 Wix 创建的安装程序.我希望能够指定安装 sql server 的位置.我能想到的一种解决方案是在 CreateDatabase 脚本中放置一个占位符,然后在运行时只需将占位符替换为用户指定的实际路径.

I have an installer created using Wix. I'd like to be able to specify the location where the sql server is installed. One solution I can think of is to put a placeholder in the CreateDatabase script and in the run time just replace the placeholder with the actual path that user specified.

我想知道是否有更好的方法来做到这一点?Wix 是否提供我可以使用的任何东西?

I am wondering if there is any better way to do this? Does Wix provide anything I can use of?

谢谢,

推荐答案

您可以利用标准的 WiX SQL 扩展.例如,SqlString 元素提供了一个选项来指定在安装时执行的 SQL 查询.SqlDatabase 元素提供了一个开箱即用的选项来创建 SQL 数据库.两者都分别接受 @SQL 和 @Server 属性的 Windows Installer 属性.这意味着您可以获取用户输入,将其保存到属性并在 Sql 元素中使用该属性.

You can take advantage of standard WiX SQL extension. For instance, SqlString element provides an option to specify a SQL query to execute at install time. SqlDatabase element gives an out-of-the-box option to create SQL database. Both accept Windows Installer properties for @SQL and @Server attributes respectively. This means that you can get user input, save it to the property and use that property in Sql elements.

这篇关于Wix:在指定位置创建sql server数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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