Solved

How to restart Internet Explorer during Inno Setup installation?

Posted on 2007-04-04
3
1,724 Views
Last Modified: 2008-02-07
My inno setup installs an Internet Explorer toolbar and I need to be able to restart IE from Inno Setup.  Does anyone know how to do this?
0
Comment
Question by:frankmorrison
  • 2
3 Comments
 
LVL 18

Expert Comment

by:mirtheil
ID: 18854500
Why do you need to restart just Internet Explorer?  If the toolbar is already installed and in memory, you should use the "restartreplace": flag and it'll be replaced when the machine is restarted.
0
 
LVL 1

Author Comment

by:frankmorrison
ID: 18854669
I don't need to restart the entire machine. I just need to restart IE.
0
 
LVL 18

Accepted Solution

by:
mirtheil earned 500 total points
ID: 18854726
I found the following (at http://news.jrsoftware.org/news/innosetup/msg52880.html) but haven't tested it.  

Page1 := CreateCustomPage(wpWelcome, ...
RadioButton1 := TRadioButton.Create(Page1);
RadioButton1.Parent := Page1.Surface;
RadioButton1.Caption := 'Close all Internet Explorer windows automatically';


function NextButtonClick(CurPageID: Integer): Boolean;
var
  hWnd, prevhWnd, i: Integer;
begin
  if (CurPageID = Page1.ID) and RadioButton1.Checked then begin
    prevhWnd := 0;
    hWnd := FindWindowByClassName('IEFrame');
    while (hWnd > 0) do begin
      PostMessage(hWnd, 16, 0, 0);
      prevhWnd := hWnd;
      hWnd := FindWindowByClassName('IEFrame');
      if (prevhWnd = hWnd) then begin
        for i := 1 to 10 do begin
          hWnd := FindWindowByClassName('IEFrame');
          if (prevhWnd = hWnd) then
            Sleep(100);
        end
        if (prevhWnd = hWnd) then
          hWnd := 0;
      end
    end
  end
  Result := True;
end;

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been scripting applications way too long and can never remember how to create an ISS file.  So I decided to write this article to act as my own knowledge base for future reference, and hope you will also benefit. An ISS file is a response …
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question