How does Google Chrome manage to execute installation automatically after download?

前端 未结 5 859
野趣味
野趣味 2021-02-08 07:01

When you download google chrome one can check automatic install of exe. How to achieve that for win32 exe and .net exe ?

I wonder how they can do this since I thought th

相关标签:
5条回答
  • 2021-02-08 07:24

    For .net, check out click once deployment.

    0 讨论(0)
  • 2021-02-08 07:27

    As this superuser answer points out, they actually use ClickOnce to install their download manager:

    It actually is ClickOnce.

    function installViaClickOnce(opt_navDocument) {
        queueThankyou(10000, '\x26clickonceinstalled=', opt_navDocument);
        downloadInstaller(areStatsEnabled(),
                          _GU_buildClickOncePath,
                          "/update2/installers/clickonce/GoogleInstaller_en.application");
        showThrobber(true);
    }
    

    Google's ClickOnce application installs the installer for Chrome which in turn does the download for the browser.

    0 讨论(0)
  • 2021-02-08 07:36

    Google Chrome has a service that runs in the background to check for and apply upgrades. It is open source and you can use it for your applications as well.

    As far as the original installation, there appears to be three methods that the download pages supports: "oneclick", "clickonce", and a plain old download. With the last one, you have to manually save and run the installer.

    The first one appears to depend on if you have Google Desktop, Gears, or Toolbar installed. This link describes the installation of a Google Video Chat application, which uses a similar installation process.

    When you click the button:

    Then what the script exectued behind is:

    window.google.update.oneclick.install (install via click)

    and

    location.href = http://dl.google.com/googletalk/googletalkplugin/GoogleVoiceAndVideoSetup.exe (install manually )

    Note the first bit of script window.google , A new object for google, which is created as the result of any one of the above mentioned google services. My Chrome Browser (Since he is a new member) does not know about the window.google (he knows the default methods like window.location, window.document)

    You can view the source of the Chrome installation page here, or using your browser. But you can see it uses a similar process.

    It can fall back to the ClickOnce installation, which will most likely prompt the user before installing. But this depends on your security settings.

    This actually appears to be duplicate of a Super User Question.

    0 讨论(0)
  • 2021-02-08 07:38

    If you are asking about the setup, they are using ClickOnce.

    0 讨论(0)
  • 2021-02-08 07:40

    Chrome does not install itself in the usual Program Files folder, which is protected. It puts itself in your user profile where it can be updated without elevation.

    0 讨论(0)
提交回复
热议问题