user310291
user310291

Reputation: 38228

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

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 this would be a violation security.

I went here http://omaha.googlecode.com/svn/wiki/OmahaOverview.html and read

New Install

User downloads a meta-installer from a Google website, going through standard browser file download steps. Once the user figures out how to launch the meta-installer, the meta-installer installs and runs the Omaha client. On Windows platforms, such as Windows Vista, with UAC, an elevation prompt is displayed when installing applications per-machine. The client then begins downloading and installing the app referenced by the micro reference.

But on a brand new machine I didn't install any meta-installer, still Chrome did install automatically. How is this possible ?

Seems it's a mystery: nobody has no real clue.

About ClickOnce as far as I can see User is shown a popup which asks confirmation, this is not the case of Google Chrome.

Upvotes: 11

Views: 5148

Answers (5)

Marcus Mangelsdorf
Marcus Mangelsdorf

Reputation: 3090

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.

Upvotes: 0

CodeNaked
CodeNaked

Reputation: 41403

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.

Upvotes: 8

Mark Ransom
Mark Ransom

Reputation: 308530

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.

Upvotes: 4

Henk Holterman
Henk Holterman

Reputation: 273844

For .net, check out click once deployment.

Upvotes: 1

Kalman Speier
Kalman Speier

Reputation: 1947

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

Upvotes: 2

Related Questions