Click here to Skip to main content
14,739,223 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

As part of installing my application (WPF application), need to install SQL Server as well as a prerequisite. So when the user choose the option to install SQL Server, during the course of application installation, it need to get installed silently using the configuration.ini file provided with the setup.

So what i did was prepare a batch file called "InstallSQL.bat" through code which has the command to execute SQL server.

Now when the user choose to install SQL server, from installation code, the batch file is to be executed. The code is as below

            int ExitCode;
            ProcessStartInfo ProcessInfo;
            Process process;            
            
            ProcessInfo = new ProcessStartInfo(batchFilePath);
            ProcessInfo.CreateNoWindow = true;
            ProcessInfo.UseShellExecute = false;

            ProcessInfo.WorkingDirectory =                    Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            // *** Redirect the output ***
            ProcessInfo.RedirectStandardError = true;
            ProcessInfo.RedirectStandardOutput = true;
            process = Process.Start(ProcessInfo);
process.WaitForExit();
MessageBox.Show("ExitCode: " + process.ExitCode);


When execute the setup, at the point of SQL Server installation, the SQL Server setup files are extracted and a console window opens up indicating installation is in progress.
The issue is, after some time in this console window a message appears saying "Process is terminated due to stackoverflowexception". Can someone please help me with an alternative for installing SQL Server silently (without user interaction).

Thanks
Nishitha
Posted
Comments
krumia 28-Jun-12 5:33am
   
Please don't do this.
Personally I don't like a software installing another software without my knowledge.
If I were you, I will tell user that "MySuperDuperApplication 1.0 needs installing SQL Server. It will be installed as well".
lukeer 28-Jun-12 5:57am
   
OP states "[...] when the user choose to install SQL server [...]".
Kiran Susarla 28-Jun-12 6:03am
   
It is not suggested to install the SQL Server silently. As other memeber, end users should know what all pre-requisites are required to use the software.
Also the end user need to know license terms of SQL Server. So better not to do a silent installation.

1 solution

Use SqLite. You can port it along with your application.
   

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