如何将软件安装过程中genenerate后端数据库? [英] How to genenerate Database backend during Software installation?

查看:189
本文介绍了如何将软件安装过程中genenerate后端数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了一个小应用程序与SQL Server后端,我也做一个安装程序与靛蓝罗斯设置工厂8.0应用程序。我需要的是我想自动创建数据库恢复应用程序的安装过程中使用特定的用户帐户结束。

I have developed a small application with SQL SERVER back end and I also make an installer for the application with Indigo Rose Setup factory 8.0. What I need is I want to automatically create the database back end with specific user account during the installation of the application.

安装程序,用户被要求安装SQL服务器或SQL EX preSS为prerequisite,当安装了数据库软件的安装继续之前。我尝试使用SQL脚本这样做,但我不如何在安装程序安装软件之前做到这一点。我虽然也嵌入数据库创建程序在主应用程序,它会在安装完成后,用户需要执行,但我从来没有尝试过它是否有效与否。

Before the installer a user is asked to install either SQL server or SQL express as prerequisite, when the database is installed the installation of the software continues. I tried to do using SQL script but I don’t how to do it before installation on the installer software. I though also to embed the database creation program in the main application and it will execute on the user need upon the completion of the installation but I have never tried it before whether it works or not.

柜面如果需要我公司开发的系统使用C#与SQL Server 2005后端。 所以,请你给我一些答案来解决这个问题? 谢谢

Incase if it need I developed the system using C# with SQL SERVER 2005 backend. So would you please give me some answer to tackle the problem? Thank you

推荐答案

最简单的方法就是让安装程序调用sqlcmd.exe来运行SQL脚本。要打电话,你需要知道SQL实例的数据源(位置)。您将需要获得从用户。例如,计算机名,计算机名\实例或一般sqlex preSS是计算机名\ SQLEx preSS。

The simplest way would be to have the installer call sqlcmd.exe to run a sql script. To call that, you will need to know the data source (location) of the sql instance. You will need to get that from the user. For example, machinename, machinename\instancename or typically sqlexpress is machinename\SQLExpress.

http://msdn.microsoft.com/en-us/library/ ms165702.aspx

您还可以边踩了pre-REQ和安装sqlex preSS为您的客户。有一个CMDLINE进行安装:

You can also side step the pre-req and install sqlexpress for your customer. There's a cmdline to install it:

http://msdn.microsoft.com/en-us/library/ ms144259.aspx

,无SQL依赖另一种方法是编写自己的自定义操作(命令行/ API),在脚本中GO语句之间的分析和处理ADO.net执行。

Another option with no sql dependencies is to write your own custom action (command line/API), parse between the GO statements in the script and execute with ADO.net.

设置以外的另一种选择是单独安装和配置。设置只规定了位,并且在运行时经由配置的产品的运行时的相位被创建的数据库。这样做有很多好处,包括能够后安装阶段和配置阶段之前更新您的位(无论是与修补程序或自动)。你也可以给一个更好的互动体验,并在运行时处理的问题 - 与设置,你的选择是失败的设置和回滚它是一个糟糕的经历

Another option outside of setup is to separate setup and configuration. Setup only lays down bits and the database is created at runtime via a configuration phase of the runtime of the product. This has many benefits including being able to update your bits (either with a patch or automatically) after the setup phase and before the configuration phase. You can also give a better interactive experience and handle issues at runtime - with setup, your choices are to fail setup and roll it back which is a bad experience.

希望有所帮助。

这篇关于如何将软件安装过程中genenerate后端数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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