Pascal Scripting with Inno Setup

Discussion in 'AutoCAD' started by Dale Levesque, Aug 22, 2003.

  1. In INNO setup I'd like to abort setup if AutoCAD is running. I would like to
    use the function "FindWindowByWindowName(const WindowName: String):
    Longint;" to determine whether AutoCAD is running in the InitializeSetup()
    function. Does anyone know what window name to use for AutoCAD? Theres also
    a FindWindowByClassName(const ClassName: String): Longint;" function if
    anyone knows the class name.

    Does anyone have any better suggestions?

    Thanks,

    D.M. Levesque
     
    Dale Levesque, Aug 22, 2003
    #1
  2. You don't have to go to that extents, not
    to mention that it doesn't work reliably
    since you can't count on exactly what the
    AutoCAD window's caption might be.

    You just need this:

    uses
    ComObj, ActiveX;

    Function IsAutoCADRunning: Boolean;
    begin
    Result := True;
    try
    GetActiveOleObject('AutoCAD.Application');
    except
    Result := False;
    end;
    end;
     
    Tony Tanzillo, Aug 23, 2003
    #2
  3. Thanks again Tony but one question. I'm very new to Pascal scripting and I'm
    unsure as to how to indicate that the function requires ComObj and ActiveX.

    I tried pasting:

    uses
    ComObj, ActiveX;

    just above the function but that didn't work.

    Best regards,

    Dale
     
    Dale Levesque, Aug 25, 2003
    #3
  4. Thanks Ray. That app seems to work fine but it's resulting class name
    doesn't seem to work as far as my code goes.

    Dale
     
    Dale Levesque, Aug 25, 2003
    #4
  5. The Pascal script that's being used in Inno Setup 4 (which is
    what I assume you're using) doesn't support ActiveX or 'uses",
    so what I showed isn't going to work. I didn't even know that
    version 4 had it, but it's still beta anyway.

    --
    http://www.acadxtabs.com


     
    Tony Tanzillo, Aug 26, 2003
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.