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: LaunchApplication/LaunchAppAndWait Issue
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
Feb 25, 2019
11:22 AM
LaunchApplication/LaunchAppAndWait Issue
I am trying to use LaunchApplication or LaunchAppAndWait to run SQLCMD but am having the hardest time getting it to do anything. Below is the code I am using:
LaunchApplication:
when I output it, it comes in correctly as:
C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\SQLCMD.EXE -E -Sservername\instancename -i"C:\Users\ME\AppData\Local\Temp\4\{120AB5C2-2753-4AEB-8B16-552E3ED03C68}\{4B2412FB-30BB-4839-A0C9-33F8A28BA28F}\ScriptIAmRunning.sql" > "C:\Program Files\Logs\ScriptIAmRunning.log"
I also tried:
LaunchApplication:
sSQLCMD = PROGRAMFILES ^ "\\Microsoft SQL Server\\Client SDK\\ODBC\\130\\Tools\\Binn\\SQLCMD.EXE";
sLogFullName = PROGRAMFILES64^"Logs"^"ScriptIAmRunning.log";
sScriptRun = SUPPORTDIR ^ "ScriptIAmRunning.sql";
sParameters = '-E -S'+sSQLServer+' -i"'+sScriptRun+'" > "'+sLogFullName+'"';
nLaunchReturn = LaunchApplication(sSQLCMD, sParameters, "", SW_NORMAL, 10000, LAAW_OPTION_USE_SHELLEXECUTE | LAAW_OPTION_WAIT | LAAW_OPTION_USE_CALLBACK | LAAW_OPTION_HIDDEN );
if (nLaunchReturn = 0) then
MessageBox("App found", INFORMATION);
else
MessageBox("App not found", WARNING);
endif;
when I output it, it comes in correctly as:
C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\SQLCMD.EXE -E -Sservername\instancename -i"C:\Users\ME\AppData\Local\Temp\4\{120AB5C2-2753-4AEB-8B16-552E3ED03C68}\{4B2412FB-30BB-4839-A0C9-33F8A28BA28F}\ScriptIAmRunning.sql" > "C:\Program Files\Logs\ScriptIAmRunning.log"
I also tried:
nLaunchReturn = LaunchAppAndWait ( sSQLCMD, sParameters, LAAW_OPTION_WAIT | LAAW_OPTION_USE_CALLBACK | LAAW_OPTION_HIDDEN );
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 08, 2019
10:07 AM
What are you using for "In-Script Execution"?
Are you sequencing in "Install Exec Sequence"?
Are you sequencing in "Install Exec Sequence"?