CreateProcess from NT service hangs
I'm trying to start SQLServer2008SP1 express installer from the NT service process. Process is started successfully, I can see it in task manager, but it does nothing, just stays inactive until I kill him.
I'm starting the process with the following command:
szCmdLine = "Setup.exe /Q /HIDECONSOLE /ACTION=install /CONFIGURATIONFILE=ConfigurationFile.ini /SAPWD=pwd_to_set");
STARTUPINFO si;
si.wShowWindow = SW_HIDE;
...
CreateProcess(NULL, szCmdLine, NULL, NULL, TRUE,
CREATE_NO_WINDOW, NULL, szPath, &si, &pi);
Installation goes ok when started manually from cmdline.
I tried playing with various creat flags for process, but with no luck. I'm running out of ideas so every help is appreciated.
Note that the same code worked ok for SQL Server 2000 installation. And I know this is a strange way to handle installation, but it is to late to change that.
OS is Windows Server 2开发者_JAVA百科003 SP2.
To respond to myself, just for the reference. The problem was that wrong Setup.exe was called. Although szPath pointed to correct folder, Setup.exe from windows folder was called.
The fix was to call Setup.exe with full name, including directrory.
精彩评论