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

Added method to return whether or not a value exists for a registry key #944

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/app/FakeLib/RegistryHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ let getRegistryValue64 baseKey subKey value =
failwithf "Registry value is null for key %s" (key.ToString())
value.ToString()

/// create a registry subKey
/// Create a registry subKey
let createRegistrySubKey baseKey subKey = (getKey baseKey).CreateSubKey subKey |> ignore

/// Sets a registry value
Expand All @@ -88,3 +88,9 @@ let setRegistryValue<'T> baseKey subKey keyName (value : 'T) =
let deleteRegistryValue baseKey subKey keyName =
use key = getRegistryKey baseKey subKey true
key.DeleteValue keyName

/// Returns whether or not a registry value exists for a key
let valueExistsForKey = fun baseKey sub_key value ->
let key = getRegistryKey baseKey sub_key false
key.GetValueNames()
|> Seq.exists (fun v -> v = value)