Skip to content

Add expected installer return codes - #1421

Merged
Flor Chacón (florelis) merged 21 commits into
microsoft:masterfrom
florelis:ExpectedReturnCode
Sep 15, 2021
Merged

Flor Chacón (florelis) merged 21 commits into
microsoft:masterfrom
florelis:ExpectedReturnCode

Conversation

@florelis

@florelis Flor Chacón (florelis) commented Aug 31, 2021 •

Copy link
Copy Markdown
Member

Adding expected return codes for installer. Expected return codes are translated to specific HResults when found and show a custom error message.

  • Updated v1.1 manifest schema with new field for expected return codes. Updated file would look like this:
Installers: 
    - InstallerUrl: https://example.com
      InstallerType: exe
      ExpectedReturnCodes:
          PackageInUse: 1
          InstallInProgress: 2
  • Updated manifest parsing and validation for the new fields.
  • Refactored common code for checking installer exit code from MSI and ShellExecute installs into a workflow task that now also checks the expected return codes.

Not in this PR: Changes for REST sources

Microsoft Reviewers: Open in CodeFlow

@florelis
Flor Chacón (florelis) requested a review from a team as a code owner August 31, 2021 01:43

@JohnMcPMS JohnMcPMS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to make sure we have the full set of cases covered; "reboot required" being missing suggests that we have some to get still.

Also, the arguably more important part of this change is having a healthy set of default values per installer type and thorough thought put into how those would be overridden by the manifest. Requiring every MSI to output the fairly standardized set of values is not helpful.

This also plays into my comment on MSIX, as we can normalize the HRESULT returns from deployment into the set of values that we have here to make all package types easier to work with in a uniform fashion.

@florelis

Copy link
Copy Markdown
Member Author

Updated with default values per installer type.
I changed the way this is represented in the manifest because I hadn't considered multiple return codes mapping to the same response. The format is now

      ExpectedReturnCodes:
          - InstallerReturnCode: 1
            ReturnResponse: PackageInUse

@github-actions

This comment has been minimized.

@yao-msft yao-msft left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expected return codes

4 participants