YehudaKremer / msix

Create Msix installer for flutter windows-build files.
https://pub.dev/packages/msix
MIT License
279 stars 69 forks source link

[HELP] setting up custom protocol and apps for websites #241

Closed CaptainDario closed 11 months ago

CaptainDario commented 11 months ago

:information_source: Info

Version: 3.16.4

:speech_balloon: Description

I am trying to set up a custom protocol and apps for websites. I want my custom protocol to be dakanji://, so I set protocol_activation: dakanji,http,https. Which works great. My problem now is that I cannot get apps for websites to work. I want the app also to open when opening https://dakanji.app/app/. Therefore I set app_uri_handler_hosts: dakanji.app

:scroll: Pubspec.yaml

 msix_config:
  display_name: DaKanji
  protocol_activation: dakanji,http,https
  app_uri_handler_hosts: dakanji.app
  publisher: CN=EC6A3F44-67FB-44EF-B45B-1DACD55293B9
  publisher_display_name: DaAppLab
  identity_name: 61015DaAppLab.DaKanji
  logo_path: ./assets/images/dakanji/icon.png
  capabilities: internetClient
  execution-alias: DaKanji
  languages: en-us, de-de, ru-ru, ja-jp, zh-cn, it-it, fr-fr, es-es, pl-pl

dev_dependencies:
  msix: 3.16.4

With this setup the msix builds however, it does not open my app when visiting the website

When setting app_uri_handler_hosts: dakanji.app/app/ the msix builder will crash.

MakeAppx : error: Failure at appxFactory->CreateManifestReader(manifestStream, &manifestReader) - 0x80080204 - The specified package format is not valid: The package manifest is not valid.
MakeAppx : error: Error info: /*[local-name()="Package" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/foundation/windows10"]/*[local-name()="Applications" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/foundation/windows10"][1]/*[local-name()="Application" and namespace-uri()="http://schemas.microsofcrosoft.com/appx/manifest/foundation/windows10"][1]/*[local-name()="Extension" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"][1]/*[local-name()="AppUriHandler" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"][1]/*[local-name()="Host" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"][1]/@Name
'dakanji.app/app' violates pattern constraint of '([0-9a-zA-Z]+(-[0-9a-zA-Z]+)*\.)+[a-zA-Z]{1,63}'.
The attribute 'Name' with value 'dakanji.app/app' failed to parse.
Cleaning up output file "\\?\D:\projects\DaKanji\da_kanji_mobile\build\windows\runner\Release\da_kanji_mobile.msix".
MakeAppx : error: Failure at (CreatePackage( overwrite, hashAlgorithm, fileList, outputPath, manifestStream.Get(), forceCompressionNone, performanceOptions, encryptPackage, encryptionOptions, cgmPath, mainPackagePathForResourceExemption, makepriExeFullPath)) - 0x80080204 - The specified package format is 
not valid: The package manifest is not valid.
MakeAppx : error: Package creation failed.
MakeAppx : error: 0x80080204 - The specified package format is not valid: The package manifest is not valid.

Any ideas what could be the problem?

CaptainDario commented 11 months ago

Ok, this was my fault. I needed to write app_uri_handler_hosts: dakanji.app, www.dakanji.app additionally, protocol_activation: dakanji is sufficient, no need to put http,https. Lastly, windows does not open the registered app when opening the website via the url-bar in a webrowser. It only opens the app when opening the "run command" (win + r) and inputting the URL their.