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

Function question


5 replies to this topic

tagman

tagman
  • Members
  • 6 posts

Posted 22 June 2005 - 18:13

Hi all, I am very new to installscript. So any help would be great.

Is there a function or a way to have a installation run a batch file?

Poking around I noticed a lot of funciton for manipulating batch files but I did not see one that would run one.

Thanks in advance.

Xitch13

Xitch13
  • Members
  • 134 posts

Posted 22 June 2005 - 18:44

You just use the launch app function. Here's a batch file I call to create the database for our product

CODE

LaunchAppAndWait(TARGETDIR ^ "CreateDatabase.bat", "", LAAW_OPTION_WAIT | LAAW_OPTION_HIDDEN);



Note: at this point I have already installed the files on the target machine, but you do not necessarily have to do so. You just need to give the path of where the uncompressed file resides. I've also told the program to wait while it's being installed and to perform it in the background so a DOS window does not pop up.
There is great chaos under heaven, and the situation is excellent. (Mao Tse Tung)

tagman

tagman
  • Members
  • 6 posts

Posted 22 June 2005 - 19:19

Thanks a lot!

I will give it a try.

tagman

tagman
  • Members
  • 6 posts

Posted 28 June 2005 - 14:31

The LaunchAppAndWait function is working for my needs.

But I need to pass two command line parameters to my batch file.

Passing one is easy, but I can't seem to figure out how to specify more than one.

Anyone got any advice?

Thanks for reading.

Xitch13

Xitch13
  • Members
  • 134 posts

Posted 28 June 2005 - 15:25

I've never had to pass more than one parameter to those commands lines. So I don't have any first hand knowledge.

What I would do is create a very small installer that all it does is call that line, and then try diffent combinations in the parameter section (ie. "i -e", "-i -e", " i,e"). Also you may want to check the documentation on the batch file you are trying to run.

Let me know if those work, and if not maybe I can give you more guidance
There is great chaos under heaven, and the situation is excellent. (Mao Tse Tung)

tagman

tagman
  • Members
  • 6 posts

Posted 28 June 2005 - 21:57

I was able to pass two parameters! biggrin.gif

You have to place both parameters in a string separated by a space. Then use this string with LaunchAppAndWait function.

CODE

cmdArgs = arg1 + “ “ + arg2;

LaunchAppAndWait(TARGETDIR ^ "filename.bat", cmdArgs, LAAW_OPTION_WAIT | LAAW_OPTION_HIDDEN);


Interesting note: Make sure your arguments don’t have spaces in them. This will through things off. I was trying to pass an absolute path to a file and there were spaces in some of the directory names. Once I change the path to use short names. It worked! This seems obvious now but I thought I would mention it. I guess it would also work if you enclose each argument with quote characters in the string.

Thanks Xitch13 for pointing me in the right direction.