Skip to content

Conversation

@SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Mar 10, 2025

PR Summary

  • Allow setting registry value without data by using RZ_NONE type, however, the valueData member that is returned won't be present when RZ_NONE is used.
  • Fix issue in build script that doesn't copy symbols to bin folder making it so you can't debug
  • Fix small issues in i18n text so that it gets rendered correctly
  • Fixed issue in helper function where if you have just the hive and one subkey (that doesn't exist yet), it incorrectly returns nothing for subkeys and thus doesn't get created
  • Add tests

PR Context

Fix #683

@SteveL-MSFT SteveL-MSFT requested review from Copilot and tgauth March 10, 2025 21:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

PR Overview

This PR addresses an issue with setting a registry value without data by introducing a new "None" variant, while also fixing issues in the build script and adjusting some i18n messages.

  • Allow setting registry values with no data by mapping Data::None to RegistryValueData::None.
  • Update translation parameter syntax and improve localization strings.
  • Tidy up key path handling and remove a redundant code block.

Reviewed Changes

File Description
registry/src/registry_helper.rs Adjusts conversion and handling of "None" registry data, improves translation parameter syntax, and refines key path parsing.
registry/src/config.rs Adds a new “None” variant to the RegistryValueData enum.
registry/locales/en-us.toml Updates i18n messages for better clarity and consistency.

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

registry/src/registry_helper.rs:106

  • Ensure that the updated parameter syntax 'subkey = subkey' is consistent with localization formatting conventions and that it properly substitutes the placeholder as intended.
what_if_metadata.push(t!("registry_helper.whatIfCreateKey", subkey = subkey).to_string());

registry/src/registry_helper.rs:122

  • Ensure that borrowing a reference to 'RegistryValueData::None' does not lead to lifetime issues. If 'RegistryValueData' is not Copy, consider using a static instance or refactoring to avoid referencing a temporary.
let value_data = match &self.config.value_data { Some(value_data) => value_data, None => &RegistryValueData::None, };

@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Mar 11, 2025
Merged via the queue into PowerShell:main with commit 37b004e Mar 11, 2025
4 checks passed
@SteveL-MSFT SteveL-MSFT deleted the empty-reg-value branch March 11, 2025 20:38
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.

registry.exe does not allow for empty valueName

2 participants