microsoft / microsoft/msix-packaging

[BUG] msixmgr does not return bad status when unpack fails due to insufficient disk space

Open
#507 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-MSIX Core Bug
Dominant language
C
Stars
1.1k
Forks
193
Avg merge
2h 16m
Merged PRs (30d)
2

Description

Project
MSIX SDK

Describe the bug
When msixmgr fails to unpack an MSIX package to a vhdx because the vhdx is not bit enough, it outputs error text but does not return an error so using $? or $LASTEXITCODE in PowerShell cannot determine that an error has occurred

Error text is:

[WARNING] The following packages from C:\temp\Notepad++\NotepadPlusPlus.8.3.3.x64.msix failed to get unpacked. Please try again:

Failed with HRESULT 0x8bad0003 when trying to unpack C:\temp\Notepad++\NotepadPlusPlus.8.3.3.x64.msix
The tool encountered a file write error. If you are unpacking to a VHD, please try again with a larger VHD, as file write errors may be caused by insufficient disk space.

Finished unpacking packages to: C:\temp\notepad.manual.vhdx

To Reproducemsixmgr no error

  1. Run & "C:\temp\msixmgr\x64\msixmgr.exe" -Unpack -packagePath "C:\temp\Notepad++\NotepadPlusPlus.8.3.3.x64.msix" -destination c:\temp\notepad.manual.vhdx -applyacls -create -rootdirectory app -filetype vhdx -vhdsize 25
  2. Observe error
  3. Exit status in PowerShell via $? is $true and $LASTEXITCODE is 0 so does not signify an error

Expected behavior
Return a failed status and set $LASTEXITCODE to 0x8bad0003

Screenshots
If applicable, add screenshots to help explain your problem.

Platform

Win10 21H2

Additional context
msixmgr v1.1.98.0

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the msixmgr.exe command in the issue with an undersized VHDX and observe its exit status. Trace the unpack failure handling for HRESULT 0x8bad0003; done means the failed unpack returns a failure status and PowerShell exposes that status through $LASTEXITCODE.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.