1

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.

Shivanshu Goyal
  • 500
  • 9
  • 25
  • Did you check [this article](https://learn.microsoft.com/en-us/microsoft-edge/extensions/guides/packaging/creating-and-testing-extension-packages)? Seems like pretty detailed description of how to test an extension. – Andrei Ashikhmin Aug 22 '17 at 05:09

1 Answers1

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:
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
BurningFish
  • 157
  • 1
  • 9
  • Thanks, it got worked for me. Could you tell me how to uninstall the extension, when I click on the Appx again, it installs the extension again. – Shivanshu Goyal Aug 22 '17 at 13:39
  • You can uninstall in 3 ways:1. Settings -> Apps -> Apps & features -> click you app, uninstall. 2. click Start -> search your app, right click the app, uninstall. 3. Open Edge browser, click ...-> Extension -> click your extension - uninstall. – BurningFish Aug 25 '17 at 03:47
  • Powsershell commands are available to install/uninstall extension. Install: Add-appxpackage . Uninstall: Get-AppxPackage \*\* | Remove-AppxPackage – BurningFish Aug 25 '17 at 04:54