Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set a property value from a registry key #134

Closed
end2endzone opened this issue Nov 30, 2023 · 2 comments
Closed

Set a property value from a registry key #134

end2endzone opened this issue Nov 30, 2023 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@end2endzone
Copy link
Owner

Is your feature request related to a problem? Please describe.
It would be useful to be able to set a property from a registry key.

Describe the solution you'd like

<property name="content" registry="HKEY_LOCAL_MACHINE\SOFTWARE\7-Zip\Path64" />

Describe alternatives you've considered
N/A

Additional context
This feature would allow people to detect software installation directory. These values are usually stored in the registry. For example, 7-zip installation directory is defined in the registry key HKEY_LOCAL_MACHINE\SOFTWARE\7-Zip\Path64. The property should read the key and set the value of the property from the registry key value.

An advanced use case would be to define a 7-zip (or any other software) Configuration File that can be easily shared across multiple users.

<?xml version="1.0" encoding="utf-8"?>
<root>
  <shell>
    <default>
      <!-- Detect 7-zip installation directory from the registry -->
      <property name="sevenzip.dir" registry="HKEY_LOCAL_MACHINE\SOFTWARE\7-Zip\Path64" />
    </default>

    <menu name="7-zip">
      <visibility properties="sevenzip.dir" />

      <menu name="Compress to *.7z">
  	<visibility maxfiles="1" maxfolders="0" />
        <actions>
          <exec ... />
        </actions>
      </menu>

    </menu>
  </shell>
</root>
@end2endzone end2endzone added the enhancement New feature or request label Nov 30, 2023
@end2endzone end2endzone added this to the 0.9.0 milestone Nov 30, 2023
@Aptronymist
Copy link

This actually made me think a minute, could you include those built-in context menus inside of SA instead of them being independently on the context menu, rather than just having the usual 7zip context menu separate as it normally is? Mark a spot in the xml for where you want it to be and it goes there instead?

@end2endzone
Copy link
Owner Author

Something similar has been already discussed in #37.
Such a feature should be discussed in another issue/thread. Please keep it simple with 1 request/feature per issue.

This issue is for specifically implementing property setting from Windows Registry.

end2endzone added a commit that referenced this issue Dec 18, 2023
end2endzone added a commit that referenced this issue Dec 18, 2023
* feature-issue134:
  Created project sa.windows.dll. Created interface IRegistryService for querying the registry. Moved registry query code from ActionProperty.cpp to RegistryService class in sa.windows.dll.
  Updated documentation for #134.
  Implemented support for registrykey attribute for property elements. #134
end2endzone added a commit that referenced this issue Dec 22, 2023
…keys values for debugging and unit test purpose. #134
end2endzone added a commit that referenced this issue Dec 22, 2023
D:\a\ShellAnything\ShellAnything\src\tests\TestActionProperty.cpp(625): error: Value of: executed
  Actual: false
Expected: true
Failed to execute actions of menu 'menu4'.
#134
end2endzone added a commit that referenced this issue Dec 28, 2023
- Renamed LoggerGlog class to GlogLoggerService.
This change is for #134 and #137. This is to match design from #134 and #129.
end2endzone added a commit that referenced this issue Dec 29, 2023
Add a comment in IWhatEverService interface declarations that it is required to keep the core decoupled from something.
#134 #137
end2endzone added a commit that referenced this issue Dec 30, 2023
* feature-issue129:
  * Fixed issue #129: Utilize clipboard contents as well as set them.
  Renamed "Dynamic Properties" to "Live Properties" for clarity. Updated documentation. Created new unit tests. #129
  Added "Service" postfix to App::Set/GetRegistry() and Set/GetLogger(). Add a comment in IWhatEverService interface declarations that it is required to keep the core decoupled from something. #134 #137
  Decoupled clipboard management from sa.core.dll: created an IClipboard interface in the core. Created an implementation that matches the current clipboard management code in sa.windows.dll. Implemented `clipboard` property to reference current clipboard content. The property name is `clipboard` to match existing `<clipboard>` action. #129
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants