Windows Phone 8.1 HTML Company Apps - Can't install company app

前端 未结 1 842
情书的邮戳
情书的邮戳 2021-02-05 19:22

I\'m having problems trying to deploy any kind of HTML application for Windows Phone 8.1 as a Company App. The application I have developed is using a Visual Studio Apache Cordo

1条回答
  •  难免孤独
    2021-02-05 20:09

    The answer, when it came, is pretty simple, if not very obvious. Microsoft have said

    In Windows Phone 8.1 there is a known issue that required enterprise appx packages to have this [CodeIntegrity.cat] file.

    There is actually a small clue in the page on Troubleshooting packaging, deployment, and query of Windows Store apps in the section for APPX_E_MISSING_REQUIRED_FILE (though you don't actually get this error code when deploying a signed Company App and so it's not really a clue in this case). It states -

    The package isn't valid because it's missing a manifest or block map, or a code integrity file is present but a signature file is missing.

    Ensure that the package isn't missing one or more of these required files:

    \AppxManifest.xml

    \AppxBlockMap.xml

    If the package contains \AppxMetadata\CodeIntegrity.cat, it must also contain \AppxSignature.p7x.

    What it doesn't say is that (at least for me) the reverse is also true.

    If you're signing a Company App, which inserts an AppxSignature.p7x file, then you must also have an \AppxMetadata\CodeIntegrity.catfile in your .appx package. This is only generated if you have a dll in your project and, on Windows Phone 8.1, hybrid apps can be written quite easily without ever needing any dlls.

    So I created a blank Class Library (Portable for Universal Windows 8.1) project, built an empty dll and inserted it into the root of the solution created by building the Cordova app. I also removed the dependency to WinJS 2.1 as this can stop the app from installing as a company app and the WinJS files are already in my project (the dependencies can't be pushed to a device when installing as a company app, they can if they're being deployed from the Windows Store or from Visual Studio).

    Choosing "Store > Create App Packages..." now produces an .appx file with a dll in the root and now when I run it through the BuildMDILAPPX.ps1 script a \AppxMetadata\CodeIntegrity.cat is created for the package.

    Installing this package now works and installs successfully.

    0 讨论(0)
提交回复
热议问题