Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 13 of 13
  1. #1
    Join Date
    Mar 2009
    Posts
    20

    Problems trying to run a file?

    I'm making a launcher program, I'm almost done, but I've run into a problem,

    I can't make my AMS program run a .exe file in the same directory as the project executable

    EXAMPLE:

    project.exe is in C:\Program (C:\Program\project.exe)

    I want my project to run start.exe which is also in C:\Program (C:\Program\start.exe)

    I can't set it to
    Code:
    result = File.Run("C:\\Program\\start.exe", "", _SourceFolder, SW_SHOWNORMAL, false);
    Because I want to give my project executable to a friend, and I don't know where his "Program" folder will be...

  2. #2
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,277
    So start.exe is in the project.exe folder and is not a webexe?

    Code:
    result = File.Run(_SourceFolder.."\\start.exe", "", _SourceFolder, SW_SHOWNORMAL, false);
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  3. #3
    Join Date
    Mar 2009
    Posts
    20

    :d

    Wow, you just made me feel stupid

    But i'm happy that someone can help

  4. #4
    Join Date
    Mar 2009
    Posts
    20

    Nevermind....

    Nevermind...

    I tried the code,, but it didn't work, I put the code into the launcher buttons "On Click" Script tab, Saved, and clicked the "Build" button and made an EXE, I tested it, and NOTHING HAPPEND D:

  5. #5
    Join Date
    Mar 2009
    Location
    -31.9554,115.85859
    Posts
    282
    Have you tried using Shell.Execute instead and are you having the same issues?

  6. #6
    Join Date
    Aug 2003
    Posts
    2,388
    The sourcefolder for .exe's is not the folder where the .exe is held.

    Put "start.exe" inside the docs folder of "project.exe" and then run it from there.

  7. #7
    Join Date
    Mar 2009
    Posts
    20

    ..........Can you read?

    I cannot do that because start.exe needs some files (VERY LARGE FILES) to run.

    so I want my friend to be able to copy project.exe to his folder that has start.exe in it, execute project.exe, and click a button to run start.exe


    (DO NOT ask me "Why do you need this? just click start.exe normally! No need for a launcher!" I am making this launcher with some extras and things AND an options to run start.exe)

  8. #8
    Join Date
    Mar 2009
    Posts
    20
    Replys Anyone?

  9. #9
    Join Date
    Oct 2007
    Location
    Gensokyo
    Posts
    1,324
    Did you export as a Web EXE?

  10. #10
    Join Date
    Jun 2007
    Location
    Delphi II
    Posts
    1,508
    Use the GlobalPaths plugin (in my signature). You can read the details of it in that topic. It will solve your path problem.
    Action Plugins
    AllOn | Box | Class | Code | Cursor | DXML | Error | Frames | GlobalPaths | Group | INIPlus |KeyBind | KeyLock | MathEx | Menu | Name | Project | Resize | StatusBar
    Download

  11. #11
    Join Date
    Mar 2009
    Posts
    20
    I just looked at the topic, I haven't tried it yet, but it looks like it should work!

    Thank you very much! (I'll post some more thanks if it actually works!)

  12. #12
    Join Date
    Mar 2009
    Posts
    20

    &^$*@($&(*?!?!?!?!?!

    It didn't work.

    Can you gvie me the code I should use for this plugin on the "On click" for my "START" button?

    (In the code, I want to use _ExeFolder and the file name should be start.exe)

  13. #13
    Join Date
    May 2007
    Location
    Sydney, Australia
    Posts
    1,546
    Try posting the .APZ file (without the .EXE you're having trouble with, and without all the additional files you want to pack in ... in other words, just the barebones launcher you're trying to build).

    That way, we can see exactly what you're having problems with, and can probably post it back with a "dummy EXE" to show you how/where to place the files you're having trouble with.

  14. #14
    Join Date
    May 2007
    Location
    Sydney, Australia
    Posts
    1,546
    In the meantime, try this ... because I have a feeling the others may have been misinterpreting exactly what you're trying to do:

    Code:
    result = File.Run(_ProgramFilesFolder .. "\\start.exe", "", "", SW_SHOWNORMAL, false);
    The _ProgramFilesFolder command is a relative path, which should solve the problem you have with not knowing the location of the target-computer's Program folder.

    In this example, I've just concatenated it straight to the start.exe. So it will only work, if the start.exe is in the root of the target-computer's Program Folder.
    (ie. C:/Program Files/start.exe).

    If however, you find that the start.exe is located in a subfolder of it own (ie. C:/Program Files/Nitro/start.exe), then you'll have to adjust it accordingly ... or if this remains as an unknown variable, then you'll have to add a File.Find or Folder.Find command beforehand, so that your AMS launcher will know where to find the start.exe.
    Last edited by mystica; 08-29-2009 at 04:08 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