Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install unpackaged app after a packaged app has been installed #1871

Closed
andrewleader opened this issue Dec 3, 2021 · 6 comments
Closed
Assignees
Labels
area-Deployment Issues related to packaging, installation, runtime (e.g., SelfContained, Unpackaged) area-Installer bug Something isn't working
Milestone

Comments

@andrewleader
Copy link
Contributor

Describe the bug

The WinAppRuntime Installer fails to install if a packaged app using WinAppSDK has already been installed. It seems as if fails while trying to update the existing packages and therefore fails to install the remaining packages that are needed for an unpacakged app.

Steps to reproduce the bug

First, uninstall all versions of WinAppRuntime by using an admin PowerShell to replicate a "clean" computer...

$winappsdk = "Microsoft.WindowsAppRuntime.1.0*"
Get-AppxPackage | Where-Object { $_.Dependencies -like $winappsdk } | Remove-AppxPackage
Get-AppxPackage $winappsdk | Remove-AppxPackage

Then, install a MSIX WinUI 3 app like https://github.com/andrewleader/WindowsAppSDKGallery/releases/download/v0.39.1.0/WindowsAppSDKGallery_0.39.1.0_AnyCPU.msix (you'll have to add the certificate before installing)

Then, try running the x64 Installer to prep for using an unpackaged app: https://aka.ms/windowsappsdk/1.0-stable/msix-installer

Notice the following errors appear...

Installing license: WAR_MAINPACKAGE_LICENSE
Install result : 0x0
Deploying package: Microsoft.WindowsAppRuntime.1.0_0.319.455.0_x64__8wekyb3d8bbwe
Package deployment result : 0x80073cfb The provided package is already installed, and reinstallation of the package was blocked. Check the AppXDeployment-Server event log for details.
One or more install operations failed. Result: 0x80073cfb

[process exited with code 2147958011]

Try running an unpackaged app like https://github.com/andrewleader/WindowsAppSDKGallery/releases/download/v0.39.1.0/WindowsAppSDKGallery-unpackaged-0.39.1.0.zip (extract the ZIP and then double click WindowsAppSDKGallery.exe)

Notice the EXE crashes (nothing visible appears since fails before XAML starts up).

Uninstall all WinAppRuntime using the same PowerShell script at the start, and then try running the x64 Installer again and try using the unpackaged app again. Notice this time it works fine.

Expected behavior

Should be able to install unpackaged apps regardless of whether packaged apps have already been installed.

Screenshots

No response

NuGet package version

1.0.0

Packaging type

Unpackaged

Windows version

Insider Build (xxxxx)

IDE

Visual Studio 2022

Additional context

No response

@andrewleader andrewleader added bug Something isn't working area-Deployment Issues related to packaging, installation, runtime (e.g., SelfContained, Unpackaged) area-Installer labels Dec 3, 2021
@DrusTheAxe
Copy link
Member

DrusTheAxe commented Dec 11, 2021

Then, install a MSIX WinUI 3 app...
...
Then, try running the x64 Installer to prep for using an unpackaged app: https://aka.ms/windowsappsdk/1.0-stable/msix-installer

Please run the following command between these steps and share the results

powershell -c $(Get-AppxPackage microsoft*win*app*run*).PackageFullName

Given the installer reported

Deploying package: Microsoft.WindowsAppRuntime.1.0_0.319.455.0_x64__8wekyb3d8bbwe
...
...The provided package is already installed...

I'd expect Microsoft.WindowsAppRuntime.1.0 version >= 0.319.455.0 is already registered when you run the installer.

If so this is a known issue in the installer (should detect this condition and treat as success).

@sachintaMSFT I thought we had a work item for that but can't find it to share here via https://task.ms/nnnnnn

@davidrios
Copy link

davidrios commented Feb 5, 2022

I have the same issue.

The results of the suggested command the first time

> powershell -c $(Get-AppxPackage microsoft*win*app*run*).PackageFullName
Microsoft.WindowsAppRuntime.1.0_0.319.455.0_x64__8wekyb3d8bbwe
Microsoft.WindowsAppRuntime.1.0_0.319.455.0_x86__8wekyb3d8bbwe

After uninstalling all WinAppRuntime and running the x64 Installer again:

> powershell -c $(Get-AppxPackage microsoft*win*app*run*).PackageFullName
Microsoft.WindowsAppRuntime.1.0_0.319.455.0_x64__8wekyb3d8bbwe
Microsoft.WindowsAppRuntime.1.0_0.319.455.0_x86__8wekyb3d8bbwe
MicrosoftCorporationII.WindowsAppRuntime.Main.1.0_0.319.455.0_x64__8wekyb3d8bbwe
Microsoft.WindowsAppRuntime.Singleton_0.319.455.0_x64__8wekyb3d8bbwe
Microsoft.WinAppRuntime.DDLM.0.319.455.0-x6_0.319.455.0_x64__8wekyb3d8bbwe
Microsoft.WinAppRuntime.DDLM.0.319.455.0-x8_0.319.455.0_x86__8wekyb3d8bbwe

So it seems there are missing packages that should be installed, even if Microsoft.WindowsAppRuntime.1.0_0.319.455.0 is already.

@DrusTheAxe
Copy link
Member

DrusTheAxe commented Feb 15, 2022

We've identified the root problem and working on a fix. Go here for more details:

#1953 (comment)

@DrusTheAxe DrusTheAxe added this to the 1.1 milestone Feb 15, 2022
@riverar
Copy link
Contributor

riverar commented Feb 15, 2022

@DrusTheAxe While that's the root cause, this issue demonstrates that the installer doesn't swallow package-already-installed HRESULTs. Perhaps consider doing so to cover the scenario in which the user is legitimately blocked from reinstalling that package (i.e. non identity related reasons)?

@DrusTheAxe
Copy link
Member

demonstrates that the installer doesn't swallow package-already-installed HRESULTs.

It's not quite that simple. The installer does detect already-installed and if so, re-register the package (a form of repair-if-something's-broken). That's detected just fine as not an error, as you can see here

The problem here's slightly different - package XYZ is installed and you're trying to install a package with the same identity but different content. That violates a base principle of the appmodel -- package identity is unique across space and time. That multiple packages with the same package identity has the same bits.

The bug here is the 1.0.0 framework packages available for download and included in the NuGet, VSIX and installer are identical but the frameworks installed by the Store have different content. Specifically, their appxmanifest.xml differs - BOM vs no BOM, added <mp:PhoneIdentity>, formatted differently. The manifest's file hash differs because the files' aren't identical, thus same identity with different content. Deployment detects that inconsistency and fails the install.

The root problem is due to a bug in our build process. We've corrected that so it won't happen again. This was specific to 1.0.0. Anyone with (any) 1.0.0 packages installed can upgrade fine to 1.0.1(+) packages just fine. It's only the "install the same thing that's not really the same thing" that's a problem.

@gabbybilka
Copy link
Member

Fixed in 1.0.1, check out the release for more info: #2291

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Deployment Issues related to packaging, installation, runtime (e.g., SelfContained, Unpackaged) area-Installer bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants