Results 1 to 3 of 3

Thread: Launch an Application

  1. #1
    Join Date
    Jan 2008
    Posts
    20

    Unhappy Launch an Application

    I am using Installshield professional 2008 .I want to install an exe which is will come in the custom option of the setup type.

    I wrote the neccessary code in the Program_installed event
    The PROGRAM is pointing to a exe on the local file system.


    function Program_Installed()
    NUMBER nWait;
    begin

    //if (LaunchAppAndWait (PROGRAM, "", nWait) < 0) then
    if (LaunchApp (PROGRAM,"") < 0) then
    MessageBox ("Unable to launch "+ PROGRAM +".",SEVERE);
    endif;
    end;
    But it always gives me an error. says cannot launch exe.Please help asap

  2. #2
    Join Date
    Mar 2006
    Location
    Kent, United Kingdom
    Posts
    102
    Hi,

    First of all check that the file exists. Even if your 100% sure it does, it's always a good check to make!

    Code:
    nReturn = Is( FILE_EXISTS, sYourProgram );
    MessageBox( "File Exist returns: " + FormatMessage( nReturn ), WARNING );
    if ( nReturn = 1 ) then
      nReturn = LaunchAppAndWait( sYourProgram, "", LAAW_OPTION_WAIT );
      MessageBox( "LaunchAppAndWait returns: " + FormatMessage( nReturn ), WARNING );
    endif;
    FormatMessage() will turn the return value into a string telling you what a function returned. I personally don't use it as I use the debugger, but it might help you!

    Where abouts are you calling this bit of code? Are you certain it's called AFTER the file has been installed?

    Let us know what the two calls return!
    Regards,

    William Webb
    Planit International Ltd.

  3. #3
    Join Date
    Jan 2008
    Posts
    20

    Launch an Exe through installscripts

    Hi William,

    thanks for your help it worked
    The first called returned "Invalid Function" and the second one returned
    "The operation completed successfully".


    I am trying to install files lke creating a directory structure then installing a third party exe file so am calling this under onFirstAfterUI() event so at the end of the progress screen this shall call the third party exe and install it...

    Have a great week end

    thanks,
    Hemant.


    Quote Originally Posted by William-Webb View Post
    Hi,

    First of all check that the file exists. Even if your 100% sure it does, it's always a good check to make!

    Code:
    nReturn = Is( FILE_EXISTS, sYourProgram );
    MessageBox( "File Exist returns: " + FormatMessage( nReturn ), WARNING );
    if ( nReturn = 1 ) then
      nReturn = LaunchAppAndWait( sYourProgram, "", LAAW_OPTION_WAIT );
      MessageBox( "LaunchAppAndWait returns: " + FormatMessage( nReturn ), WARNING );
    endif;
    FormatMessage() will turn the return value into a string telling you what a function returned. I personally don't use it as I use the debugger, but it might help you!

    Where abouts are you calling this bit of code? Are you certain it's called AFTER the file has been installed?

    Let us know what the two calls return!

Posting Permissions

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