microsoft / WindowsAppSDK

The Windows App SDK empowers all Windows desktop apps with modern Windows UI, APIs, and platform features, including back-compat support, shipped via NuGet.
https://docs.microsoft.com/windows/apps/windows-app-sdk/
MIT License
3.81k stars 321 forks source link

Single-Project MSIX does not create .appinstaller or index.html files for auto-updates #1821

Closed mjfusa closed 1 year ago

mjfusa commented 2 years ago

Vote for adding support for .appinstaller here!

Describe the bug

When building MSIX packages with a single project MSIX for automatic updates, the .appinstaller and index.html files are not created

Steps to reproduce the bug

  1. Install the Windows App SDK 1.0 C# VSIX for Visual Studio 2022. (https://docs.microsoft.com/en-us/windows/apps/windows-app-sdk/stable-channel#version-10)
  2. Create a new project: (Blank App, Packaged WinUI 3 in Desktop)
  3. Close and reload solution (Known issue #1664)
  4. Select "Package and Publish" > "Create App Packages"
  5. Check 'Sideloading and 'Enable Automatic Updates' > Next
  6. Select 'Create' a new certificate > Next
  7. Accept all defaults > Next
  8. Specify network share path: \TEMP\share (doesn't have to exist)
  9. Click 'Create'
  10. Click link to open AppPackages folder

Expected behavior

App packages get created in the AppPackages folder as expected, however the expected .appinstaller and index.html files are not created. This prevents the app from receiving automatic updates.

Screenshots

No response

NuGet package version

1.0.0

Packaging type

Packaged (MSIX)

Windows version

Windows 11 (22000)

IDE

Visual Studio 2022

Additional context

No response

riverar commented 2 years ago

@mjfusa Can you try building in Release? I have a faint memory of this (or something packaging project related) that just silently does nothing when building in Debug configurations. Not saying this isn't a bug, just curious.

mjfusa commented 2 years ago

Thanks for the suggestion @riverar - unfortunately I get the same result (no appinstaller or index.html files) in Release.

MartinRothschink commented 2 years ago

After changing my existing two project with separate packaging project into a single project I made the same observation. The index.html and app installers are missing.

andrewleader commented 2 years ago

This is a known gap, single-project MSIX unfortunately doesn't support creating the appinstaller file. You can use the classic Windows Packaging Project (two projects) for now.

How important is appinstaller support in single-project MSIX for you? You can add your vote here: https://portal.productboard.com/winappsdk/1-windows-app-sdk/c/55-support-generating-appinstaller-file-in-single-project-msix

MartinRothschink commented 2 years ago

Thanks, voted.

KWodarczyk commented 2 years ago

if this is not supported why there is an option to provide the path to the installer folder ? That is confusing and makes people think it's actually supported. I

germanfortiz commented 2 years ago

I can't see this problem solved in 1.0.2. What's more, only the last platform selected is generated (x86, x64 or arm64), and the msixbundle is not created either.

image

image

These are the settings selected:

image

evelynwu-msft commented 2 years ago

Single-project MSIX Packaging won't support creation of .msixbundle packages until WinAppSdk 1.2 at the earliest. Until that support is added, the VS wizard is effectively just setting some MSBuild properties that get ignored if you tell it to produce a bundle.

Regarding the missing .appinstaller even after upgrading to 1.0.2, can you verify that you checked this box at the beginning of the wizard? image

germanfortiz commented 2 years ago

Hi! Thanks for the quick response!

Starting the Create App Packages wizard:

image

The image at the end of the process:

image

And the final folders:

image

As a note: when creating the package, I see VS genererate x86 target, but when VS begins compiling x64 target, it inmediatly deletes the _x86 target.

Thanks!

evelynwu-msft commented 2 years ago

That is bizarre... I'm using what should be identical settings, but I'm seeing the expected behavior (both architectures present in $(AppPackageDir), and a .appinstaller for each): image

germanfortiz commented 2 years ago

I think I found the problem in my settings: in the Create App Packaged wizard, the option Generate App Bundle must be set in Never. This way the wizard create the .appinstallers and the index.html.

image

image

Thanks for the support!

headerjson commented 1 year ago

Is there a supported MSBuild option to generate this index.html for single-project MSIX?

I'm setting up an Azure DevOps CI/CD pipeline and am able to generate the .msix and .appinstaller for the single-project MSIX using the following MSBuild options:

/p:AppxPackageDir=D:\AppxPackages\ 
/p:GenerateAppxPackageOnBuild=true 
/p:AppxBundle=Never 
/p:UapAppxPackageBuildMode=SideLoadOnly
/p:GenerateAppInstallerFile=true
/p:AppInstallerUri=https:\\foo.net
/p:HoursBetweenUpdateChecks=24

The index.html file is still missing.

riverar commented 1 year ago

@headerjson Double-check that's being built in a Release configuration. If I remember correctly, nothing happens (silently) if in Debug. (Or this behavior changed and you can ignore me.)

fabiocannas commented 1 year ago

/p:AppxPackageDir=D:\AppxPackages\ /p:GenerateAppxPackageOnBuild=true /p:AppxBundle=Never /p:UapAppxPackageBuildMode=SideLoadOnly /p:GenerateAppInstallerFile=true /p:AppInstallerUri=https:\foo.net /p:HoursBetweenUpdateChecks=24 @headerjson you saved my life :) thank you