
Göran Dahl (Customer) asked a question.
Does anyone have a clue or have solved this type of problem?
My C# app is run as administrator.
I elevate run as admin for the cmd prompt as well.
Using a C# Process to run a silent ODBC 32.Bit driver install works at cmd-prompt but not within a C# process.
The command looks like this by the promp(works)t:
setup.exe -psc_s -psc_f1=C:\Users\Administrator\AppData\Local\Temp\_Progress_ODBC_32\response.ini -psc_f2=C:\Users\Administrator\AppData\Local\Temp\_Progress_ODBC_32\oesetup.log -hide_progress -hide_splash
In C# it is run by the typical
Process process = new Process();
process.StartInfo.FileName = strPathAndFilename; //path to setup.exe
process.StartInfo.Arguments = strArguments; //same arguments as by the cmd-prompt
process.StartInfo.UseShellExecute = false; //false
process.StartInfo.RedirectStandardOutput = true; //true
process.StartInfo.RedirectStandardError = true; //true
process.StartInfo.CreateNoWindow = true; //true
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.StartInfo.WorkingDirectory = @"C:\Users\Administrator\AppData\Local\Temp\_Progress_ODBC_32";
process.Start();
process.WaitForExit();
When I run the same command in a c# process as by the cmd prompt it doesn't work. I get the return code -2147213312
I was told that this typically means the installer tried to perform a function that is not supported in the current context — such as trying to show a dialog box in a silent install, or relying on a UI element or interaction.
Powershell works for us
Execute-Process -Path "$TempInstallFolder\PROGRESS_OE_12.8_WIN_32_SQLCLIENTACCESS\setup.exe"` -Parameters "-s -psc_s -psc_f1=`"$TempInstallFolder\PROGRESS_OE_12.8_WIN_32_SQLCLIENTACCESS\response_Install.ini`" -psc_f2=`"$LogDir\installation_PROGRESS_OE_12.8_WIN_32_SQLCLIENTACCESS.log`""
Hi Stefan !
Are You running Powershell from a C# process inside a C# App or do You mean running it by a Powershell window/console ?
BR Goran
This is our powershell script example.