View Full Version : Actions/After Install/ Batch file not working
sputnik1
10-14-2004, 11:02 AM
Hi
I've got an Execute command in an After Installing Action, which called from DOS executes fine, however it does not work from SF6.
The execute line goes;
C:\Program Files\MyApp\service.bat %LANHost%
path is set to C:\Program Files\MyApp
So all this does is execute the batch file as follows;
runas /u:%1\Administrator "c:\Program Files\MyApp\App.Exe -Start" | sanur password
The sanur untility is located in the same folder and as mentioned above, this works fine when called from the command line in the folder. Sanur just applies the password to runas if you don't already know.
The install log shows that service.bat executed OK. I am confused. Please could you give me some idea of why this does not work. I've tried lots of different combinations of things all afternoon.
Regards, Brian
JXBURNS
10-14-2004, 01:48 PM
Have you ticked the box to tell the system to wait for the batch file to run before continuing? It could be terminating early.
The other problem could be your system is not able to locate the command intepreter correctly.
You could try putting (if running in XP for example)
C:\WINDOWS\system32\cmd.exe /C C:\Program Files\MyApp\service.bat %LANHost%
I'm not sure whether SUF6 will allow everything from /C onwards to be part of the command line or whether should go as a parameter. You may have to experiment and may not work at all as the system may get totally confused as to what the parameters are either at command interpreter level or your batch file.
John
sputnik1
10-15-2004, 03:23 AM
Thanks for the suggestions John. Just tried them this morning and no joy, I really can't understand what is happening, the log shows the correct syntax and successful execution, but it's just not being processed.
Perhaps I'll just bang my head against the wall a few times, things always look better then! ;)
JXBURNS
10-15-2004, 04:24 AM
The other obvious answer is why use a batch file at all. Could you not replicate the same commands from within SUF6?
[ Not sure head banging is the right thing to do - my teenage son does that listening to weird "modern" music and I can't get a sensible answer out of him afterwards! :lol ]
Rgds John
csd214
10-15-2004, 04:39 AM
I'm working with SUF7 now, but your question made me curious.
I created a simple BAT file:
:SF6Test.bat
@echo off
cls
echo %0 has started
echo .
if "%1" == "" goto noprm
echo %1 recognized as parameter 1
goto end
:noprm
echo No parameter received
:end
echo .
pause
SF6 project, Actions, Startup:
Execute (%SrcDir%\SF6Test.bat)
Show Message Box(DOS command should now have finished)
Abort Setup
Execute command details:
File to execute: %SrcDir%\SF6Test.bat
Command line arguments: %LANHost%
CHECKED "Wait for program to finish running before continuing."
It works! Something I have missed?
JXBURNS
10-15-2004, 10:03 AM
CSD, I think the problem may be related to the fact the batch file is calling another program itself not just interrogating the parameter as in your example.
Personally if I do that I put a CALL ... in the command line otherwise often the called program does not return to the batch file calling it correctly.
But I will be interested in the answer re why not call the program direct from SUF6. Seems pointless to go from 32-bit technology to 8-bit and presumably back to 32-bit when it all can be done inside SUF6.
Rgds John
csd214
10-15-2004, 12:07 PM
It's a long time since the batch file days...
If the batch file is calling another batch file, CALL is mandatory (as far as I remember).
I agree; it no batch file is needed, why use it? (The intention with my simple project was to demonstrate: There is nothing wrong with the SUF6 side.)
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.