Installation project dynamic connection string - winforms

I have a windows forms application, that i want to deploy as installation project using visual studio 2010.
I am using SQLite database and i want to create a connection string while the installation to the installation directory.
On the other hand, i do not know should i attach my empty database to the install project or i have to create it while the installation?
I found lot of web sites, but none of them helped.
Thank you in advance all the help and please refer helper links in this topic.

Here is a tutorial which can get you started:
http://support.microsoft.com/kb/307353
Visual Studio is very limited when it comes to the setup project features. It doesn't support SQL connections, so you can do it only through a custom action.
If you need advanced features (like an SQL connection), I recommend a different setup tool:
http://en.wikipedia.org/wiki/List_of_installation_software

Related

what's the client pc requirements for a VB.net using access database

does the client pc need to install anything for runing a VB.net application with access database ? (like microsoft office or something else ?)
Yes they do. If they have MS Access, then no further tools are required. Otherwise they will need to install AccessDatabaseEngine.exe to handle the database operations. You can download that from Microsoft.
I'm currently making a VB.net application to run with Access and have had to install AccessDatabaseEngine.exe ect.
Helpful website that I've since saved which contains all the downloads you'll need:
https://social.msdn.microsoft.com/Forums/...
When you are using ADO.NET and have selected the Assembly in the dependencies it will be part of the .NET Framework. Sometimes older Applications do need the Microsoft JET Driver copied into the windows directory. Do you have an error message?

Setup and Deployement in VB.Net having Sql Server Database in the Project

I have completed my Project in VB.Net and has published my project.
But i want to come out of these things
I have Sql Server Database in my project and i want my setup to add that database to sql server on installing my project.
I want my application to automatically detect sql server 2008 r2 and if it is not instaled i want it to install for me and then atach the database.
I dont want to add the database as a Attached database in my project.
i dont want to install crystal report in my application.
I have some unused refernces in my application in my project which i want to removed, i have tried the default visual studio remove unused references but still have some references like shockwave.dll log2net.dll etc.
The first step would be to switch to an MSI-based installer. This should allow you to resolve issues 3 and 5 (you control what the MSI includes). You can use a Visual Studio setup project, WiX or a commercial setup authoring tool.
For installing your database (issue 1), the best approach depends on how you use your database. Some installers simply copy the database files, others install it using custom actions and others execute SQL scripts. You should first determine how you want to install it and then ask a more specific question if you encounter problems.
To install SQL Server when it's not found (issue 2), you can use a prerequisite. This is done differently for each setup tool, so you first need to decide on a tool and then research how it supports prerequisites.
For issue 4, I'm not sure I know what to say. An MSI package will install what you include in it. If you don't add Crystal Reports in your package, then it won't be installed.
Visit
http://www.codeproject.com/Articles/10032/Deploy-SQL-Server-databases-easily-with-an-Install
Deploy SQL Server databases easily with an Installer class
Best regards!
Elias Sant Anna

How to build a specialized installer in VS2010?

I'm looking to build a specialized msi installer, preferably with VS2010 to do the following:
Be able to configure SQL server connection.
Pick the database to be used from the SQl server.
Create database table with specified credentials.
Assign a new DB user a set of permissions.
Also configure the IIS application.
I looked into a default installer project in VS2010 and it has nothing related to dealing with SQL server and IIS. Any idea how can I do all this?
Visual Studio setup projects do not offer support for SQL scripts and IIS. The best you can do is write some custom actions (using custom code) to handle this during install.
Commercial setup authoring tools offer the most control over SQL scripts and IIS elements. You can find a list here: http://en.wikipedia.org/wiki/List_of_installation_software
You can also try WiX. It has a steep learning curve, but it's free and gets the job done.

Using WebDeploy to deploy database updates

We have adopted WebDeploy for a new project and it seems to handle the deployment of our apps to our Dev and Test servers pretty well.
Now we would like to extend the use of WebDeploy to make it deploy database changes too.
Scott Gu's blogpost on webdeploy states:
Web Deploy enables you to not only
publish files – but also provision
database schema/data, run database
change scripts, set security ACLs, and
more
... but I can't find any good information on how to run database change scripts with
WebDeploy.
Does anyone have guidance, advice, best-practice or informative links for this?
Thanks
Darren.
If you're using Visual Studio 2010 or Visual Studio 2010 Express then you can specify database change scripts in the Package/Publish SQL tab in your project's properties. For more information see the following article:
How to: Deploy a Database With a Web Application Project

Embedding SQL Server into a .NET application

Hey, I've just finished writing a VB.NET application. Now I want to package the executable and the database ofcourse into a single installer file. I tried using QSetup, InstallShield to make SQL Server embedded into the setup file, and finally after hours of try&fail I have no idea. Anyone?
You can do a rightmouse on the properties of your Visual Studio Setup Project, and then there is this button 'Prerequisites'. There you can tick 'SQL Server Express ...' Or the 'SQL Server Compact 3.5'
link to image
You're probably best off just to set the connection file directly to the mdf, and attach it when the program is run. This is easier as it doesn't require a custom setup script to install the database to the database directory itself.
Note: Consider using the Compact Version, it's smaller, people don't like a full blown engine on their computer :)
InstallShield has a concept called Setup Prerequisites where you can teach it how to install additional packages along with your own. In older versions this would happen before calling your MSI. In newer versions you can have a "Feature" prerequisite where the prereq can associated to a feature and only installed if that feature is selected to be installed and after it's been selected but still before the main activity of your MSI occurs during the install execute sequence.
InstallShield also has a pattern for executing SQL scripts against your database instance so that you can then load your database into your newly installed instance.
All of this is quite powerful but it does take a bit of digging to learn.
As far as I know, anything but the SQL Server Compact Edition (SQL Server CE) cannot be embedded into your setup, really. Microsoft doesn't want that - you need to have SQL Server Express installed separately - any other edition can't even be shipped with your software (the client must have a license and installation separately).
You can indeed distribute SQL server with your custom application:
http://msdn.microsoft.com/en-us/library/bb264562(SQL.90).aspx

Resources