registry

Writing to registry in a C# application

☆樱花仙子☆ 提交于 2019-12-28 08:08:11
问题 I'm trying to write to the registry using my C# app. I'm using the answer given here: Writing values to the registry with C# However for some reason the key isn't added to the registry. I'm using the following code: string Timestamp = DateTime.Now.ToString("dd-MM-yyyy"); string key = "HKEY_LOCAL_MACHINE\\SOFTWARE\\"+Application.ProductName+"\\"+Application.ProductVersion; string valueName = "Trial Period"; Microsoft.Win32.Registry.SetValue(key, valueName, Timestamp, Microsoft.Win32

Inno Setup Creating registry key for logged in user (not admin user)

蓝咒 提交于 2019-12-28 04:29:05
问题 I'm trying to create an installer using Inno setup when I encounter this problem, everything else is being installed, but the registry keys are not being installed in the current user, I can't find it in the HKEY_CURRENT_USER . But when I try to run the Regedit as Administrator, the registry is installed there. I have UAC turned on and validating with an admin account for the install to run, why is that happening? Here's my Registry section [Registry] Root: HKCU; Subkey:Software; Flags:

Detecting installed programs via registry

孤人 提交于 2019-12-28 03:33:06
问题 I need to develop a process that will detect if the users computer has certain programs installed and if so, what version. I believe I will need a list with the registry location and keys to look for and feed it to the program which is not a problem. Is there a better way to accomplish this? My first thought was to check in the registry in the uninstallation entries but it seems one of the apps I wish to detect does not have one. What is the standard location for all registry using

Registry.LocalMachine.OpenSubKey() returns null

拟墨画扇 提交于 2019-12-27 22:07:52
问题 I get a null back from this attempt to access the Windows Registry: using (RegistryKey registry = Registry.LocalMachine.OpenSubKey(keyPath)) keyPath is SOFTWARE\\TestKey The key is in the registry, so why is it not finding it under the Local Machine hive? 回答1: In your comment to Dana you said you gave the ASP.NET account access. However, did you verify that that is the account that the site in running under? Impersonate and the anonymous access user can be easy to overlook. UNTESTED CODE:

Registry.LocalMachine.OpenSubKey() returns null

孤者浪人 提交于 2019-12-27 22:06:33
问题 I get a null back from this attempt to access the Windows Registry: using (RegistryKey registry = Registry.LocalMachine.OpenSubKey(keyPath)) keyPath is SOFTWARE\\TestKey The key is in the registry, so why is it not finding it under the Local Machine hive? 回答1: In your comment to Dana you said you gave the ASP.NET account access. However, did you verify that that is the account that the site in running under? Impersonate and the anonymous access user can be easy to overlook. UNTESTED CODE:

How to delete a registry value in C#

自古美人都是妖i 提交于 2019-12-27 12:06:23
问题 I can get/set registry values using the Microsoft.Win32.Registry class. For example, Microsoft.Win32.Registry.SetValue( @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "MyApp", Application.ExecutablePath); But I can't delete any value. How do I delete a registry value? 回答1: To delete the value set in your question: string keyName = @"Software\Microsoft\Windows\CurrentVersion\Run"; using (RegistryKey key = Registry.CurrentUser.OpenSubKey(keyName, true)) { if (key == null) {

How to delete a registry value in C#

限于喜欢 提交于 2019-12-27 12:06:17
问题 I can get/set registry values using the Microsoft.Win32.Registry class. For example, Microsoft.Win32.Registry.SetValue( @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "MyApp", Application.ExecutablePath); But I can't delete any value. How do I delete a registry value? 回答1: To delete the value set in your question: string keyName = @"Software\Microsoft\Windows\CurrentVersion\Run"; using (RegistryKey key = Registry.CurrentUser.OpenSubKey(keyName, true)) { if (key == null) {

Run C# application at Windows startup?

℡╲_俬逩灬. 提交于 2019-12-26 23:12:43
问题 It's all the day that I'm trying to implement a startup feature into my project. I used Registry key: //Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run (Administrator Rights) I used Registry key: //Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run (Administrator Rights) The code work but when I restart the computer nothing happens. This is the code I used. RegistryKey registryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\

Run C# application at Windows startup?

非 Y 不嫁゛ 提交于 2019-12-26 23:09:34
问题 It's all the day that I'm trying to implement a startup feature into my project. I used Registry key: //Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run (Administrator Rights) I used Registry key: //Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run (Administrator Rights) The code work but when I restart the computer nothing happens. This is the code I used. RegistryKey registryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\

Windows registry - register an application to open a file type

大兔子大兔子 提交于 2019-12-26 09:00:58
问题 I'm making an installer for an application which has a custom URI scheme and its own file type to open with it. The application executed with a launcher.bat , In the registry I've set the launcher.bat to do so. It works as it should be, unless I want to register the application wit its name to be shown as opening application both in exporer and browsers instead of launcher.bat . The registry file that applied by the installer script is the following ( it is gets generated dynamically, so don