English 中文(简体)
Installing SQL Server and .NET Framework from a visual studio setup project
原标题:

I have to do four things install .net framework 3.5 ,install SQL Server 2005 and run my sql script on the server and create the database and install my application how to do it in a single setup project using visual studio 2005/2008

最佳回答

Use NSIS instead of the Visual Studio installer project:

http://nsis.sourceforge.net/Main_Page

It s much more powerful, but still pretty straightforward to use. Also there s lots of sample code for common tasks like installing .NET or SQL Server.

问题回答

You can t install SQL Server from a Visual Studio setup project.

You ll probably have to write an installer yourself or get an installer that you can attach other installers to it. Not sure why you would want to install sqlserver on a client s machine. Why not go with SQLLite or something that can be installed easily and have your database deployed without running scripts.

The framework can t be installed from within an MSI setup project. you can specify that it is a prerequisite but can only hope that the use will go through with the installation. If you are running a simple application you might get away with embedding the framework basic files in to your installation package.

Then comes SQL2005. If you can settle with SQL2005 express then the proper DLLs will be added to your project and no installation needs to be done. If you do need a standard edition then you can execute the SQL installation with predefined flags.

Creating a database is a little more tricky as the user should specify the database location and have the SQL server have privileges on that folder. I would strongly recommend NOT to create the database & run the scripts in the setup project but do it as a wizard the first time the program is executed.

The more you add up to the setup project the harder it will be to roll-back everything if something goes wrong in the installation.

Gilad.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签