Detecting if WebView2 Runtime is installed

1,819 views
Skip to first unread message

Andrew Truckle

unread,
Jul 11, 2021, 4:01:28 PM7/11/21
to innosetup
They provide detailed instructions of how to detect if webview2 runtime is installed.

Could this be inbuilt into the inno setup compiler? 

Andrew Truckle

unread,
Jul 12, 2021, 8:30:34 AM7/12/21
to innosetup

Martijn Laan

unread,
Jul 12, 2021, 8:47:27 AM7/12/21
to inno...@googlegroups.com
Op 11-7-2021 om 22:01 schreef Andrew Truckle:
They provide detailed instructions of how to detect if webview2 runtime is installed.

Could this be inbuilt into the inno setup compiler?

Wouldn't you just write:

Check: RegKeyExists(HKLM, 'Sofware\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}')

Greetings,
Martijn
Message has been deleted

Andrew Truckle

unread,
Jul 12, 2021, 9:38:28 AM7/12/21
to innosetup
I think I check you now. About using that as a check parameter on the line in the script. But, assuming my intention is:

1. If runtime not installed ..
2. If 64 o/s then download both 32 and 64 bit runtimes for install.
3. If 32 o/s then download 32 bit runtime.
4. At end of install, run the installers setups if they were downloaded. 

At which point do I add this check code?

On Monday, 12 July 2021 at 14:19:23 UTC+1 Andrew Truckle wrote:

Ok, but how would that fit in context of a sample script?

Thanks.

Martijn Laan

unread,
Jul 12, 2021, 9:41:14 AM7/12/21
to inno...@googlegroups.com
Op 12-7-2021 om 15:38 schreef Andrew Truckle:
At which point do I add this check code?

In a PrepareToInstall event function.

Greetings,
Martijn

Andrew Truckle

unread,
Jul 12, 2021, 11:16:09 AM7/12/21
to inno...@googlegroups.com

So you run the check in PTI and cache the result into a global var.  Then where I already add files for download (NextButtonClick  (CurPageID wpSelectTasks) I add these files to the list.

 

At the moment I fire any downloaded installers in CurStepChanged (CurStep = ssPostInstall).

 

I will try it out,

 

Thanks.

 

Sent from Mail for Windows 10

--
You received this message because you are subscribed to a topic in the Google Groups "innosetup" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/innosetup/_SfytB8FGdI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to innosetup+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/innosetup/3ca9f12d-7f62-9eeb-b5d8-9c5dd80727e5%40gmail.com.

 


Virus-free. www.avast.com

Martijn Laan

unread,
Jul 12, 2021, 11:32:43 AM7/12/21
to inno...@googlegroups.com
Op 12-7-2021 om 17:16 schreef Andrew Truckle:

So you run the check in PTI and cache the result into a global var.


You should do the download from within PrepareToInstall as well.

When PrepareToInstall finishes all your prerequisites should be installed.

Greetings,
Martijn

Andrew Truckle

unread,
Jul 12, 2021, 1:25:11 PM7/12/21
to inno...@googlegroups.com

I do it there because I also have a task that allows the user to specify if another file should also be included in the downloads:

 

function NextButtonClick(CurPageID: integer): boolean;

begin

                Result := True;

  if (CurPageID = wpSelectTasks) then

  begin

    DownloadPage.Clear;

    if (dotNetNeeded) then

    begin

      { We need to download the 4.6.2 setup from the Microsoft Website }

      dotNetRedistPath :=

        ExpandConstant('{tmp}\NDP451-KB2858728-x86-x64-AllOS-ENU.exe');

      AddFileForDownload(dotnetRedistURL, 'NDP451-KB2858728-x86-x64-AllOS-ENU.exe', '');

    end;

 

    if (bVcRedist64BitNeeded) then

    begin

      { We need to download the 64 Bit VC Redistributable from the Microsoft Website }

      vcRedist64BitPath := ExpandConstant('{tmp}\vc_redist.x64.exe');

      AddFileForDownload(vcRedist64BitURL, 'vc_redist.x64.exe', '');

    end;

 

    if (bVcRedist32BitNeeded) then

    begin

      { We need to download the 32 Bit VC Redistributable from the Microsoft Website }

      vcRedist32BitPath := ExpandConstant('{tmp}\vc_redist.x86.exe');

      AddFileForDownload(vcRedist32BitURL, 'vc_redist.x86.exe', '');

    end;

 

    if (WizardIsTaskSelected('downloadhelp')) then

      AddFileForDownload('{#HelpDocSetupURL}', 'HelpDocSetup.exe',

                                                '{#GetSHA256OfFile("..\HelpNDoc\CHM\Output\MSAHelpDocumentationSetup.exe")}');

  end

    else

  if (CurPageID = wpReady) then

  begin

    DownloadPage.Show;

    try

      try

        DownloadPage.Download;

        Result := True;

      except

        SuppressibleMsgBox(

          AddPeriod(GetExceptionMessage), mbCriticalError, MB_OK, IDOK);

        Result := False;

      end;

    finally

      DownloadPage.Hide;

    end;

  end;

end;

 

This code does not account for the WebView2 Runtime yet.

 

Sent from Mail for Windows 10

 

From: Martijn Laan
Sent: 12 July 2021 16:32
To: inno...@googlegroups.com
Subject: Re: Detecting if WebView2 Runtime is installed

 

Op 12-7-2021 om 17:16 schreef Andrew Truckle:

--

You received this message because you are subscribed to a topic in the Google Groups "innosetup" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/innosetup/_SfytB8FGdI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to innosetup+...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages