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
- :
- Re: LaunchAppAndWait .xml file
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 29, 2014
01:19 PM
LaunchAppAndWait .xml file
We are passing our created logs out as xml files now, for a cleaner look. If we find an error (FileGrep) we are trying to launch the .xml file. I am looking for a way to launch it so it uses the machines default program (IE or notepad). The code below doesn't work trying to just launch the actual XML file, so I was wondering if there was a way to do this. Code I am using below
nResult = FileGrep ( PROGRAMFILES64^"AIR"^"Logs"^File.xml, "ErrorMessage" , sReturnLine , nLineNumber , RESTART );
if (nResult != 0) then
nResult = FileGrep ( PROGRAMFILES64^"AIR"^"Logs"^File.xml, "WarningMessage" , sReturnLine , nLineNumber , RESTART );
endif;
if (nResult = 0) then
nResult = AskYesNo ("Errors happened during the installation. Would you like to view the log now?",YES);
if (nResult = 1) then
LaunchAppAndWait(PROGRAMFILES64^"AIR"^"Logs"^File.xml,"", LAAW_OPTION_NOWAIT);
endif;
endif;
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 29, 2014
02:48 PM
DonAIR,
My guess as to why it's not working is because you are trying to use the xml file as the szProgram argument of LaunchAppAndWait. The first argument for LaunchAppAndWait has to be the actual program you are launching - in this case, you would need to specify IE or notepad explicitly. The second argument for your example (which you have as "") should actually be the path to the xml file. To figure out what is the default program for opening XML files, you might need to dig around in the Windows Registry under HKEY_CLASSES_ROOT\.xml
example using notepad:
LaunchAppAndWait( WINSYSDIR ^ "notepad.exe", PROGRAMFILES64 ^ "AIR" ^ "Logs" ^ "File.xml", LAAW_OPTION_NOWAIT );
HTH
My guess as to why it's not working is because you are trying to use the xml file as the szProgram argument of LaunchAppAndWait. The first argument for LaunchAppAndWait has to be the actual program you are launching - in this case, you would need to specify IE or notepad explicitly. The second argument for your example (which you have as "") should actually be the path to the xml file. To figure out what is the default program for opening XML files, you might need to dig around in the Windows Registry under HKEY_CLASSES_ROOT\.xml
example using notepad:
LaunchAppAndWait( WINSYSDIR ^ "notepad.exe", PROGRAMFILES64 ^ "AIR" ^ "Logs" ^ "File.xml", LAAW_OPTION_NOWAIT );
HTH
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 29, 2014
03:22 PM
ch_eng wrote:
DonAIR,
My guess as to why it's not working is because you are trying to use the xml file as the szProgram argument of LaunchAppAndWait. The first argument for LaunchAppAndWait has to be the actual program you are launching - in this case, you would need to specify IE or notepad explicitly. The second argument for your example (which you have as "") should actually be the path to the xml file. To figure out what is the default program for opening XML files, you might need to dig around in the Windows Registry under HKEY_CLASSES_ROOT\.xml
example using notepad:
LaunchAppAndWait( WINSYSDIR ^ "notepad.exe", PROGRAMFILES64 ^ "AIR" ^ "Logs" ^ "File.xml", LAAW_OPTION_NOWAIT );
HTH
thanks, I figured as much, the issue though is we don't know where IE is installed, since IE can be installed to a different path unlike notepad, there is no fool proof path or system variable for IE. More than likely its Program Files\Internet Explorer but it could be changed. I guess I plan to just assume its the default location, since its a non-critical open anyways.
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)