Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 12 of 12
  1. #1
    Join Date
    Jun 2002
    Location
    Melbourne, Australia
    Posts
    19

    Problem running File.Run

    Hi SF7 forum.

    I am currently having a problem with the File.Run command in SF7.

    Basically, when the generated setup program is run, I want to execute an existing program to perform some actions prior to the installation continuing.

    When I run it manually it works fine, but if I run it via File.Run, it always fails with 'File Execution Failed'.

    At first I tried the following code:

    result = File.Run(SessionVar.Expand("%AppFolder%\\TP Systray Remover.exe"), "", "", SW_MINIMIZE, true);

    And it tried to run a program called TP instead, so I assumed the spaces were the problem.

    I then tried the following code:

    prog2run = SessionVar.Expand("%AppFolder%\\TP Systray Remover.exe");
    result = File.Run("prog2run", "", "", SW_MINIMIZE, true);

    I have checked the value of prog2run in a debug window and it is correct, however, it always fails to run.

    Any guidance would be greatly appreciated.

    Thanks in advance.

    I am running SF7.0.5.1

    Regards,
    Casman.

  2. #2
    Join Date
    Mar 2005
    Location
    WA 'wait a while' - Australia
    Posts
    872
    rename your the project 'source file' to this: TP_Systray_Remover.exe

    (or rename the executable to something without any spaces)

  3. #3
    Join Date
    May 2000
    Location
    Indigo Rose Software
    Posts
    2,150
    casman,

    At what point in the install are you calling this file? Keep in mind that if you are going to reference a file that is being installed then it has to be done After the files are installed.

    Another good way to debug is hard code the path to the file in the File.Run action. Once you get it working with a hard coded value then get it working with the variable.

    Adam Kapilik.

  4. #4
    Join Date
    Oct 2005
    Location
    MI
    Posts
    524

    just a thought...

    You could also take a crack at calling your executable using the Shell.Execute() action instead of File.Run()...
    Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

    ()))))))))o)))))))==============================================

  5. #5
    Join Date
    Jun 2002
    Location
    Melbourne, Australia
    Posts
    19
    Hello all.

    Thank you for the responses.

    To Eagle. Unfortunately I cannot rename the executable name as it is used in a number of applications.

    To TJS, I'll give this a go.

    To Adam.

    The setup is actually used to Install and Update the application. If the application is installed, then my setup needs to check if a program is running in the systray. If it is, then I was trying to use the File.Run to run my program to remove the offending program from the systray prior to the Update.

    That's when I ran into this problem.

    I issue the File.Run on a 'Ready To Install' just prior to the 'Next' button being hit, so the systray entry is removed prior to the install actually starting to overwrite the executables.

    Regards,
    Chris Balakas

  6. #6
    Join Date
    Jun 2002
    Location
    Melbourne, Australia
    Posts
    19
    Thank you all for your suggestions.

    I tried using Shell.Execute and it has solved my problem.

    Regards,
    Casman.

  7. #7
    Join Date
    Jan 2002
    Location
    Nashville TN
    Posts
    328
    PHP Code:
    result File.Run(SessionVar.Expand("%AppFolder%\\TP Systray Remover.exe"), """"SW_MINIMIZEtrue); 
    I think your problem is you need "quotes" because of the space in the file name.

    Try:
    PHP Code:
    result File.Run(SessionVar.Expand('"%AppFolder%\\TP Systray Remover.exe"'), """"SW_MINIMIZEtrue); 

  8. #8
    Join Date
    Jun 2002
    Location
    Melbourne, Australia
    Posts
    19
    Hi Jason.

    I tried your code:

    result = File.Run(SessionVar.Expand('"%AppFolder%\\TP Systray Remover.exe"'), "", "", SW_MINIMIZE, true);

    This seems to have solved my problem. I can now run the program, wait for it to complete and then continue the setup.

    I have not seen the technique used whereby you encircle the string in both single and double quotes.

    Thanks for your help.

    Regards,
    Casman.

  9. #9
    Join Date
    Jan 2002
    Location
    Nashville TN
    Posts
    328
    Sweet, Windows usually requires quotes in any path that has spaces, and it can easly be over looked. Good luck.

  10. #10
    Join Date
    Oct 2005
    Location
    MI
    Posts
    524
    Funny... would %20% have resolved the issue as well???
    Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

    ()))))))))o)))))))==============================================

  11. #11
    Join Date
    Oct 2005
    Location
    MI
    Posts
    524
    DOS appreviation should work too:

    \\TPSyst~1.exe
    Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

    ()))))))))o)))))))==============================================

  12. #12
    Join Date
    Jan 2002
    Location
    Nashville TN
    Posts
    328
    Never Tried either only have used quotes I guess sticking with what I know that works. And with scripting I like to be spectific. But not a bad idea.
    Last edited by Jason Pate; 03-28-2006 at 10:25 AM.

Similar Threads

  1. File.Run script problem
    By naruto in forum AutoPlay Media Studio 6.0
    Replies: 1
    Last Post: 02-13-2006, 07:07 PM
  2. File.run _sourcefolder problem
    By SpudGunMan in forum AutoPlay Media Studio 5.0
    Replies: 26
    Last Post: 09-07-2004, 06:32 PM
  3. PROBLEM: Setup Starts and then Crashes
    By Support in forum Setup Factory 5.0
    Replies: 0
    Last Post: 10-15-2002, 03:02 PM
  4. PROBLEM: Setup Requests Disk 2 in a Single File Setup
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-09-2002, 02:04 PM
  5. INFO: Tips for Debugging Action Lists in AutoPlay Media Studio 4.0
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-03-2002, 08:38 AM

Posting Permissions

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