Deploy MySQL server with VisualStudio 2005 application

I have a Visual Studio 2005 project (C#) that uses MySQL as a data storage engine, i would like to create a MSI package that install the app, and after install MySQL silently. I have been looking into it but i couldn't find much info.

I have installed the MySQL package silently and after configure it with this two statments in the CMD

Install:

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

Configure:

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 don't know how to say Visual Studio taht do it before or after it install my application. I have been googleing it, but i couldn't find any usefull help.

I hope you can guide me :)

EDIT: I have been working around the solution with custom actions, i've found this article that use a custom installer class to carry the custom actions. It looks fine at first place but i'am getting a problem because when my MSI package try to launch the second MSI installer (the MySQL) i get an error with code 2869 that says "Access Denied".

I've been looking for this problem as well and look like when the first MSI is trying to run the second MSI it don't apply the right privileges and the installation fails...

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

this is the code i'm using 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
задан Daniel Nugent 13 July 2017 в 22:27
поделиться