Deploy MySQL Server with VisualStudio 2005

I have a Visual Studio 2005 (C #) project that uses MySQL as a data storage mechanism, I would like to create an MSI package that installs the application, and after installing MySQL silently. I studied it, but I could not find much information.

I installed the MySQL package silently and after setting it up using these two statuses in CMD

Installation:

msiexec /qb /i "c:\mysql.msi" /l* d:\log_mysql_test.txt INSTALLDIR=d:\mysql_test_mdps 

Setup:

 D:\mysql_test_mdps\bin\MySQLInstanceConfig.exe -i -q "-lD:\mysql_config_log.txt" "-pD:\mysql_test_mdps\bin" "-tD:\mysql_test_mdps\my-template.ini" "-cD:\mysql_test_mdps\my.ini" -v5.5.9 ServerType=DEVELOPMENT DatabaseType=MIXED ConnectionUsage=DSS Port=53306 ServiceName=MySQL_AGM RootPassword=root1234 SkipNetworking=no AddBinToPath=yes 

But now I do not know how to say that Visual Studio does this before or after installing my application. I was googleing this, but I could not find any helpful help.

Hope you can help me :)

EDIT: I am working on a solution with custom actions, I found this article that use a custom installer class to perform custom actions. This looks fine in the first place, but I get the problem because when my MSI package tries to run the second MSI installer (MySQL), I get an error message with code 2869, which says: "Access denied."

I also looked for this problem and look when the first MSI tries to start the second MSI, it does not apply the correct rights and the installation does not work ...

Do you know what I can do? or how can I run the second MSI installer? with full privileges (or at least the same as the first installer)

This is the code that I use to create the Process object.

 string arg1 = "/qb /i \"" + filepath + "\" /l* \"" + Path.Combine(installpath, logfile) + "\" INSTALLDIR=\"" + installpath + "\""; Process p = new Process(); p.StartInfo.FileName = "msiexec.exe"; p.StartInfo.Arguments = arg1; p.Start(); 
+6
c # mysql setup-deployment
source share
2 answers

You do not need to run another msiexec.exe file. Visual Studio also allows you to use the executable as a custom action. So custom action

See below. Image from this link : Custom action

Check the Call the executable file link as a user action in the link above. Now, if this does not work, select change default download .

Mark the answer 0xA3 in this link.
Running another program from a C # installation project

And it’s not difficult, as it seems. :)

Some more links for adding presets to bootstrapper:
Creating a Custom Bootstrapper Package for Visual Studio 2005
Visual Studio Installation and Deployment: Adding Advance Queries

Plus you should take a look at this:
Installing MySQL with winforms.NET

+3
source share

Are you using the Visual Studio installer? If so, you should go to click using the button on the right in the installer (in the solution explorer), then go to Show and click User actions in the context menu.

A new tree with Custom Actions should appear in the center of the screen. Then you can right-click on any of the folders (depending on when you want to add the action) and select Add custom action ...

Hope this is helpful to you ...

+1
source share

All Articles