cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
abrasha
Level 4

Can't execute ServerManagerCmd.exe from InstallScript

Hi,

Project type is InstallScript project (IS 2009).
I use LaunchApplication-function for execute "ServerManagerCmd.exe" in Windows 2008 64bit environment.
It always returns -1.
If I run a same command line manually all works.
In case of other applications LaunchApplication() works perfect.

Code:

_app = "ServerManagerCmd.exe";
_params = "-inputPath "+ SUPPORTDIR^"answerfile.xml";
_workfolder = SUPPORTDIR;
nResult = LaunchApplication(
_app, _params, _workfolder,
SW_SHOW, 1000000, LAAW_OPTION_USE_SHELLEXECUTE|LAAW_OPTION_WAIT|LAAW_OPTION_SHOW_HOURGLASS);

Any ideas?

Thank you
Labels (1)
0 Kudos
(4) Replies
GetExp
Level 6

I guess the space or quotes in the command line parameter of the LaunchAppAndWait could be a problem. Because this function is sensitive to this. May be carefully examining this could solve your problem. Check the other parameters too...
0 Kudos
abrasha
Level 4

Hi,

After a little research:
Function LaunchApplication() in win2008 64bit environment can't find number of applications in System32.

I have executed the same DIR command in batch file manually and using LaunchApplication().
Results you can see in attached files. (ServerManagerCmd.exe exists only in the first case)

ServerManagerCmd.exe utility exists under WinSxS folder and like I know Windows creates something like "link" from System32-folder to its real location.
But I don't think this is a right way to use a direct path to ServerManagerCmd.exe (c:\Windows\winsxs\amd64_servermanagercmd_31bf3856ad364e35_6.0.6001.18000_none_610667c7b0c19f0b\ServerManagerCmd.exe).

So, the question is still open:
How can I execute ServerManagerCmd.exe-utility on Windows 2008 64bit using InstallScript (InstallScript project)?
or
Which limitations does LaunchApplication()-function have on Windows 2008 64bit (InstallScript project)?

Thanks
0 Kudos
abrasha
Level 4

Hi,

The problem was because of setup.exe is a 32-bit application (you can see in Task Manager "setup.exe *32").
"cmd.exe" was executed from InstallScript like 32-application too - this explains difference between DIR commands (you can see in Task Manager "cmd.exe *32").

My solution is:
ServerManagerCmd.exe may be executed from WINDIR^"Sysnative" folder.
see MSDN:http://msdn.microsoft.com/en-us/library/aa384187(VS.85).aspx

Other solution is described here (I didn't verify it):
http://community.acresso.com/showthread.php?t=186415&highlight=64BIT

If you have any comment or correction - please respond.

Thank you
0 Kudos
dror_b
Level 3

Hi,
Because the ServerManagerCmd.exe is located on the system32 fodler and there is no similar file for 32bit application at the syswow64 you should disable the automatic redirection in order to be able to run applications from the system32 folder.
Therefore you should do:

Disable(WOW64FSREDIRECTION);
szProgram =WINSYSDIR64^"ServerManagerCmd.exe";
szParam= " -install myComponent" ;
nReturn= LaunchAppAndWait(szProgram,szParam,LAAW_OPTION_WAIT | LAAW_OPTION_SET_BATCH_INSTALL | LAAW_OPTION_SHOW_HOURGLASS );
Enable(WOW64FSREDIRECTION);

Regards
Dror

BTW:
You can use the ocsetup.exe command instead of ServerManagerCmd.exe
🙂
0 Kudos