Search code examples
uwpwindows-installermicrosoft-edgepackagingmicrosoft-edge-extension

Packging of Edge Extension which support nativemessaging(UWP app)


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.


Solution

  • 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:
    enter image description here
    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: enter image description here 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