I want to run a .reg
file inside an NSIS installer. My registry file is:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{adeba497-0484-4d69-aff3-d7c759f21d15}]
@="SampleV2CredentialProvider"
[HKEY_CLASSES_ROOT\CLSID\{adeba497-0484-4d69-aff3-d7c759f21d15}]
@="SampleV2CredentialProvider"
[HKEY_CLASSES_ROOT\CLSID\{adeba497-0484-4d69-aff3-d7c759f21d15}\InprocServer32]
@="SampleV2CredentialProvider.dll"
"ThreadingModel"="Apartment"
I tried to run:
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{adeba497-0484-4d69-aff3-d7c759f21d15}" "SampleV2CredentialProvider"
WriteRegStr HKCR "CLSID\{adeba497-0484-4d69-aff3-d7c759f21d15}" "SampleV2CredentialProvider"
These are not working for me, and also, I don't know what I should say about the last registry. Can you please help me?
I've solved the problem using SetRegView. As I was working on a 64-bit operating system, it was trying to look to the registries as a 32bit register by default. Because of that, nothing was happening to my registry file. Setting SetRegView
to 64
solved the problem for me.
SetRegView 64
WriteRegStr "HKLM" "SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{adeba497-0484-4d69-aff3-d7c759f21d15}" "" "SampleV2CredentialProvider"
WriteRegStr "HKCR" "CLSID\{adeba497-0484-4d69-aff3-d7c759f21d15}" "" "SampleV2CredentialProvider"
WriteRegStr "HKCR" "CLSID\{adeba497-0484-4d69-aff3-d7c759f21d15}\InprocServer32" "" "SampleV2CredentialProvider.dll"
WriteRegStr "HKCR" "CLSID\{adeba497-0484-4d69-aff3-d7c759f21d15}\InprocServer32" "ThreadingModel" "Apartment"