如何确保目标计算机上安装了 SQL Server 2005 Express 或更高版本?如何在安装结束时运行 SQL 查询?

发布于 2024-12-02 06:48:55 字数 437 浏览 2 评论 0 原文

我正在为我的公司更新一个程序,该程序要求用户在其计算机上安装 SQL Server 2005 Express 或更高版本。我们已经随 SQL Server 2008 Express 安装程序的副本提供了它,但如何获取启动条件来检查 2005 或更高版本的任何 SQL Server?

我需要确保安装 SQL 的原因是我正在尝试自动化一个过程,在该过程中我们让用户创建数据库并为某些用户授予该数据库权限。我有人可以帮助我创建自动化流程,但他从来没有为这样的流程做安装包。

我猜想我需要在安装程序的提交阶段添加一个自定义操作来调用 SQL 文件。这是正确的吗?

重申我的问题:如何确保使用 Visual Studio Installer Deloyment 在目标计算机上安装 SQL Server 2005 Express 或更高版本?如何在安装结束时运行 SQL 查询?

感谢您能给我的任何帮助。

I'm updating a program for my company that requires the user to have SQL Server 2005 Express or later installed on to their computer. We already ship it with a copy of the SQL Server 2008 Express installer, but how do I get the launch conditions to check for any SQL Server of 2005 or later?

The reason I need to be sure that SQL is installed is that I'm trying to automate a process where we had the user create a database and give that database permissions for certain users. I have someone who can help me with creating the automation process, but he has never had to do the installation package for such a process.

I'm guessing that I would need to put a custom action to call the SQL file in the Commit phase of the Installer. Is that correct?

To reiterate my questions: How do I make sure SQL Server 2005 Express or later is installed on the target machine with Visual Studio Installer Deloyment? And how do I run an SQL query at the end of an install?

Thank you for any help you can give me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

薄荷梦 2024-12-09 06:48:55

您没有提到您正在使用什么设置创作工具。

检查 SQL Server 2005 作为启动条件的一般方法是:

  • 创建一个 注册表搜索此条目:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90\Tools\ClientSetup\CurrentVersion

  • 使用搜索属性作为自定义 启动条件

  • 搜索属性值应大于或等于“9.0”表示条件为 true

例如,如果搜索属性为 SQL_SERVER_2005_SEARCH,则可以使用此启动条件:

SQL_SERVER_2005_SEARCH >= "9.0"

Windows Installer 不支持 SQL 脚本,因此它们通常通过自定义操作执行。对此没有预定义的支持,因此您很可能需要自己编写自定义操作代码。

大多数商业设置创作工具都内置对启动条件和 SQL 脚本的支持。一些免费工具也可能为他们提供一些东西。

You didn't mention what setup authoring tool you are using.

The general approach for checking SQL Server 2005 as a launch condition is this:

  • create a registry search for this entry:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90\Tools\ClientSetup\CurrentVersion

  • use the search property as a custom launch condition

  • the search property value should be greater than or equal to "9.0" for the condition to be true

For example, if the search property is SQL_SERVER_2005_SEARCH, you can use this launch condition:

SQL_SERVER_2005_SEARCH >= "9.0"

Windows Installer doesn't support SQL scripts, so they are usually executed through custom actions. There is no predefined support for this, so you will most likely need to write the custom action code yourself.

Most commercial setup authoring tools have built-in support for both launch conditions and SQL scripts. Some free tools may also offer something for them.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文