开发者

How do I make sure SQL Server 2005 Express or later is installed on the target machine? And how do I run an SQL query at the end of an install?

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 d开发者_运维问答atabase 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.


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.


May these help:
http://msdn.microsoft.com/en-us/library/bb264562(v=sql.90).aspx
http://community.flexerasoftware.com/showthread.php?t=155357

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜