Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have used the MySQL 5.6.12 in my project i want to install this MySQL setup from myproject deployment setup .exe. how to install the MySQL from myproject setup installer silently .i also want to set the myproject path to the MySQL installer means MySQL install in myproject path (C:\
ProgramFIles\glob\myproject\MySQL\).
Posted
Updated 4-Sep-13 19:30pm
v3
Comments
Sergey Alexandrovich Kryukov 5-Sep-13 1:02am    
Why?
—SA

following code will help you..........

using System;
using WindowsInstaller;

namespace TestApp
{
    public class InstallerTest
    {
        public static void Install()
        {
            Type type = Type.GetTypeFromProgID("WindowsInstaller.Installer");
            Installer installer = (Installer)Activator.CreateInstance(type);
            installer.InstallProduct("YourPackage.msi");
        }
    }
}




for more Visit here
http://stackoverflow.com/questions/5764868/programatically-installing-msi-packages[^]

http://stackoverflow.com/questions/12448180/silently-execute-a-msi-package-from-c-sharp[^]
 
Share this answer
 
Comments
Member 10253742 5-Sep-13 1:41am    
thanks for reply but how to change the directory of installation file location
[no name] 5-Sep-13 1:46am    
dear Visit here to resolve the issue....
http://stackoverflow.com/questions/909788/how-to-get-installation-path-of-an-application
Menon Santosh 5-Sep-13 1:48am    
+ 5
[no name] 5-Sep-13 1:50am    
thanks dear
Member 10253742 5-Sep-13 1:58am    
actually i am not getting how to change the installation path of the
installer.InstallProduct("YourPackage.msi"); MSI file
You can do it like this:
C#
System.Diagnostics.Process.Start("MyInstallationPackage.MSI");


If you want the calling thread to wait until installation is complete, pay attention that this call returns the instance of System.Diagnostic.Process. You can use the method System.Diagnostic.Process.WaitForExit. It's better to do it in a separate thread.

Please see:
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx[^],
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx[^],
http://msdn.microsoft.com/en-us/library/fb4aw7b8.aspx[^],
http://msdn.microsoft.com/en-us/library/ty0d8k56.aspx[^].

—SA
 
Share this answer
 
Comments
Menon Santosh 5-Sep-13 1:48am    
my +5
Sergey Alexandrovich Kryukov 5-Sep-13 1:49am    
Thank you, Menon.
—SA
Member 10253742 5-Sep-13 1:57am    
thanks for reply , how to set the .MSI installer path in this then start the process
Sergey Alexandrovich Kryukov 5-Sep-13 2:22am    
You don't even need installer path. Or do you mean the path where the product should be installed? This path should be either specified by the MSI package, or the MSI UI should allow the user to choose the path, specifying just the default.

If you need unattended installation, you should use MSIEXEC with appropriate parameters. And you don't need a path to msiexec.exe. Please see: Windows installer command-line options.

—SA

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