registry

Registry class. If key exist

别来无恙 提交于 2020-05-17 03:00:35
问题 Im using the Microsoft.Win32.Registry class. Im trying to make a if RegKey exist statement but don't know how I want something like this: RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\test"); if(key.keyExist("yourKey")) Console.WriteLine("yourKey exist!"); 回答1: As far as I know, the SubKey is stored in a path in the system. So you can do something like this to check out if the SubKey exists: using (RegistryKey key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\test")) { if (key

Detect and uninstall old version of application in Inno Setup using its version number stored in registry

断了今生、忘了曾经 提交于 2020-05-14 05:19:49
问题 I have an installer that write this line in the Windows registry [Registry] Root: "HKCU"; Subkey: "SOFTWARE\W117GAMER"; ValueType: string; ValueName: "DSVersionL4D2"; ValueData: "{#MyAppVersion}" taking into account that {#MyAppVersion} is defined and written when the program is installed #define MyAppVersion "2.7" I am constantly updating the installer, which is why some people have old installations, and when they update, old files that conflict are combined, so as not to uninstall the

How to convert a hash string to byte array in PowerShell?

生来就可爱ヽ(ⅴ<●) 提交于 2020-05-12 04:39:27
问题 When my scripts run, I read a hash, and I would like to write it to the registry. I figured out that the following command will do it: New-ItemProperty $RegPath -Name $AttrName -PropertyType Binary -Value $byteArray I also found the How to set a binary registry value (REG_BINARY) with PowerShell?. However all answers suppose that the string is in form of: "50,33,01,00,00,00,00,00,...." but I only can read my hash in the following form: "F5442930B1778ED31A....." I can not figure out, how can I

How to convert a hash string to byte array in PowerShell?

吃可爱长大的小学妹 提交于 2020-05-12 04:38:46
问题 When my scripts run, I read a hash, and I would like to write it to the registry. I figured out that the following command will do it: New-ItemProperty $RegPath -Name $AttrName -PropertyType Binary -Value $byteArray I also found the How to set a binary registry value (REG_BINARY) with PowerShell?. However all answers suppose that the string is in form of: "50,33,01,00,00,00,00,00,...." but I only can read my hash in the following form: "F5442930B1778ED31A....." I can not figure out, how can I

How to convert a hash string to byte array in PowerShell?

Deadly 提交于 2020-05-12 04:37:46
问题 When my scripts run, I read a hash, and I would like to write it to the registry. I figured out that the following command will do it: New-ItemProperty $RegPath -Name $AttrName -PropertyType Binary -Value $byteArray I also found the How to set a binary registry value (REG_BINARY) with PowerShell?. However all answers suppose that the string is in form of: "50,33,01,00,00,00,00,00,...." but I only can read my hash in the following form: "F5442930B1778ED31A....." I can not figure out, how can I

Docker registry

空扰寡人 提交于 2020-04-22 05:36:55
Docker registry 本地运行一个registry hippo@ubuntu:~$ docker run -d -p 5000:5000 --restart=always --name registry registry:2 hippo@ubuntu:~$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f53a7e7353ec registry:2 "/bin/registry serve " 33 seconds ago Up 30 seconds 0.0.0.0:5000->5000/tcp registry 给镜像打标签,并push到registry hippo@ubuntu:~$ docker pull ubuntu hippo@ubuntu:~$ docker tag ubuntu localhost:5000/ubuntu hippo@ubuntu:~$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE localhost:5000/ubuntu latest 2fa927b5cdd3 2 days ago 122 MB ubuntu latest 2fa927b5cdd3 2 days ago 122 MB registry

How to get font name like in the Windows Registry with C#?

最后都变了- 提交于 2020-04-17 20:28:09
问题 First Try Here is what we get for the Arial TTF font: Here is what we get for the Sitka TTC font: And here is what we get for the SimSun TTC font: I tried to use the OpenFontReader object from the Typography.OpenFont.NetCore package. using System; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using Typography.OpenFont; namespace MyApp { class Program { static async Task Main(string[] args) { var fontName1 = GetRegistryFontName(@"C:\Windows\Fonts\arial

Read and Write registry entry of type REG_MULTI_SZ using Delphi

 ̄綄美尐妖づ 提交于 2020-04-08 18:31:06
问题 Delphi offers the library System.Win.Registry to manipulate the windows registry. Unfortunately it doesn't contain read/write procedures for the registry datatype REG_MULTI_SZ (=list of strings). The following code returns an ERegistryException with "invalid datatype" - it seems only to work with datatype REG_SZ: Registry := TRegistry.Create; Registry.RootKey := HKEY_LOCAL_MACHINE; Registry.OpenKey(cKey, false); sValue := Registry.ReadString('MyRegEntry'); Meanwhile I am able to read the REG

How to add context menu to one specific File

纵饮孤独 提交于 2020-03-05 21:55:50
问题 I just learned how to create a context menu for the Desktop, but what I really want is to only have the context menu for one specific link. Is this possible? I have not figured out how yet. I was hoping to specify the file instead of an extension in HKEY_CLASSES_ROOT, but I have not gotten been able to get it to work. This is my most current attempt. [HKEY_CLASSES_ROOT\Applications\My Link.lnk\Shell\Toggle] "Position"="Top" "Icon"="\"C:\\Program Files (x86)\\My Toggle\\My Toggle.Exe\"" @=

Find registry key using Excel VBA

旧巷老猫 提交于 2020-03-05 18:06:52
问题 I want to check if a user has Microsoft SQL Native Client 2008 (sqlncli10) or Native Client 2012 (sqlncli11) installed. Dim key As String Dim myShell As Object Set myShell = CreateObject("WScript.Shell") key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\SQLNCLI11\CurrentVersion\Version" 'key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion" Dim strKey As String strKey = myShell.RegReadkey(key) When looking for the native client I receive the