MicrosoftDocs / msix-docs

repository for msix content
Creative Commons Attribution 4.0 International
59 stars 114 forks source link

Can't install msix.appinstaller with update via URI. #329

Closed SebPieniazek closed 2 years ago

SebPieniazek commented 2 years ago

Hello,

I am trying to create msix app with updating via URI. I create simple controllers to test this in my localhost. But i can't do that, because all the time msix.appinstaller show's me "Error parsing app package". I created msix via visual studio project - Windows Application Packaging Project. When i run msixbundle everything works fine, the application installed correctly.

Here's .appinstaller I modified Bundle Uri there.

`<?xml version="1.0" encoding="utf-8"?> <AppInstaller Uri="https://localhost:7181/Home/GetLatestVersion/MSIX.appinstaller" Version="1.0.1.0" xmlns="http://schemas.microsoft.com/appx/appinstaller/2017/2"> <MainBundle Name="8935c3c3-4b71-4b05-b542-8e0c5668e46b" Version="1.0.1.0" Publisher="CN=s.pieniazek" Uri="https://localhost:7181/Home/GetLatestBundleVersion/MSIX_1.0.1.0_x86_x64.msixbundle" />

`

I also try to

  1. change schema to ../2018 version
  2. delete schema.

Here's my api: ` public IActionResult GetLatestVersion(string fileName) { var latestVersion = System.IO.File.ReadAllBytes(_latestVersionPath);

        return File(latestVersion, "application/appinstaller", fileName);
    }

    public IActionResult GetLatestBundleVersion(string fileName)
    {
        var latestVersion = System.IO.File.ReadAllBytes(_latestBundleVersionPath);

        return File(latestVersion, "application/msixbundle", fileName);
    }`

I also try:

  1. Returning file without (...)/fileName
  2. change content-type to appinstaller -> application/xms msixbundle -> application/vns.ms-appx

I do this on visual studio 2022 try to pack -> WPF app with framework -> net6.0-windows Windows -> 21H2


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

SebPieniazek commented 2 years ago

Solved - .appinstaller cant use localhost :)

Use IIS: https://docs.microsoft.com/en-us/windows/msix/app-installer/web-install-iis Have look at point 8 to solve localhost problems.

I leave it to people who have same issues.

anarvekar-msft commented 2 years ago

If you have any follow up questions, please feel free to reopen the issue