Preventing warning in bootstrapper package self contained scenario #7009
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For 16.9 we made a change where bootstrapper packages can specify "0" for the public key value of a downloaded file and this will cause the bootstrapper to skip the public key comparison as long as the file is signed with a trusted MS cert. However, we didn't account for the scenario where a user wants to create a self contained bootstrapper, meaning it will include a copy of the package's installer. In this scenario we still perform the public key comparison and give a build warning when they don't match. This change skips this check when the package specifies 0 for the public key of the file in question.
Context
See the following thread: https://docs.microsoft.com/en-us/answers/questions/583383/publickey-token-warning-building-net-core-50-insta.html?childToView=602746#comment-602746
Changes Made
Skipping a check when a package's PublicKey value is set to "0".
Testing
Verified we no longer give this warning in this scenario, and that we still give it when the public key is non-zero and doesn't match the file on disk.