0

I have a WindowsForm Application and in Form2 I have an install button. I want to do an event, when I make click on install to play the executable file who have the location here : D:\Mat\R2008a\win64 and the name setup.exe. The extra condition is : I want this exe to play with installer.ini setup who is here :

string path = AppDomain.CurrentDomain.BaseDirectory.ToString();
 string installerfilename = path + "installer.ini";

I want to make my application like an installer.

I tried to use this code, but doesn't works:

private void Install_Click(object sender, EventArgs e)
        {
string desktopPath = @"D:\Mat\NSIS\R2008a\win64";
            ProcessStartInfo psi = new ProcessStartInfo();
            psi.Arguments = "/s /v /qn /min";
            psi.CreateNoWindow = true;
            psi.WindowStyle = ProcessWindowStyle.Hidden;
            psi.FileName = desktopPath + "\\" + "setup.exe";
            psi.UseShellExecute = false;
            Process.Start(psi);
            this.Visible = false;

        }

I want to run the setup.exe with installer.ini file .

ben
  • 135
  • 8
  • I'm not at all clear on what you're trying to do - do you have some other program/pair of programs that follow the same pattern, that you're using as an example? If so, can you name the examples? If not, possibly no-one else does it because it doesn't work (well). – Damien_The_Unbeliever Sep 21 '15 at 06:34
  • i edited my post. But I can't understand what means "/s /v/ qn/ min ". – ben Sep 21 '15 at 06:57

1 Answers1

0

you will need to start a process on install button click event. which will call your exe file

Process.Start("location of your setup file");
amit dayama
  • 3,246
  • 2
  • 17
  • 28
  • yes, but this just call my exe file, and how I can mention whit who installer.ini to start? – ben Sep 21 '15 at 05:57
  • it depends on your requirement.. on what conditions you want to call those installer.ini file? – amit dayama Sep 21 '15 at 06:00
  • the installer.ini is the inputFile for setup.exe – ben Sep 21 '15 at 06:06
  • http://stackoverflow.com/questions/9679375/run-an-exe-from-c-sharp-code this link would help you. you can give multiple argument as well. – amit dayama Sep 21 '15 at 06:12
  • You can say me what I suppose to put in place of const string ex1 = "C:\\"; and const string ex2 = "C:\\Dir";?? – ben Sep 21 '15 at 06:28