Announcement

Collapse
No announcement yet.

Failing with Petri "Create Exe Wrappers with iExpress"

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Failing with Petri "Create Exe Wrappers with iExpress"

    I thought Daniels article "Create Executable Wrappers with IExpress in XP" was the perfect answer to my needs. But I can't make it work. The executable runs but does nothing.

    All I am trying to do is create an .exe that launches another .exe. I'm trying to keep the multimedia elements tied to the target .exe hidden.

    I created a .bat, "foo.bat": START FOO.EXE (This works outside of IExpress)
    I created another .bat, "run.bat": cscript foo.bat

    I stepped through IExpress and chose "run.bat" and <none>.
    IExpress builds the new .exe, but on execution I get a brief black dos window and foo.exe does not launch. (Again the foo.bat successfully launches my app outside of IExpress.)

    I have tried dozens of variables, but am out of ideas.
    Thank you for your help in advance.

  • #2
    Re: Failing with Petri &quot;Create Exe Wrappers with iExpress&quot;

    The reason it's not working is because you're trying to use the wrong scripting engine, i.e. cscript.

    In your run.bat script try taking out cscript and see if it works then.
    Code:
    foo.bat
    Regards,
    Jeremy

    Network Consultant/Engineer
    Baltimore - Washington area and beyond
    www.gma-cpa.com

    Comment


    • #3
      Re: Failing with Petri &quot;Create Exe Wrappers with iExpress&quot;

      Thanks for your reply JeremyW.

      I followed your instruction (stripped cscript), but it continues to fail. The black box appears briefly and then nothing launches. I check Task Manager after each attempt to make sure nothing is still trying to launch and I get no error messages or anything.

      I am precisely following the instructions of the original article, except Daniel Petri instructed to use a .vbs for the command and run it with a .bat. I used a .bat for both, as I don't know vbscript or the code to start an .exe with vbscript and haven't found a sample.

      Isn't it odd that my .bat successfully launches my app outside of the iexpress wrapper?

      Daniel's article was a great find, but I continue to struggle. Thanks for your help!

      Comment


      • #4
        Re: Failing with Petri &quot;Create Exe Wrappers with iExpress&quot;

        After looking at your script I think you may need to give an absolute path in your foo.bat script. Something like this:
        Code:
        START C:\foo_files\FOO.EXE
        Obviously substitute the real path for what I put above.
        Regards,
        Jeremy

        Network Consultant/Engineer
        Baltimore - Washington area and beyond
        www.gma-cpa.com

        Comment


        • #5
          Re: Failing with Petri &quot;Create Exe Wrappers with iExpress&quot;

          Thanks Jeremy, but no change.

          I added the full path and checked to make sure the .bat worked. It did.

          Built the iexpress .exe and still get the black box briefly and then no launch.

          Believe me, I am being meticulous. This is weird.

          *****
          I just ran the run.bat on the desktop and it successfully launched foo.bat, which successfully launched my app.

          But when they are wrapped in the iexpress .exe they fail.
          Last edited by bzbz; 22nd February 2008, 19:54. Reason: Added new info.

          Comment


          • #6
            Success!!!!! with Petri &quot;Create Exe Wrappers with iExpress&quot;

            Jeremy I have success!!!! This is what I've discovered.

            - using 2 bat files evidently doesn't work in IExpress. I tried a variety of options including saving with unicode, and utf8 as opposed to ANSI. Nothing worked.

            - I searched and found a vbscript to launch a file. (I don't know vbs, and barely bat.)
            - The pulldown menu in iexpress for the file does not recognize .vbs, so you evidently have to use a .bat as the trigger, but not the script.
            - I changed my run.bat to launch my new foo.vbs. It didn't work.
            - I then added "wscript" back in prior to the target. (wscript foo.vbs) Success!
            - Then as an experiment I replaced "wscript" with "cscript". That worked also.

            The final solution appears to be... use a .bat to run a .vbs in IExpress with either wscript or cscript.

            My question for you... is there any advantage or disadvantage to using wscript or cscript?

            Thanks so much for all your help and this great forum!
            PS - I don't know how to add the rating points.

            Comment


            • #7
              Re: Failing with Petri &quot;Create Exe Wrappers with iExpress&quot;

              using 2 bat files evidently doesn't work in IExpress.
              You can use a batch to start an other batch in IExpress.

              1. start batch: [StartFoo.cmd]
              @call "Extra batch.cmd"

              2. Other batch starts a program: [Extra batch.cmd]
              @start "path\program.exe"


              But why using two batch files in IExpress??

              1. Use just the start batch, to execute the program directly: [StartFoo.cmd]
              @start "path\program.exe"


              \Rems

              This posting is provided "AS IS" with no warranties, and confers no rights.

              __________________

              ** Remember to give credit where credit's due **
              and leave Reputation Points for meaningful posts

              Comment


              • #8
                Re: Success!!!!! with Petri &quot;Create Exe Wrappers with iExpress&quot;

                Rems, you beat me to it!
                The reason for the two .bat files was because of Daniel's article seems to indicate that you need to use two files.

                bzbz, I should have added in my previous post that you need to enclose the path in quotation marks if there's a space in it.
                Regards,
                Jeremy

                Network Consultant/Engineer
                Baltimore - Washington area and beyond
                www.gma-cpa.com

                Comment


                • #9
                  Re: Failing with Petri &quot;Create Exe Wrappers with iExpress&quot;

                  Jeremy and Rems thanks so much. I've learned a lot.

                  Rems, yes the reason for two scripts is the original tutorial article that Daniel Petri wrote. I found his article after following instruction from another article that used just one script that wasn't working for me. So I thought 2 must be the answer.

                  As it turns out, for my purposes, the key to success with one script is .cmd vs .bat.
                  Using one script: @start "path\foo.exe"
                  script.bat does not work
                  script.cmd works

                  I also learned that including a path in quotes that does not have spaces does not work.
                  I'm guessing that the path includes the quotes instead of reading them as a wrapper.

                  Haven't tested, but I'm guessing all of my 2 script frustration was due to using .bat instead of .cmd and that I was not using "call". Will test that when I can.
                  **********
                  PS - How do you do reputation points?
                  Last edited by bzbz; 23rd February 2008, 22:10. Reason: Forgot something.

                  Comment


                  • #10
                    Re: Failing with Petri &quot;Create Exe Wrappers with iExpress&quot;

                    You are right! there seems to be a difference using a *.bat or *.cmd file for the "autorun" file. thanks for sharing.
                    So it is best to use the cmd extension for that batch.
                    Then in IEXPRESS on the "Install Proggram to Launch" window, you have to type the filename manually, because cmd-files do not appear on the list.

                    Using Start;
                    Use 'Start' to execute a program and you do not want the batch to wait for return.
                    It slipped my mind however that 'start' does not support quotes, so it can not start programs with spaces in the name of the file or path.

                    Workaround; convert the path and file fullname to its 'shortname notation'.
                    this startFOO.cmd file will work:
                    Code:
                    @echo off
                    Set "runapp=path\program.exe"
                    
                    If EXIST "%runapp%" (
                     FOR %%G in ("%runapp%") do Start %%~fsG.
                     )
                    
                    :: note,
                    :: Typing of shortnames for paths is not always reliable
                    Or even better:
                    Since most of the executables for programs have been given a 8.3-type file name (meaning the shortname notation would the same as the filename), you can also:
                    - make the folder of the file temporary the active folder
                    - and start the executable.
                    example:
                    Code:
                    @echo off
                    Set "runappPath=path\folder"
                    Set "runappExec=program.exe"
                    
                    If EXIST "%runappPath%\%runappExec%" (
                     PUSHD "%runappPath%"
                     Start %runappExec%
                     POPD
                     )
                    Or, simply use 'Start' to open a temp prompt, where you then can use quotes in a command-line:
                    Code:
                    @echo off
                    Set "runapp=path\program.exe"
                    
                    Start /b %comspec% /c ("%runapp%")

                    Using Call;
                    (When using 2 batch files)
                    use 'call' when you want to launch an other batch from within a batch, and you want to return and prceed the first batch.
                    In this case it is not nessesary to use 'call' because the first batch does not have other lines.


                    \Rems

                    PS - How do you do reputation points?
                    You have to be logged-on - then, on the answer(s) that helped you, click in the rightcorner of the post on the yin yang icon.
                    Last edited by Rems; 24th February 2008, 22:45.

                    This posting is provided "AS IS" with no warranties, and confers no rights.

                    __________________

                    ** Remember to give credit where credit's due **
                    and leave Reputation Points for meaningful posts

                    Comment


                    • #11
                      Re: Failing with Petri &quot;Create Exe Wrappers with iExpress&quot;

                      Thanks Rems.
                      I will do my best to digest your information.
                      I'm way behind you, but thoroughly enjoying the education.
                      All the best

                      ********
                      And thanks to JeremyW as well.
                      Last edited by bzbz; 24th February 2008, 01:11. Reason: Forgot someone.

                      Comment


                      • #12
                        Re: Failing with Petri &quot;Create Exe Wrappers with iExpress&quot;

                        Rems, it's always a learning experience for me when reading your posts.
                        Regards,
                        Jeremy

                        Network Consultant/Engineer
                        Baltimore - Washington area and beyond
                        www.gma-cpa.com

                        Comment


                        • #13
                          Re: Failing with Petri &quot;Create Exe Wrappers with iExpress&quot;

                          Originally posted by JeremyW View Post
                          Rems, it's always a learning experience for me when reading your posts.
                          ahh, just discovered more about the Start command.


                          It slipped my mind however that 'start' does not support quotes, so it can not start programs with spaces in the name of the file or path.
                          That was once my conclusion, and ever since I use one of the workourounds as presented in my previous reply when I have problems with the path name.

                          Today I typed on a dos prompt: Start /?
                          And learned that the Start command actually does support quotes around paths!
                          The fact is, that the first string that is between quotes is interpreted as the "titel" for the new cmd window. To be able to use quotes for the path, type any "Title" first (can be empty) followed by the "path\execname".
                          The command line in this case can just be:
                          Code:
                          @Start "" "path\program.exe"
                          \Rems

                          This posting is provided "AS IS" with no warranties, and confers no rights.

                          __________________

                          ** Remember to give credit where credit's due **
                          and leave Reputation Points for meaningful posts

                          Comment

                          Working...
                          X