registry

MSI get install arguments from registry

∥☆過路亽.° 提交于 2019-12-24 02:25:06
问题 We're actually writing PowerShell cmdlets to create a snapshot of installed (custom) MSIs. The cmdlets walk through a list of servers, check if MSIs of a given publisher are installed. If so, the MSI is copied from the remote machine to host executing the PowerShell cmdlet. So far so good. In the next stage we're planning to restore a system with the beforehand fetched MSI packages. Our actual problem: Some of the MSIs need command line parameters for installation via msiexec. We searched the

Registry.CurrentUser is null

南笙酒味 提交于 2019-12-24 01:02:03
问题 I am using the following property to set/read registry values in my code. However, in the line: RegistryKey regKey = Registry.CurrentUser; regKey is null. This is happening only in a few machines. Any idea? 回答1: RegistryKey regRPP = Registry.CurrentUser.CreateSubKey(@"Software\Softech\FaceReader"); //this is the path it will create regRPP.SetValue("FaceReaderURL", "http://localhost/pnm/v4_spp/"); 来源: https://stackoverflow.com/questions/6895621/registry-currentuser-is-null

Building an COM-interop enabled project without registering it during build

只谈情不闲聊 提交于 2019-12-24 00:51:07
问题 In Visual Studio 2010, I'm trying to build an COM-interop enabled C# project without registering it during build, but I DO require the assembly's typelibrary (.tlb) file, so I can import it from another C++ project in the solution. I haven't found a way of doing this - there once upon a time was a tlbexp.exe tool, but it was deprecated in favor of regasm.exe /tlb (which unlike tlbexp.exe, registers it). 回答1: tlbexp is still available in VS2010 here: C:\Program Files\Microsoft SDKs\Windows\v7

How can i read a REG_BINARY values associated value from registry?

和自甴很熟 提交于 2019-12-23 22:28:18
问题 In the registry there is one ( or more ) key depending how many monitors you have HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY\DEL404C\{Some Unique ID}\Device Parameters\EDID which is a REG_BINARY key . In my case this is : 00 FF FF FF FF FF FF 00 10 AC 4C 40 53 43 34 42 34 14 01 03 0A 2F 1E 78 EE EE 95 A3 54 4C 99 26 0F 50 54 A5 4B 00 71 4F 81 80 B3 00 01 01 01 01 01 01 01 01 01 01 21 39 90 30 62 1A 27 40 68 B0 36 00 DA 28 11 00 00 1C 00 00 00 FF 00 34 57 31 4D 44 30 43 53 42 34

PowerShell: How To Use Standard Output In Place of Filename

浪子不回头ぞ 提交于 2019-12-23 20:52:03
问题 I'm writing a C# class that runs a Process (REG) to export registry keys. REG requires that you specify a filename to export to but I would rather have the output of REG directed to the standard output so I can capture it directly in my C# code (using Process.StandardOutput). Is there a way in PowerShell to specify the standard output as the filename? 回答1: If you have to use the REG program (rather than use PowerShell to query/dump the registry - or even just do it in the C# program itself),

How to Detect in Windows Registry if user has .Net Framework installed?

有些话、适合烂在心里 提交于 2019-12-23 20:44:09
问题 How do I detect in the Windows Registry if a user has .Net Framework installed? I am not looking for a .Net based solution, as the query is from InnoSetup. I know from reading another post here on Stack Overflow that .Net Framework is an inplace upgrade to 4.0. I already know how to check if a user has version 4.0 installed on the system, namely by checking the following: function FindFramework(): Boolean; var bVer4x0: Boolean; bVer4x0Client: Boolean; bVer4x0Full: Boolean; bSuccess: Boolean;

How to determine if a registry key exists in Wix

旧巷老猫 提交于 2019-12-23 19:28:12
问题 I want to determine if a Registry key exists in Wix. I cannot make any assumptions about value names in that key, but at least one exists. Default value is not set. Is it possible to check if the key exists (and optionally, if it has any values) without using custom actions? 回答1: Have a look at the RegistrySearch Sample of use: <Property Id="MYRegSearch" Value="AVaLue" Secure="yes"> <RegistrySearch Id="RegSearch" Root="HKLM" Key="Software\!(wix.Manufacturer)\!(wix.ShortProduct)" Name="Values"

RegSetValueEx Only shows writes first character

杀马特。学长 韩版系。学妹 提交于 2019-12-23 17:53:21
问题 In the following code, RegSetValueEx is only writing the first letter of my string. I've tried changing the sizes to just about anything I can think of, and I only ever get the first string. Any help is appreciated. LPCWSTR path = L"Test String"; size_t size = wclsen(path) * sizeof(wchar_t); DWORD dwResult = RegSetValueEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\My App", 0, REG_SZ, (LPBYTE)path, test); I've tried using path.size() * sizeof(wchar_t) and any number of other sizes I could think of, but

How to create file extension that behaves as .cmd/.bat?

被刻印的时光 ゝ 提交于 2019-12-23 17:44:53
问题 I suppose this is a strange question . but I'm curious.This is what I've tried so far: I've exported and compare values from [HKEY_CLASSES_ROOT\batfile] , [HKEY_CLASSES_ROOT\cmdfile] , [HKEY_CLASSES_ROOT\.bat] , [HKEY_CLASSES_ROOT\.cmd] . The only differences I've noticed were in HKEY_CLASSES_ROOT\*\FrienflyTypeName which suppose is not crucial for their execution.So I've created an registry values with same data for desired extension(I'm trying to create .scjs file extension ): Windows

Modify an existing registry key value in c#

可紊 提交于 2019-12-23 16:59:45
问题 I want to modify a data in registry path SOFTWARE\Wow6432Node\Program\SubProgram using C# code in windows 7. I am able to read the value but I can't write into Registry . Here is the code: RegistryKey SUBKEY; RegistryKey TAWKAY = RegistryKey.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, ""); string subkey = "SOFTWARE\\Wow6432Node\\Program\\SubProgram "; if (TAWKAY.OpenSubKey(subkey) != null) // Get values from Registry { TAWKAY = RegistryKey.OpenRemoteBaseKey(Microsoft.Win32