Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2004
    Posts
    2

    Actions/After Install/ Batch file not working

    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

  2. #2
    Join Date
    Apr 2001
    Location
    Haverhill, Suffolk, UK
    Posts
    360
    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

  3. #3
    Join Date
    Oct 2004
    Posts
    2
    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!

  4. #4
    Join Date
    Apr 2001
    Location
    Haverhill, Suffolk, UK
    Posts
    360
    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! ]

    Rgds John

  5. #5
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    939
    I'm working with SUF7 now, but your question made me curious.

    I created a simple BAT file:

    Code:
    :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:

    Code:
    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?

  6. #6
    Join Date
    Apr 2001
    Location
    Haverhill, Suffolk, UK
    Posts
    360
    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

  7. #7
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    939
    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.)

Similar Threads

  1. HOWTO: Download and Install Files from the Web
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-23-2002, 01:16 PM
  2. HOWTO: Make a Batch File Close Automatically
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-10-2002, 10:17 AM
  3. Can search allow manual browse even if file is found?
    By RichardShaw in forum Setup Factory 5.0
    Replies: 2
    Last Post: 08-28-2000, 06:08 PM
  4. Replies: 0
    Last Post: 08-17-2000, 02:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts