PDA

View Full Version : Unable to install Sql server 2008 r2 silently in custom action



midgshen
03-26-2012, 04:53 PM
I have a c# program which uses Process.StartInfo and Process.Start to run a batch file (ToInstallSql.bat) to install Sql Server 2008 R2 silently which contains:
SQLEXPR_x64_exe /ConfigurationFile=MySqlConfiguration.ini

The c# program (MyCustAction.exe) contains the following:

Process proc=new Process();
proc.StartInfo.FileName = "ToInstallSql.bat";
proc.StartInfo.RedirectStandardInput = true;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.CreateNoWindow = true;
proc.Start();
proc.WaitForExit();
proc.Close();

If I directly run the program MyCustAction.exe as administrator, Sql server is installed successfully. But if I add MyCustAction.exe as a custom action After File Transfer, Sql Server installation failed even if the installation process took longer time than normal with no error message. The Releases/Setup Launcher/Required Execution Level is set to Administrator. The MyCustAction.exe is embedded with a manifest to run as administrator. I run the InstallShield 2012 Express created Setup.exe as administrator.

The c# program and batch file are transferred by InstallShield setup.exe to a subfolder under the installation folder.

I tried many different scenarios, still unsuccessful. Please help me.