
loso1.552490258687292E12 asked a question.
LaunchApp Windows 7
Hi All!
I try to launch dpinst.exe on Windows 7 32-bit and dpinst64.exe on Windows 7 64-bit via LaunchAppAndWait but it doesn't works?
When I execute both programs by double clicking they are working fine after
confirming dialogue for administrator rights.
LaunchAppAndWait returns 0 this means the application was launched.
Bye, Mike Maico.
don't really have an answer but two ideas:
1. Check dpinst.exe's return value via LAAW_PARAMETERS after LaunchAppAndWait for any problems.
2. I remeber a problem with dpinst when setting the wrong working dir. Afaik, when you double click it, the working dir is set to the file location, but this is not done when you LaunchApp the file (dpinst /path sets the working dir).
Hope that helps.
Johannes
LaunchApplication
Solution:
exePath=SRCDIR;
if(SYSINFO.bIsWow64 == 0)then//... 32 bit
programWithPath=exePath^"DPInst.exe";
else
programWithPath=exePath^"DPInst64.exe";
endif;
LongPathToQuote(exePath, TRUE);
LongPathToQuote(programWithPath, TRUE);
result=LaunchApplication
(
programWithPath,//szProgram
"",//szCmdLine
exePath,//szDirectory
SW_NORMAL,//nShowWindow
INFINITE,//nTimeOut
LAAW_OPTION_WAIT |
LAAW_OPTION_CHANGEDIRECTORY |
LAAW_OPTION_USE_SHELLEXECUTE
);