Link to home
Start Free TrialLog in
Avatar of pnoeric
pnoericFlag for United States of America

asked on

InnoSetup error: "


I have an InnoSetup script that is failing when I try to compile it...

The error is: "Unknown Identified 'InstExec'" -- on the line below that starts "bres := InstExec".

This is the part of the code failing:

procedure CurPageChanged(CurPage: Integer);
var
ResultCode :Integer;
err:String;
bres:Boolean;
begin
  if ((CurPage = wpInfoAfter) and (EditorOpened = False)) then begin
       EditorOpened := True;
       bres := InstExec( 'notepad.exe' , GetJRELibSecurityDir('')+'\java.security',GetJRELibSecurityDir(''),True, False, SW_SHOWNORMAL, ResultCode);
       if (ResultCode <> 0) then begin
          err :=  SysErrorMessage(ResultCode);
          MsgBox(err, mbError, mb_Ok);
       end;

  end;
end;
procedure CurStepChanged(CurStep: Integer);
begin
 // if CurStep = csFinished then
 //   FinishedInstall := True;
end;


I'm not sure what's up, isn't that sort of like Inno's equivalent of a syntax error? This script compiled for others so I am not sure how my setup differs.

I'm on InnoSetup Compiler 5.0.8 (ISPP 5.0.6.0)

thank you for any help

best
Eric
ASKER CERTIFIED SOLUTION
Avatar of Cayce
Cayce
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pnoeric

ASKER

How silly, to totally cut an old function instead of depreciating it. Argh.

Anyhow, I tried changing 'InstExec' to 'Exec' and that didn't fix it-- no surprise since there's a different prototype now.

The error message I get now on that line is "Variable Expected."

I didn't write this script but I gotta get it working :-) Can someone help me make the change to this line of code so it'll go through?
Here's an example:

procedure ApacheServiceStop();
var
    bRetVal: Boolean;
    ErrorCode: Integer;
begin
    bRetVal := Exec('cmd.exe', '/C apache -k stop', g_sApachePathBin,
                             SW_HIDE, ewWaitUntilTerminated, ErrorCode);
end;
Avatar of pnoeric

ASKER

eh, I ended up just downloading InnoSetup 4 and it works great. Thanks for the tip. Those were some easy, fast points ;-) E
Well, they would have been if I ever have used InnoSetup :P
Avatar of pnoeric

ASKER

Yeah, I didn't see that note about Exec/InstExec in the changelog when I looked on the site, so regardless, you solved my problem (quickly)... worth it for me. (Yet another example of how pricing is all about the value to the consumer, not what the seller puts into the product-- but I digress!)