我正在为我的公司更新一个程序,该程序要求用户在其计算机上安装 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.
发布评论
评论(2)
您没有提到您正在使用什么设置创作工具。
检查 SQL Server 2005 作为启动条件的一般方法是:
创建一个 注册表搜索此条目:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90\Tools\ClientSetup\CurrentVersion
使用搜索属性作为自定义 启动条件
例如,如果搜索属性为 SQL_SERVER_2005_SEARCH,则可以使用此启动条件:
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
For example, if the search property is SQL_SERVER_2005_SEARCH, you can use this launch condition:
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.
这些可能有帮助:
http://msdn.microsoft.com/en- us/library/bb264562(v=sql.90).aspx
http://community.flexerasoftware.com/showthread.php?t=155357
May these help:
http://msdn.microsoft.com/en-us/library/bb264562(v=sql.90).aspx
http://community.flexerasoftware.com/showthread.php?t=155357