1

It is possible to run a windows desktop application from a weblink. This can be achieved bij registering a custom protocol. Something like this (myapp.reg):

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\myapp]
@="\"URL: myapp protocol\""
"URL Protocol"=""

[HKEY_CLASSES_ROOT\myapp\shell]

[HKEY_CLASSES_ROOT\myapp\shell\open]

[HKEY_CLASSES_ROOT\myapp\shell\open\command]
@="\"C:\\myapp.exe\" -URL \"%1\""

The URL: “myapp://parameters" will start the myapp application.

Is there a way to install the application and custom protocol, when it is not installed jet, before running the application?

Could this be done with msix?

By replacing the URL with: “ms-appinstaller:?source=http://myaddres/myapp_1.0.0_x64__z3ppzndyktgh8.msix”

The simplified flow (without user interaction/cancellation) would be:

if not installed myapp then
   install myapp 
else if not up to date myapp then
  update myapp
run myapp with parameters
Wytze
  • 11
  • 2

1 Answers1

0

Yes, this is possible using the MSIX and AppInstaller support. The full details are in this Microsoft blog post, but here is a short extras from the article:

The way MSIX supports this feature is by leveraging protocol support. Your app must register a custom protocol, which will be used to launch the application after it has been installed from your website using App Installer.

Then, your application will retrieve all the information about the activation through the startup arguments, like in a regular protocol activation scenario. For example, let's say you register a protocol called contoso-expenses:. This means that, when someone invokes a URL like contoso-expenses:?source=campaign, your application will receive as activation arguments the value source=campaign. This is exactly what App Installer is going to do the first time it launches your MSIX packaged app after the installation has been completed.

Bogdan Mitrache
  • 10,536
  • 19
  • 34
  • thx, this works partly. First I have more than one parameter, something like contoso-expenses:?source=campaign&destination=target. This does not work. Second if de custom protocol is already installed the installer still starts. – Wytze Jun 09 '21 at 12:55