C# Class SIL.FieldWorks.Common.FwUtils.FwRegistryHelper

Helper class for accessing FieldWorks-specific registry settings
ファイルを表示 Open project: sillsdev/FieldWorks Class Usage Examples

Public Methods

Method Description
Paratext7orLaterInstalled ( ) : bool

Determines the installation or absence of the Paratext program by checking for the existence of the registry key that that application uses to store its program files directory in the local machine settings. This is 'HKLM\Software\ScrChecks\1.0\Program_Files_Directory_Ptw(7,8,9)' NOTE: This key is not opened for write access because it will fail on non-administrator logins.

SetValueAsAdmin ( this key, string name, string value ) : void

Extension method to write a registry key to somewhere in HKLM hopfully with eleverating privileges. This method can cause the UAC dialog to be shown to the user (on Vista or later). Can throw SecurityException on permissions problems.

UpgradeUserSettingsIfNeeded ( ) : void

E.g. the first time the user runs FW8, we need to copy a bunch of registry keys from HKCU/Software/SIL/FieldWorks/7.0 -> FieldWorks/8.

Private Methods

Method Description
CopyAllValuesToNewSubKey ( RegistryKey srcSubKey, RegistryKey destSubKey ) : void
CopySubKeyTree ( RegistryKey srcSubKey, RegistryKey destSubKey ) : void
CopyValueToNewKey ( string valueName, RegistryKey oldSubKey, RegistryKey newSubKey ) : void
MigrateVersion7ValueIfNeeded ( ) : void

Method Details

Paratext7orLaterInstalled() public static method

Determines the installation or absence of the Paratext program by checking for the existence of the registry key that that application uses to store its program files directory in the local machine settings. This is 'HKLM\Software\ScrChecks\1.0\Program_Files_Directory_Ptw(7,8,9)' NOTE: This key is not opened for write access because it will fail on non-administrator logins.
public static Paratext7orLaterInstalled ( ) : bool
return bool

SetValueAsAdmin() public static method

Extension method to write a registry key to somewhere in HKLM hopfully with eleverating privileges. This method can cause the UAC dialog to be shown to the user (on Vista or later). Can throw SecurityException on permissions problems.
public static SetValueAsAdmin ( this key, string name, string value ) : void
key this
name string
value string
return void

UpgradeUserSettingsIfNeeded() public static method

E.g. the first time the user runs FW8, we need to copy a bunch of registry keys from HKCU/Software/SIL/FieldWorks/7.0 -> FieldWorks/8.
public static UpgradeUserSettingsIfNeeded ( ) : void
return void