Search code examples
iisuwpappx

UWP appx install web error - cannot open appx


I am trying to setup a page to install an appx UWP app as per this blog: https://blogs.msdn.microsoft.com/appinstaller/2017/09/26/uwp-app-installs-from-web-via-app-installer/

I have generated my app package files, created a new site on IIS with a basic index.html with a link

<a href="ms-appinstaller:?source=http://localhost:89/MySampleApp_0.0.1.0_x86.appx">Install appx package</a><br>

When I run the appx file through explorer it installs fine. When I open it from the link above it launches the app installer but with the error:

Cannot open appx/appxbundle/appinstaller file. Reason: Error in parsing the appx/appxbundle/appinstaller

I don't know much about IIS but I assume this is something to do with accessing the install files. If I remove the

ms-appinstaller:?source=

part the file downloads ok because I setup a mimetype.

Any ideas?

EDIT: I am using a self signed cert. Is this the problem?


Solution

  • Answer provided by Breeze Liu in the comments. Setting a loopback exemption as described here resolves the issue:

    https://learn.microsoft.com/en-us/windows/uwp/packaging/web-install-iis#step-8---add-loopback-exemption-for-app-installer