internal BlogExtensionData InstallExtension(string fileName) { BlogExtensionData extData = LoadExtension(fileName); if (extData == null) { return(null); } RegUtil.CreateSubKey(Registry.CurrentUser, _extensionKey); RegUtil.SetValue(Registry.CurrentUser, _extensionKey, Path.GetFileNameWithoutExtension(fileName), fileName); return(extData); }
internal void StoreProtectionKey() { if (!RegUtil.IsKeyExists(Registry.CurrentUser, _csRemoteControlRegKey)) { RegUtil.CreateSubKey(Registry.CurrentUser, _csRemoteControlRegKey); } RegUtil.SetValue(Registry.CurrentUser, _csRemoteControlRegKey, _regSecureVal, protectionKey); RegUtil.SetValue(Registry.CurrentUser, _csRemoteControlRegKey, _regRunPath, Application.ExecutablePath); if (_storePort) { RegUtil.SetValue(Registry.CurrentUser, _csRemoteControlRegKey, _regPortVal, _port); RegUtil.SetValue(Registry.CurrentUser, _csRemoteControlRegKey, _regPortASVal, _port.ToString()); } }
public static void SetAsDefaultHandler(string protocol, string friendlyName) { Guard.NullArgument(protocol, "protocol"); Guard.NullArgument(friendlyName, "friendlyName"); string protocolKey = "Software\\Classes\\" + protocol; if (!RegUtil.CreateSubKey(Registry.CurrentUser, protocolKey)) { return; } RegUtil.SetValue(Registry.CurrentUser, protocolKey, "", "URL:" + friendlyName); RegUtil.SetValue(Registry.CurrentUser, protocolKey, URLProtocol, ""); if (RegUtil.CreateSubKey(Registry.CurrentUser, protocolKey + SHELL_COMMAND)) { RegUtil.SetValue(Registry.CurrentUser, protocolKey + SHELL_COMMAND, "", "\"" + Application.ExecutablePath + "\"" + " -openurl %1"); } if (RegUtil.CreateSubKey(Registry.CurrentUser, protocolKey + "\\DefaultIcon")) { RegUtil.SetValue(Registry.CurrentUser, protocolKey + "\\DefaultIcon", "", "\"" + Application.ExecutablePath + "\""); } }