Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Executing a batch file using LaunchApp


8 replies to this topic

aarvee50

aarvee50
  • Members
  • 4 posts

Posted 02 November 2004 - 13:12

Hey guys,
Lemme explain the situation.
I need to login to sqlplus and execute a series of scripts sequentially, automatically without any user intervention.
This could be accomplished by loading the scripts in a batch file. But how do we execute a batch file using LaunchApp. We have to use InstallShieldX and not any other project type. Pl. help...
Regards....venkat

Perotin

Perotin
  • Full Members
  • 407 posts

Posted 02 November 2004 - 13:42

You may run the batch file directly or use "command.com" or "cmd.exe" with the batch file as parameter ...
Start it as every normal application with path and name and parameters.

But is there no program like isql.exe which you can use to patch the database?
Gruß / regards
Thomas

Perotin

Perotin
  • Full Members
  • 407 posts

Posted 02 November 2004 - 13:44

btw: why are you posting the same question there times???
Gruß / regards
Thomas

udayms

udayms
  • Members
  • 4 posts

Posted 02 November 2004 - 14:43

Hi All,
I have done this halfway. I have a batch file that will create the tables in a DB. But, I am stuck at one point. I want to pass the DB name, Username, Password as command line arguements of the batch.

I have created a dialog to accept these values form the user. Now, my problem is how do I pass those values as a arguements to this batch file. My doubt is not at the batch file level. My doubt is how to get these values into the executeProcess properties which I am plan to use to execute the batch file.

Any ideas?

-Uday

udayms

udayms
  • Members
  • 4 posts

Posted 03 November 2004 - 04:43

Hi All,
I just got the answer for my question from the installshield.com community forum. If anyone is still stuck with this problem. Just reply. i will be happy to post a detailed how-to on creating DB tables from command prompt using values accepted from the user during installation.

-Uday

Perotin

Perotin
  • Full Members
  • 407 posts

Posted 04 November 2004 - 13:23

this may depend on the database ...

we had this once with a sybase database and the batch call was like
CODE
szProgram = svDir ^ "SQLANY50\\WIN32\\ISQL.EXE";
szParam = " -c \"uid=userid;pwd=password;dbf=database\" sql_command_file -q";
nResult = LaunchAppAndWait( szProgram, szParam, WAIT );


So look into your database tools like isql for the parameters you can use for automatic login ...
Gruß / regards
Thomas

aarvee50

aarvee50
  • Members
  • 4 posts

Posted 05 November 2004 - 07:48

hai guys,
I was able to execute the batch file from installshield with some issues. When I use cmd.exe as the program, then the system hangs and a Fatal error appears. This doesn't happens very frequently. But when it occurs, then I have to restart the machine. Can anyone tell me is there a problem using CMD.EXE or is there any other solution for this...
Thanks.....venkataraman.r

farrukh

farrukh
  • Full Members
  • 11 posts

Posted 07 January 2005 - 13:23

QUOTE (aarvee50 @ 2004-11-05 06:48)
hai guys,
            I was able to execute the batch file from installshield with some issues.  When I use cmd.exe as the program, then the system hangs and a Fatal error appears.  This doesn't happens very frequently.  But when it occurs, then I have to restart the machine.  Can anyone tell me is there a problem using CMD.EXE or is there any other solution for this...
Thanks.....venkataraman.r

Hello,
Try this. I am running this Bat file successfully in my setup project.

szBatFilePath=CommonFilesFolder ^ "My Shared File";
ChangeDirectory (szBatFilePath);
LaunchAppAndWait("Register.bat", "",WAIT);

This would launch your Bat file and will wait for its completion. I tested this on Windows 2000, and currently working in DevStudio 9.

Regards
Farrukh






amitha

amitha
  • Full Members
  • 4 posts

Posted 02 January 2009 - 07:48

QUOTE (udayms @ 2004-11-03 04:43)
Hi All,
I just got the answer for my question from the installshield.com community forum. If anyone is still stuck with this problem. Just reply. i will be happy to post a detailed how-to on creating DB tables from command prompt using values accepted from the user during installation.

-Uday

even i am interested in passing params to a batch file and run it from installscript.
Please help.
i want to run batchfile and pass a product code to it.
The batch file inturn will uninstall the product using msiexec