I was wondering how Roblox (website) manages to launch the roblox executable from their website: when you chose a game and press "play", my browser (chrome) asks me if I want to launch an application, and shows me the path. When I press "Launch App", it launches the roblox client which is on my computer.
1 Answer
For windows, you'd register an application to a uri scheme
Basically just set up a few registry keys and point them to your executable. The best place to set this up is in your installer.
These are the keys you would set:
HKEY_CLASSES_ROOT
Roblox
(Default) = "URL:Roblox Launcher"
URL Protocol = ""
DefaultIcon
(Default) = "roblox.exe,1"
shell
open
command
(Default) = "C:\Program Files\Roblox\roblox.exe" "%1"
Then from your website you could link to roblox:Hello%20World, which would launch your application as if the user had entered "C:\Program Files\Roblox\roblox.exe" "roblox:Hello World" on the command line.
4 Comments
Shmack
What would the launch button look like? I read the article. You register the scheme, from what it looks like, by making an entry in the registry for it, but what "kicks it off" on the client side?
Jean-Bernard Pellerin
@ShanerM13 <a href="roblox:Hello%20World">launch me</a>
Shmack
Extra question: I suppose the means of setting said keys would be to... 1. put the keys in a file.reg. 2. go to the registry. 3. select HKEY_CLASSES_ROOT. 4. import the registry file. ?
Jean-Bernard Pellerin
Usually in the installer for the application being launched. Otherwise you'd have to make a small app or script for the user to run. A .reg file can also work, but privileges for that might be complicated, I'm not sure.