Packging of Edge Extension which support nativemessaging(UWP app)

时间秒杀一切 提交于 2019-12-11 06:35:47

问题


I developed an extension which uses native messaging to communicate with backend uwp application. How can I package it?

When I install the package, will it install the edge extension as well which is a part of the package.


回答1:


I have successfully built a package with the edge extension by the following steps. Hope this will help you~

Build the project as following structure in C\EdgeExtension\Appx:

1. fullTrustProcess
If there is fullTrustProcess, the exe should be included in TrustedProcess folder, with configuration in AppxManifest.xml.

<desktop:Extension Category="windows.fullTrustProcess" Executable="TrustedProcess\MyTrustedProcess.exe" />

If there is no fullTrustProcess, ignore and delete the TrustedProcess folder.
2. Extension
JS files of Edge extension are included in Extension folder, configured as following: 3. UWP files
- Assets
- AppxManifest.xml
- EdgeNativeMessage.dll
- EdgeNativeMessage.exe
- EdgeNativeMessage.winmd
- resources.pri
4. Package with command

    C:\Program Files (x86)\Windows Kits\10\bin\x86\makeappx.exe pack /h SHA256 /d  C\EdgeExtension\Appx /p C\EdgeExtension\EdgeNativeMessage.appx
5. Sign the appx
    C:\Program Files (x86)\Windows Kits\10\bin\x86\signtool.exe sign /fd SHA256 /a /f C:\EdgeExtension\MyKey.pfx /p "password" C\EdgeExtension\EdgeNativeMessage.appx
  1. Install Extension
    • install the MyKey.pfx
    • double click MyEdgeExtension.appx, then click install to install the extension.
  2. Check
    • launch Edge broser
    • click ...-> Extensions,
      System will register the appx, it needs several seconds before the extension shows in the extension list.
    • check registry
      The EdgeNativeMessage will add to the two path.

    Computer\HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\Extensions
Computer\HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\ExtensionsStore\datastore\Config


来源:https://stackoverflow.com/questions/45793598/packging-of-edge-extension-which-support-nativemessaginguwp-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!