0

For a website I am developing I would like to open a windows GUI application from my webpage (PHP). How do I do that?

The behavior I am looking for is similar to that of the "View in iTunes" button in the below page:

https://itunes.apple.com/us/artist/katy-perry/id64387566

softwarematter
  • 28,015
  • 64
  • 169
  • 263
  • 1
    Possible duplicate of [launch an application from HTML with arguments](http://stackoverflow.com/questions/2601108/launch-an-application-from-html-with-arguments) – CBroe Oct 03 '15 at 12:08
  • Have a look at: http://stackoverflow.com/questions/389204/how-do-i-create-my-own-url-protocol-e-g-so – Nemo Oct 04 '15 at 13:29

1 Answers1

3

You need to get the specific link which can open the application and pass parameters. For example make a button on your page and nest a hyperlink inside: I found this example on the windows 10 store page of microsoft which opens a specific app of the windows 10 store:

<a href="ms-windows-store://pdp/?productid=9WZDNCRFJ3T0&amp;referrer=unistoreweb&amp;muid=02722FE11F4B6C76309627D4194B6C5F&amp;websession=9f8f1a7d976e4a2485c950e5339443ad" class="srv_purchaseButton btn btn-primary" data-bi-name="GetAppFromNativeClientStore" data-bi-id="9WZDNCRFJ3T0" data-bi-source="DisplayCatalog">
            App abrufen
        </a>

The developers of the apps nearly always publish the links and parameters you can use to open the app. You can see that for example the parameter productid and so on get passed so the store "knows" which page it needs to show to the user.

Here is the code behind the open in iTunes button of your example:

<a onclick="return its.detect.openItunes('https://itunes.apple.com/us/artist/katy-perry/id64387566');" href="#" class="action view-in-itunes"><span>View In iTunes</span></a>

This iTunes link checks if your computer has itunes installed and if yes it opens the application and if not it redirects you to download itunes first for your pc.

The application register that launch uri during the installation process or the first opening of the app.

Matthias Herrmann
  • 2,650
  • 5
  • 32
  • 66