The objective is to create a Windows desktop application in Go using the lxn/walk library. The app allows users to synchronize specific configuration settings from the PuTTY "Default Settings" to individual saved sessions by reading and writing directly to the Windows Registry.
- Language: Go (latest stable).
- UI Framework:
github.com/lxn/walkandgithub.com/lxn/win. - Target OS: Windows 10/11.
- Permissions: The app must be able to read/write to
HKEY_CURRENT_USER.
- Registry Root Path:
HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions - Default Settings Path:
HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Default%20Settings - Session Naming: Note that PuTTY URL-encodes session names in the registry (e.g., a space is
%20). The app should decode these for display and encode them when accessing the registry. - Sensitive Keys (EXCLUSION LIST): Do not display or allow copying of the following keys:
UserNamePublicKeyFileProxyUsernameProxyPasswordLocalProxyCommandHostname
- Component:
ListBoxorTableView. - Content: List all sub-keys under the
Sessionspath. - Filter: Exclude the entry named
Default%20Settings. - Behavior: Selecting a session triggers the "Diff Logic" to populate the Right Pane.
- Component:
TableViewwith Checkboxes. - Columns: 1. Setting Name (e.g.,
FontHeight).
- Default Value (Value found in
Default%20Settings). - Current Value (Value found in the selected session).
- Logic: Only show rows where the
Default Valuediffers from theCurrent Value. - Visual State: When a checkbox is checked, the row should be visually marked (e.g., bold text or a status column saying "To be changed").
-
Save Button: * Iterate through all checked items in the Right Pane.
-
Write the values from
Default Settingsinto the selected session's registry key. -
Refresh the view upon completion.
-
Cancel Button: * Uncheck all selections in the Right Pane.
-
Clear the "To be changed" status.
- Initialization: On startup, the app scans the Registry. If no PuTTY sessions are found, display a message box and exit.
- Selection: User clicks "Work Server" in the left pane.
- Comparison: * App reads all values from
Default%20Settings.
- App reads all values from
Work%20Server. - App filters out "Sensitive Keys".
- App identifies keys where
Value_Default != Value_Session.
- Modification: User checks the box for
Colour0(Background color). The "Save" button becomes enabled. - Commit: Upon "Save," the app performs a
Registry.SetStringValueorSetDWordValuefor the chosen keys.
- Error Handling: Provide
walk.MsgBoxalerts if the Registry is locked or permissions are denied. - Type Safety: Properly handle Registry types (
REG_SZvsREG_DWORD). Most PuTTY settings are strings, but some are integers. - Clean Exit: Ensure registry handles are closed after each read/write operation.