3

I am quite new to C# .net windows form application. I am building a Windows Form application and using MySql with it as a back end.

Now the problem is when I build the installed I want my installer to check if MySQL dot net connector is installed in the users PC and if not it should automatically install it.

As soon as this is done I will be creating a database using my application.

2 Answers 2

2

In .NET, unless you are trying to install the assemblies into the GAC, they get deployed with the application. Do not place anything into the GAC unless you have to as it opens up a whole host of challenges and makes managing the app more difficult.

I suggest including the MySQL connector assemblies with the application and include them in your MSI package. There are two parts to this - in the Deployment project, be sure the MySQL Libraries are referenced explicitly. Also, in your application project, set the Copy Local property of the reference to True. With these two steps, the MySQL Connector will be installed with the application. Don't worry too much about disk size - if memory serves, the MySQL Connectors are really small.

Sign up to request clarification or add additional context in comments.

2 Comments

sir thanks for the response but can you please help me with the procedure to do this . I am very new to this and have no idea of how do I proceed
When you add the reference the MySQL assemblies in Visual Studio, right click on the assembly and click properties. From there, there is an option for the Copy Local property - change to that to True. For deployment, add a deployment project to your solution - follow the MSDN steps on this. This will create an MSI file containing your application that can be used to deploy it to your users. If you have to install MySQL on each machine, you will need to look into advanced deployment tools.
0

From MySQL manual:

You may also use the /quiet or /q command-line option with the msiexec tool to install the Connector/Net package automatically (using the default options) with no notification to the user. Using this method the user cannot select options. Additionally, no prompts, messages or dialog boxes will be displayed.

C:\> msiexec /package connector-net.msi /quiet

To provide a progress bar to the user during automatic installation, use the /passive option.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.