FAKE - F# Make - A DSL for build tasks and more FAKE
6.0.0

Lookig for older versions of the documentation, pre FAKE v6? See 

v5.fake.build

Registry Module

Contains functions which allow to read and write information from/to the registry.

Types

Type Description

RegistryBaseKey

Registry base keys.

Functions and values

Function or value Description

Registry.createRegistrySubKey baseKey subKey

Full Usage: Registry.createRegistrySubKey baseKey subKey

Parameters:
    baseKey : RegistryBaseKey - The registry value base key
    subKey : string - The sub key

Create a registry subKey

baseKey : RegistryBaseKey

The registry value base key

subKey : string

The sub key

Example


 let subkey = "Company/MyApp"
 Registry.createRegistrySubKey Registry.HKEYCurrentUser subkey

Registry.deleteRegistrySubKey baseKey subKey

Full Usage: Registry.deleteRegistrySubKey baseKey subKey

Parameters:
    baseKey : RegistryBaseKey - The registry value base key
    subKey : string - The sub key

Deletes a registry subKey

baseKey : RegistryBaseKey

The registry value base key

subKey : string

The sub key

Example


 Registry.deleteRegistrySubKey Registry.HKEYCurrentUser subkey

Registry.deleteRegistryValue baseKey subKey name

Full Usage: Registry.deleteRegistryValue baseKey subKey name

Parameters:
    baseKey : RegistryBaseKey - The registry value base key
    subKey : string - The sub key
    name : string - The name of the registry entry

Deletes the registry value from its key

baseKey : RegistryBaseKey

The registry value base key

subKey : string

The sub key

name : string

The name of the registry entry

Example


 Registry.deleteRegistryValue Registry.HKEYCurrentUser subkey "AppType"

Registry.get32BitKey name

Full Usage: Registry.get32BitKey name

Parameters:
Returns: RegistryKey

Maps the RegistryBaseKey to a RegistryKey for a 32bit System

name : RegistryBaseKey
Returns: RegistryKey

Registry.get64BitKey name

Full Usage: Registry.get64BitKey name

Parameters:
Returns: RegistryKey

Maps the RegistryBaseKey to a RegistryKey for a 64bit System

name : RegistryBaseKey
Returns: RegistryKey

Registry.getKey name

Full Usage: Registry.getKey name

Parameters:
Returns: RegistryKey

Maps the RegistryBaseKey to a RegistryKey

name : RegistryBaseKey
Returns: RegistryKey

Registry.getRegistryKey baseKey subKey writePermission

Full Usage: Registry.getRegistryKey baseKey subKey writePermission

Parameters:
    baseKey : RegistryBaseKey - The registry value base key
    subKey : string - The sub key
    writePermission : bool - The write permissions on registry entry

Returns: RegistryKey

Gets a registry key and falls back to 32 bit if the 64bit key is not there

baseKey : RegistryBaseKey

The registry value base key

subKey : string

The sub key

writePermission : bool

The write permissions on registry entry

Returns: RegistryKey

Registry.getRegistryKey64 baseKey subKey writePermission

Full Usage: Registry.getRegistryKey64 baseKey subKey writePermission

Parameters:
    baseKey : RegistryBaseKey - The registry value base key
    subKey : string - The sub key
    writePermission : bool - The write permissions on registry entry

Returns: RegistryKey

Gets a 64-bit registry key

baseKey : RegistryBaseKey

The registry value base key

subKey : string

The sub key

writePermission : bool

The write permissions on registry entry

Returns: RegistryKey

Registry.getRegistrySubKeyNames baseKey subKey

Full Usage: Registry.getRegistrySubKeyNames baseKey subKey

Parameters:
    baseKey : RegistryBaseKey - The registry value base key
    subKey : string - The sub key

Returns: string[]

Returns all the subKey names of a registry key

baseKey : RegistryBaseKey

The registry value base key

subKey : string

The sub key

Returns: string[]

Registry.getRegistryValue baseKey subKey name

Full Usage: Registry.getRegistryValue baseKey subKey name

Parameters:
    baseKey : RegistryBaseKey - The registry value base key
    subKey : string - The sub key
    name : string - The name of the registry entry

Returns: string

Gets a registry value as string

baseKey : RegistryBaseKey

The registry value base key

subKey : string

The sub key

name : string

The name of the registry entry

Returns: string
Example


 let AppType = Registry.getRegistryValue Registry.HKEYCurrentUser subkey values.[0]
 Trace.trace (sprintf "You are running the %s version" AppType)

Registry.getRegistryValue64 baseKey subKey name

Full Usage: Registry.getRegistryValue64 baseKey subKey name

Parameters:
    baseKey : RegistryBaseKey - The registry value base key
    subKey : string - The sub key
    name : string - The name of the registry entry

Returns: string

Gets a registry value as string

baseKey : RegistryBaseKey

The registry value base key

subKey : string

The sub key

name : string

The name of the registry entry

Returns: string

Registry.getRegistryValueNames baseKey subKey

Full Usage: Registry.getRegistryValueNames baseKey subKey

Parameters:
    baseKey : RegistryBaseKey - The registry value base key
    subKey : string - The sub key

Returns: string[]

Returns all the value names of a registry key

baseKey : RegistryBaseKey

The registry value base key

subKey : string

The sub key

Returns: string[]
Example


 let values = Registry.getRegistryValueNames Registry.HKEYCurrentUser subkey
 values |> Array.iter (Trace.trace << (sprintf "Found value name: %s!"))

Registry.setRegistryValue baseKey subKey name value

Full Usage: Registry.setRegistryValue baseKey subKey name value

Parameters:
    baseKey : RegistryBaseKey - The registry value base key
    subKey : string - The sub key
    name : string - The name of the registry entry
    value : 'T - The registry entry new value

Sets a registry value

baseKey : RegistryBaseKey

The registry value base key

subKey : string

The sub key

name : string

The name of the registry entry

value : 'T

The registry entry new value

Example


 Registry.setRegistryValue Registry.HKEYCurrentUser subkey "AppType" "Premium"
 Registry.setRegistryValue Registry.HKEYCurrentUser subkey "Version" "1.0.4"

Registry.valueExistsForKey baseKey subKey name

Full Usage: Registry.valueExistsForKey baseKey subKey name

Parameters:
    baseKey : RegistryBaseKey - The registry value base key
    subKey : string - The sub key
    name : string - The name of the registry entry

Returns: bool

Returns whether or not a registry value name exists for a key

baseKey : RegistryBaseKey

The registry value base key

subKey : string

The sub key

name : string

The name of the registry entry

Returns: bool
Example


 let exists b = if b then Trace.trace "It exists!" else Trace.trace "It doesn't exist!"
 exists <| Registry.valueExistsForKey Registry.HKEYCurrentUser subkey "DateCreated"
 exists <| Registry.valueExistsForKey Registry.HKEYCurrentUser subkey "Version"