Posted 22 June 2005 - 18:13
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.
Posted 22 June 2005 - 18:44
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.
Posted 28 June 2005 - 14:31
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.
Posted 28 June 2005 - 15:25
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
Posted 28 June 2005 - 21:57
You have to place both parameters in a string separated by a space. Then use this string with LaunchAppAndWait function.
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.