2
votes

I would like to know how to launch a .reg file using NSIS.

this file looks like this:

Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching] "SearchOrderConfig"=dword:00000003

thanks in advance! Bye

1
WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching" "SearchOrderConfig" 0x00000003P.Martin
but it wasn't successfulP.Martin

1 Answers

1
votes
WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching" "SearchOrderConfig" 0x00000003 

There are two things issues you need to deal with for this to work:

  1. Only administrators can write to HKLM so you need to add RequestExecutionLevel admin to your script.

  2. On 64-bit versions of Windows this is going to write to the 32-bit view of the registry so you probably want to call SetRegView 64 before WriteRegDWORD.

It can be helpful to use Process Monitor to see why a registry write fails and to verify that you are writing to the correct place.