Skip to content

Commit

Permalink
better var naming
Browse files Browse the repository at this point in the history
  • Loading branch information
zackattack01 committed Nov 13, 2024
1 parent d1e7f9c commit 8f08eea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/launcher/svc_config_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,17 +269,17 @@ func recoveryActionsAreSet(curRecoveryActions, recoveryActions []mgr.RecoveryAct
// maintain consistency with the pattern set by our installer info metadata.
// for additional details on the difference, see here https://devblogs.microsoft.com/oldnewthing/20080118-00/?p=23773
func checkCurrentVersionMetadata(logger *slog.Logger, identifier string) {
installedVersionRegistryKeyName := fmt.Sprintf(currentVersionRegistryKeyFmt, identifier, currentVersionKeyName)
launcherVersionKey, err := registry.OpenKey(registry.LOCAL_MACHINE, installedVersionRegistryKeyName, registry.ALL_ACCESS)
versionKeyPath := fmt.Sprintf(currentVersionRegistryKeyFmt, identifier, currentVersionKeyName)
launcherVersionKey, err := registry.OpenKey(registry.LOCAL_MACHINE, versionKeyPath, registry.ALL_ACCESS)
// create the key if it doesn't already exist
if err != nil && err.Error() == notFoundInRegistryError {
launcherVersionKey, _, err = registry.CreateKey(registry.LOCAL_MACHINE, installedVersionRegistryKeyName, registry.ALL_ACCESS)
launcherVersionKey, _, err = registry.CreateKey(registry.LOCAL_MACHINE, versionKeyPath, registry.ALL_ACCESS)
}

if err != nil {
logger.Log(context.TODO(), slog.LevelError,
"could not create or open new registry key",
"key_name", installedVersionRegistryKeyName,
"key_path", versionKeyPath,
"err", err,
)

Expand Down

0 comments on commit 8f08eea

Please sign in to comment.