/// <summary> /// Creates or updates a Windows Registry value. /// </summary> /// <param name="reg"></param> /// <param name="root">The Windows Registry hive to use. See <see cref="WindowsRegistryRoot"/> for available options. Example: WindowsRegistryRoot.HKEY_LOCAL_MACHINE</param> /// <param name="key">Name of the key containing the value you want to create or update. Example: SOFTWARE\ConDep</param> /// <param name="valueName">Name of the registry value</param> /// <param name="valueData">The data value you want to set</param> /// <param name="valueKind">The data type to use when storing values in the registry</param> /// <returns></returns> public static IOfferWindowsRegistryOperations SetValue(this IOfferWindowsRegistryOperations reg, WindowsRegistryRoot root, string key, string valueName, string valueData, RegistryValueKind valueKind) { var op = new SetWindowsRegistryValueOperation(root, key, valueName, valueData, valueKind); var regBuilder = reg as WindowsRegistryBuilder; OperationExecutor.Execute((RemoteBuilder)reg, op); return(reg); }
/// <summary> /// Creates or updates a Windows Registry value. /// </summary> /// <param name="reg"></param> /// <param name="root">The Windows Registry hive to use. See <see cref="WindowsRegistryRoot"/> for available options. Example: WindowsRegistryRoot.HKEY_LOCAL_MACHINE</param> /// <param name="key">Name of the key containing the value you want to create or update. Example: SOFTWARE\ConDep</param> /// <param name="valueName">Name of the registry value</param> /// <param name="valueData">The data value you want to set</param> /// <param name="valueKind">The data type to use when storing values in the registry</param> /// <returns></returns> public static IOfferWindowsRegistryOperations SetValue(this IOfferWindowsRegistryOperations reg, WindowsRegistryRoot root, string key, string valueName, string valueData, RegistryValueKind valueKind) { var op = new SetWindowsRegistryValueOperation(root, key, valueName, valueData, valueKind); var regBuilder = reg as WindowsRegistryBuilder; Configure.Operation(regBuilder.RemoteConfigurationBuilder, op); return(reg); }