3

I have written an application that uses a SQL Server database.

I've been using SQL Server Express on my local PC. The app works fine on my PC, so now I'm trying to distribute it.

Most of our customers will be fine with Express on their local machines.

Some of our larger customers may have several employees accessing the same database, so it will need to reside on a server.

How can I make my installer do the following:

  1. Ask the user if they want to use a local or network database.
  2. Search the PC/network for SQLServer running services and allow them to select one.
  3. If not present, install SQL Server Express on their local, or networked machine.

I've read about "custom actions", but they only run after an app's installation has finished, but if I've set SQL Server Express as a "prerequisite", then it gets automatically installed before my custom action gets a chance to run.

I'm using VS2010 (employer requirement), C# / .Net 3.5

Any specific or general advice is appreciated. Am I even using the right approach here?

4

1 回答 1

0

您必须编写一个引导应用程序,在启动安装程序之前检查并在必要时解决 SQL 服务器先决条件。显然,您的引导应用程序将检查注册表中的某些键,但我不知道这些键是什么。其他人将不得不在那里向您提供详细信息。

您的 MSI 应该有一个在安装、修复或升级时运行的自定义操作,用于检查某种形式的 SQL 服务器是否存在,如果不存在,则告诉用户启动 .EXE(您的引导应用程序)和然后退出。或者,如果您不介意一些繁琐的工作来完成它,您可以让您的 MSI 启动 .EXE 而不是在这种情况下显示一个消息框。

于 2013-03-26T16:16:04.340 回答