twk
twk

Reputation: 17320

What is the best way for a website to check if a user has installed a client app?

Let's say I've got a website that works better if a client has installed and logged into a desktop application. I'd like to be able to do 2 things:

I'd like something that works on Windows and OSX, on any of the major browsers. Linux is a bonus.

A few thoughts:

Thanks!

Upvotes: 2

Views: 3719

Answers (5)

vaske
vaske

Reputation: 9552

Websites can detect if you've got Flash installed. How does that work and could it be used for both of my goals?

it's quite a bit simple, your browser tries to render some additional files, with some specific formats such as flash .swf and I the browser doesn't find installation, then will be start downloading, or you will get the option to download that program. Flash also uses AC_RunActiveContent.js please take a look at this js, people usually put this on their webpages

if (AC_FL_RunContent == 0) {
    alert("This page requires AC_RunActiveContent.js.");
} else {
    AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave cabs/flash swflash.cab#version=8,0,0,0','width','981','height','635','id','build5','align','middle','src','build5','quality','high','bgcolor','#ffffff','name','build5','allowscriptaccess','sameDomain','allowfullscreen','false','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','build5' ); //end AC code
}

Upvotes: 0

Franci Penov
Franci Penov

Reputation: 76021

You can have a browser plugin (activex for IE or Netscape plugin for the rest of the browsers) that can communicate with the application. When the webpage is loaded, it can try to instantiate the plugin and if it succeeded, it can use it as a proxy to the application. If it fails, then either the app is not installed or the plugin was explictly disabled by the user. Either way, your website should degrade its functionality accordingly.

Update: Forgot to answer your questions:

  1. Flash does it exactly this way. Flash is a browser plugin that is created by the web pages.
  2. You can have a machine ID generated at the application/plugin install time and your plugin can pass that machine ID to the webpage when it is created.

On the topic of using local webserver:

I would stay away from having a local webserver, mainly because of security considerations. It takes quite a lot of work to make sure your local webserver is locked down sufficiently and there are no XSS vulnerabilities that other malicious websites can exploit to make it do stuff on their behalf.

Plus, having a webserver means that either it has to run as a system-wide process, or if it runs as the user, you can have the website interact with only one user's instance of the application, even though multiple users can be logged on and running it at the same time.

Google Desktop Search suffered from both the XSS security vulnerability (though they fixed it) and the limitation of only one user being able to use it on a machine (I don't know if they fixed this one yet, though chances are they did).

Upvotes: 2

James Curran
James Curran

Reputation: 103575

Websites can detect if you've got Flash installed.

Actually, I believe a browser can detect if you have the Flash plugin for the browser installed, and webpages can offer "installed" and "uninstalled" option that the browser can choose.

Otherwise, you are asking for a means, by putting some code in a webpage, of being able to analyze a user's home computer, and report what it learned to you website.

Can you say Major Security Hole?

Upvotes: 1

thekidder
thekidder

Reputation: 3594

You can register a protocol from your desktop application (see this). This can be used, for example, to open your desktop application with arbitrary data from the website. You could then have your desktop app send a HTTP request to your webserver, telling it what machine you are on.

Upvotes: 4

Marc Hughes
Marc Hughes

Reputation: 5858

If you can pick a development environment for the desktop app, then check out AIR from Adobe. It lets you develop desktop applications using either html/javascript, Flash, or Flex.

It has API calls you can use from a browser based flash app to see if the desktop based AIR app is installed, what version, etc. You can even launch it and pass parameters from the web app to the desktop app.

http://www.rogue-development.com/blog2/2008/03/interacting-with-an-air-app-from-a-browser-based-app/

Upvotes: 0

Related Questions