[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


Install shield LaunchAppAndWait is not picking up my return codes from .vbs scripts

Posted on 2008-09-29
Medium Priority
Last Modified: 2013-11-14
I am running the attached Install shield function in Installshield professional 2008.

It is not picking up the return codes that I return from the .vbs script using the



Any idea what is wrong?
function NUMBER ProcessInstall(path, key, direction, drive, log)
	STRING szDirectory, szProgram, CommandOptions, szCmdLine, vbscriptPath;
	STRING sdirection, temp;
	NUMBER result;
	szDirectory = TARGETDIR;    //temp
	LongPathToQuote (szDirectory,TRUE);  
	LongPathToQuote (path,TRUE);   
	NumToStr ( sdirection, direction); 
	szProgram = "cscript.exe";
	CommandOptions =  " -Drive " + drive + " -key " + key + " -dir "  + sdirection;
	vbscriptPath =  TARGETDIR ^"\\ProcessInstall.vbs"  ;
	LongPathToQuote (vbscriptPath,TRUE);
	szCmdLine =vbscriptPath + CommandOptions + " -p " + path; 
	//MessageBox("Install command line:  " + szCmdLine ,WARNING);
	result = LaunchAppAndWait ( szProgram, szCmdLine, WAIT);
	return result;

Open in new window

Question by:Christopher Schene
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
LVL 40

Accepted Solution

Vadim Rapp earned 1200 total points
ID: 22596631
Return Values                                       
Return Value                   

0                   Indicates that the application was launched successfully.                                             
< 0                   Indicates that the application was not launched successfully.
It does not say anything about return code.

When running an MS-DOS program you cannot determine the return resultDOS_ERRORLEVEL. However, you can place an MS-DOS application in a batchfile and have the batch file recognize the error and then createanother file that contains the returned error code. You can then readthe file and determine the error code returned from the MS-DOSapplication.

that's what you probably have to do.

Author Comment

by:Christopher Schene
ID: 22596694
I wonder if I could place the response code in an environment variable anbd pick it up that way?
LVL 40

Expert Comment

by:Vadim Rapp
ID: 22596713
Sure, only it has to be machine-wide environment, not user.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

by:Christopher Schene
ID: 22596896
Hi, If you can give me an example of reading  an error code and error text from a file, I will add 200 points.
LVL 40

Expert Comment

by:Vadim Rapp
ID: 22598928
sorry, I'm not familiar with installsript.

Expert Comment

ID: 23656490
HI cschene,

How did u fix your installshield problem? how did u get LaunchAppAndWait.htmto return your vb results? can u please let me know. THANKS...

Author Comment

by:Christopher Schene
ID: 23666428
I used a file to communcate errors between installshield and the VB application.  I can upload the code if you wish.

Expert Comment

ID: 23666570
what I am trying to do is to save the query result to a file by doing :
launchappandwait ("sqlcmd.exe", " -S serverip - d database -E /Q "select version from versiontable" > vlog.txt" , ....)
... check the result and openfile ...

it returns zero but the file is not there .. not sure why. could u upload your code so I see what am I missing ?

Author Comment

by:Christopher Schene
ID: 23670144
What I believe happens is that you see a bad return (non zero) only if the command itself fails.  So, I was running msiexex.exe and even if the >msi install failed, the msiexec command itself  worked (it ran).

I will have to look around for the code

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This script will sweep a range of IP addresses (class c only, and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question