microsoft / msix-packaging

MSIX SDK
MIT License
964 stars 163 forks source link

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

Open guyrleech opened 2 years ago

guyrleech commented 2 years ago

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