简体   繁体   中英

How To make setup file that contains C# application and sql server

I want to build a setup file that contain windows form application that is connected to sql server how can I do that? I want to put the .net framework and sql server in the setup package how can I do that? do I need sql server or sql express in this case? I want to create the database in the installation process how can I do this? I want to check If the requirements are already installed how can I do this? hw can I improve the security of the program from stealing?? please help thanks

note my English language not good enough Smile | :)

That is a lot more than one question, and not easy to answer all at once. Anyway, assuming you're using Visual Studio 2012, you can try creating a new Install Shield project (below).

(It might be easier to help you once you've tried something, and have got a more specific question/problem)

在此输入图像描述

For my projects I use Inno Setup . It lets you customize all aspects of the installer - add/remove different screens, set conditions for installing different files, for example you can check out whether SQL server is installed and install it only if it is not through scripting. Take a look at the FAQ page for more information about the features this tool offers.

There's also a sample Inno Setup file at CodePlex , that should get the job done. I haven't tried it though, so I cannot guarantee whether it works fine or not.

If you want to have installer for tomorrow, than good choice will be WIX ( http://wix.sourceforge.net/ ). It is easy to understand and have a possibility of checking installed frameworks and OS version.

If you wish to have Framework msi installer inside yours, than you can check Wix Bootsrapper. But as far as I know it has poor flexibility to setup install steps. For this propose you can combine Wix with other for example NSIS. You can create application installer by using Wix and Bootsrapper application, which will contains your application MSI and Framework MSI, by using NSIS.

To create database during installation you also can use WIX. You need to create database generation plan, which will contain queries for creating database. This generation plan can be executed as part of the installation process ( http://wix.tramontana.co.hu/tutorial/sql/creating-a-database ). It is good choice wile you don't need additional information from user. In other case you will need to create custom UI.

From my experience with built in Visual Studio install tools, they're all horrible.

I highly recommend Advanced Installer . It's a very powerful tool to create installers and patches for your software. It should have all the features you need in the free version, including checking for prerequisites such as .NET Framework on the user's machine, and installing things when needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM