This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- problems with LaunchAppAndWait
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 03, 2008
09:30 AM
problems with LaunchAppAndWait
I have a basic MSI Installation and try to start a dialog, after it was installed.
But the LaunchAppAndWait has Problems to start the dialog.
The Dialog needs dll's wich are in a different directory.
szCurrent = INSTALLDIR^"dll";
szProgramm = INSTALLDIR^"exe"^"conws.exe";
LongPathToQuote(szProgramm,TRUE);
LongPathToQuote(szCurrent,TRUE);
ChangeDirectory ( szCurrent );
LAAW_PARAMETERS.lpCurrentDirectory = &szCurrent;
if (LaunchAppAndWait( szProgramm,
"",
LAAW_OPTION_WAIT |
LAAW_OPTION_NO_CHANGEDIRECTORY ) < 0) then
NumToStr( szResult, LAAW_PARAMETERS.nLaunchResult );
MessageBox ("Unable to launch configuration tool.\n" + szCurrent + "\n" + szProgramm + "\nResult: " + szResult,SEVERE);
endif;
nLaunchResult is 267
if i don't use LongPathToQuote the result is 740
Whats wrong ?
thx
Andreas
But the LaunchAppAndWait has Problems to start the dialog.
The Dialog needs dll's wich are in a different directory.
szCurrent = INSTALLDIR^"dll";
szProgramm = INSTALLDIR^"exe"^"conws.exe";
LongPathToQuote(szProgramm,TRUE);
LongPathToQuote(szCurrent,TRUE);
ChangeDirectory ( szCurrent );
LAAW_PARAMETERS.lpCurrentDirectory = &szCurrent;
if (LaunchAppAndWait( szProgramm,
"",
LAAW_OPTION_WAIT |
LAAW_OPTION_NO_CHANGEDIRECTORY ) < 0) then
NumToStr( szResult, LAAW_PARAMETERS.nLaunchResult );
MessageBox ("Unable to launch configuration tool.\n" + szCurrent + "\n" + szProgramm + "\nResult: " + szResult,SEVERE);
endif;
nLaunchResult is 267
if i don't use LongPathToQuote the result is 740
Whats wrong ?
thx
Andreas
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 03, 2008
01:09 PM
A system error code of 267 is "The directory name is invalid."
Error code 740 is "The requested operation requires elevation."
If you are running on Windows Vista, have you tried using the LaunchApplication function instead (pass the LAAW_OPTION_USE_SHELLEXECUTE option and set LAAW_SHELLEXECUTEVERB="runas")?
Error code 740 is "The requested operation requires elevation."
If you are running on Windows Vista, have you tried using the LaunchApplication function instead (pass the LAAW_OPTION_USE_SHELLEXECUTE option and set LAAW_SHELLEXECUTEVERB="runas")?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 04, 2008
03:58 AM
yes, i am running the installation on vista.
Now the installer starts the dialog, but he doesn't find the needed dll's from the working directory. (szCurrent)
I had to change the working Directory by myselft (ChangeDirectory)
Now it works.
But, is there a better solution ?
szCurrent = INSTALLDIR^"dll";
szProgram = INSTALLDIR^"exe"^"conws.exe";
if ( ChangeDirectory ( szCurrent ) < 0 ) then
MessageBox ("Unable to change directory.\n" + szCurrent ,SEVERE);
endif;
LongPathToQuote(szProgram,TRUE);
LongPathToQuote(szCurrent,TRUE);
szVerb = "runas";
LAAW_SHELLEXECUTEINFO.lpVerb = &szVerb;
LAAW_SHELLEXECUTEVERB=szVerb;
if ( LaunchApplication( szProgram,
"",
szCurrent,
SW_SHOW,
INFINITE,
LAAW_OPTION_WAIT | LAAW_OPTION_CHANGEDIRECTORY | LAAW_OPTION_USE_SHELLEXECUTE) < ISERR_SUCCESS) then
...
thx
Andreas
Now the installer starts the dialog, but he doesn't find the needed dll's from the working directory. (szCurrent)
I had to change the working Directory by myselft (ChangeDirectory)
Now it works.
But, is there a better solution ?
szCurrent = INSTALLDIR^"dll";
szProgram = INSTALLDIR^"exe"^"conws.exe";
if ( ChangeDirectory ( szCurrent ) < 0 ) then
MessageBox ("Unable to change directory.\n" + szCurrent ,SEVERE);
endif;
LongPathToQuote(szProgram,TRUE);
LongPathToQuote(szCurrent,TRUE);
szVerb = "runas";
LAAW_SHELLEXECUTEINFO.lpVerb = &szVerb;
LAAW_SHELLEXECUTEVERB=szVerb;
if ( LaunchApplication( szProgram,
"",
szCurrent,
SW_SHOW,
INFINITE,
LAAW_OPTION_WAIT | LAAW_OPTION_CHANGEDIRECTORY | LAAW_OPTION_USE_SHELLEXECUTE) < ISERR_SUCCESS) then
...
thx
Andreas
![](/skins/images/7DF1852B2C95702E61A73F170B191DAC/responsive_peak/images/icon_anonymous_message.png)