Click here to Skip to main content
15,912,977 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Everyone,

I need to create a setup file which includes .Net framework 4.0, MySql Odbc Connector, MySql Server with Database, and Windows application. When client clicks this setup in his system, it needs to install all above four components in the system silently i.e without manually installing all 4 components, it needs install all these in order.

Please help me to how to do this. I am very new to this concept, so please explain step by step.
Posted

1 solution

First, you need to add a new Setup project to the current solution. Refer This

Requirements:
1. DotNet Framework - Setup Project in VS -> Right Click-> Properties-> Click Prerequisites-> Check the required DotNet framework. Select Radio button Download prerequisites from the same location as my application. Now your setup includes this framework too.

2. MySql Setup - Add MySql setup file to the Setup project in VS. It will be automatically installed along with your project setup. User has to create user to connect MySql. Login MySql and Import your database from Sql dump file manually. Or you may develop a small win form to Restore DB. Create a batchfile and write the following code into it from WIN form.

"mysql.exe --host=" + txtHostIP.Text + " --user=" + txtUserName.Text + " --password=" + txtPassword.Text+ " --port=" + txtPort.Text + " --default-character-set=utf8 --comments < " + SqlScriptFile);


Execute the batch file using the following code.

ProcessStartInfo info = new ProcessStartInfo(_installBatchFile);
     info.UseShellExecute = false;
     info.RedirectStandardError = true;
     info.RedirectStandardInput = true;
     info.RedirectStandardOutput = true;
     info.CreateNoWindow = true;
     info.ErrorDialog = false;
     info.WindowStyle = ProcessWindowStyle.Hidden;
     info.WorkingDirectory = GetPathOfMySqlService();//Get MySql.exe(program files) path
     Process process = Process.Start(info);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900