Forum Discussion
Adding URI activation to AppxManifest.xml
Hi uvinabeysinghe,
To clarify your issue, is the URI handler you want added to the msix package a URI handler that the exe already registers?
MSIX packaging tool already scans the registry for protocol registrations during conversion. If we are missing an expected registration, I'd like to identify what we missed during conversion.
If you need to add this protocol handler after conversion:
RE 1: No, the Command line interface template does not support specifying a protocol for addition.
RE 2: You could write a script that uses makeappx (App packager (MakeAppx.exe) - Win32 apps | Microsoft Docs) to unpack the msix, use your favorite text manipulator to edit the manifest file, then repack and resign the msix with makeappx/signtool.
If you could describe in more detail the specific business need/scenario you are trying to address, that would help us prioritize and evaluate whether this would benefit from specific feature additions to the tooling. Are there other fields you find necessary to manually add in general post conversion?
Thanks!
James
Hi James Pike ,
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\myapp-name]
@="URL:myapp-name"
"URL Protocol"=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\myapp-name\shell]
@="open"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\myapp-name\shell\open]
@=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\myapp-name\shell\open\command]
@="\"C:\\Users\\username\\Applications\\MyApp\\MyAppName.exe\""
But when we install “myapp.msix” only some of the above registry keys get created. Also, note that the absolute path to the exe file will be different in the case of MSIX installation as it gets installed to C:\\Program Files\\WindowsApps folder.
For testing purpose, we tried to manually create these registry keys after installing the MSIX package. But, the URI protocol does not work and we see permission denied errors in the process monitor logs.
What is the recommended method for supporting URI protocols in MSIX packages? Should we work on getting the registry keys to work , which we believe requires fixes in the MSIX packaging tool.
Or, should we be focusing on automating the addition of the URI protocol XML entries in the App Manifest. For this case, it will be helpful if you could create an enhancement request for supporting this in the MSIX packaging tool. If this is what is recommended, we can consider using the MakeAppx tool for now.
We would like to automate this soon. Currently our team is manually creating MSIX files. This takes a lot of time because we have to create several MSIX files for our product releases. 
Thank you!