Announcement

Collapse
No announcement yet.

WebObject: file gets reexecuted after page switch

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

  • WebObject: file gets reexecuted after page switch

    Trying for hours...I have set up a automenu installer (4.0.0.0) with several pages which contain WebObjects (localy stored HTML pages). Since I want to execute setup files from local disk when user clicks on HTML link, I did the following:

    EXAMPLE:

    WebObject: HTMLdrivers
    - On Navigate Complete

    %myURL% = WebBrowserObject(HTMLdrivers).GetProperty ("URL")
    %myURL% = String.Right ("myURL%",5)
    IF (%myURL% = "file1")
    File.Execute ("%SrcDir%\Drivers\setup.exe","",Continue)
    END IF

    File: HTMLdrivers.htm
    ...
    <a href="HTMLdrivers.htm?file1">
    ...

    This works fine with only one exception which is bothering me; if you click on link, file gets executed; OK; then you cancel this executable, OK; you than go to other page; OK; and back to the previous page; TROUBLE; file which was last executed on this page gets executed again, automatically.
    The question is, how to prevent this. I tried many things but none worked. Please advise

    And, have a great weekend, here we will have, it is snowing mad...

    Blaz

  • #2
    Re: WebObject: file gets reexecuted after page switch

    The problem is the WebObject is showing the last page you were on. In the Page Show event, set the base HTM file by using:

    WebBrowserObject[WebBrowser1].NavigateTo ("%SrcDir%\YOURFIRSTFILE.htm")

    Only other thing I can think of is to set a registry setting that indicates the user already has executed the EXE and using that setting as a basis for launching the EXE or not.

    Comment


    • #3
      Re: WebObject: file gets reexecuted after page switch

      Yes! that did it, thanks again.

      Comment

      Working...
      X