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
- :
- LaunchAppAndWait causes 740 error in windows 7
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
‎Oct 16, 2012
01:38 PM
LaunchAppAndWait causes 740 error in windows 7
I have an old install shield project that worked fine for older versions of windows including XP and WinSrv 2003. I'm trying now to get this project working for Windows 7 (and I guess Vista as well). My problem is with a call to a win32 application that I wrote in CPP. I'm using the LaunchAppAndWait function and I get a 740 error from LAAW_PARAMETERS.nLaunchResult. I researched this and it has something to do with privilege elevation.
My install shield project is a Basic MIS project with some InstallScript of course. In the General Information section I have an install condition of AdminUser so that I am sure an administrator only runs this install. I have also signed the install. The executable that the LaunchAppAndWait function is trying to call does request elevated privileges and that level is "requireAdministrator". I believe I have everything in place that makes sense but it does not work. Oh and the executable is also digitally signed.
Here is a code snippet:
Ideas?
thanks for any help
My install shield project is a Basic MIS project with some InstallScript of course. In the General Information section I have an install condition of AdminUser so that I am sure an administrator only runs this install. I have also signed the install. The executable that the LaunchAppAndWait function is trying to call does request elevated privileges and that level is "requireAdministrator". I believe I have everything in place that makes sense but it does not work. Oh and the executable is also digitally signed.
Here is a code snippet:
function LaunchPIDriver_Install(hMSI)
STRING svInstallDir;
NUMBER nvSize, nResponse, nRC, nType;
STRING svProgramPath;
STRING svMessage;
STRING svRC;
begin
svProgramPath = svInstallDir ^ "Win32\\PrinterInstaller\\PIDriver.exe";
// Invoke PIDriver
if (LaunchAppAndWait(svProgramPath,"",LAAW_OPTION_WAIT | LAAW_OPTION_HIDDEN | LAAW_OPTION_SHOW_HOURGLASS) < 0) then
// LaunchAppAndWait Failed...Return Error...
svMessage = "LaunchPIDriver_Install - LaunchAppAndWait() Failed";
NumToStr(svRC, LAAW_PARAMETERS.nLaunchResult);
MessageBox(svRC,INFORMATION);
SprintfMsiLog(svMessage);
SprintfMsiLog("Installation UNSUCCESSFUL!!!");
return ERROR_INSTALL_FAILURE;
else
// LaunchAppAndWait Successful...
// Was PIDriver Install Successful?
if (LAAW_PARAMETERS.nLaunchResult = 0) then
// Yes - Return Success
NumToStr(svRC, LAAW_PARAMETERS.nLaunchResult);
return ERROR_SUCCESS;
else
// No - Return Error
NumToStr(svRC, LAAW_PARAMETERS.nLaunchResult);
svMessage = "LaunchPIDriver_Install - PIDriver.exe Failed RC: " + svRC;
SprintfMsiLog(svMessage);
SprintfMsiLog("Installation UNSUCCESSFUL!!!");
return ERROR_INSTALL_FAILURE;
endif;
endif;
end;
Ideas?
thanks for any help
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 16, 2012
03:31 PM
The LaunchAppAndWait function has been superseded by the LaunchApplication function, which has support for launching applications with elevated privileges. To learn how to use LaunchApplication, see LaunchApplication, and note the first bullet point in the Additional Information section near the bottom of the help topic.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 16, 2012
03:35 PM
I seemed to have found a solution for this. There is a setting under the Release section, for a configuration, for a release, on the setup.exe tab. I set "Required Execution Level" to Administrator. This setting seems to propagate and thus allows my executable to be called correctly. Not sure if this helps installs that do not use a setup.exe.
Additionally, I found an article that suggested a switch from LaunchAppAndWait to LaunchApplication.
Additionally, I found an article that suggested a switch from LaunchAppAndWait to LaunchApplication.
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)