Yeah, sorry. I'm using NSIS 2.51. I know I didn't define HKEY_LOCAL_MACHINE incorrectly; I even looked at the thread JasonFriday13 posted the link to so I could be sure I got the information correct. Here's what I have:
!define HKEY_LOCAL_MACHINE 0x80000002
I figured out the compile error though. It turns out I had defined HKEY_LOCAL_MACHINE and REG_MULTI_SZ outside of the 64-bit part of the section with the rest of the code inside the 64-bit part, and that was causing problems. So now it compiles with no problems, but I don't see the data in the registry after I run the installer. I'm sure this is not an issue with permissions, as I'm using the Administrator account and I have no problems modifying the registry key myself.
Edit:
Well actually it writes to keys within WOW6432Node no problem, but it won't write to anything outside of that (64-bit registry keys) for some reason. I can't tell if it's an issue with the RegView settings or not, but I can't seem to get it to work either way. Here's what I have now:
Function RegWriteRawData ; HKEY, Path, Name, Type, Address, Size
${If} ${RunningX64}
SetRegView 64
${Else}
SetRegView 32
${EndIf}
System::Store S
Pop $6 ; Size
Pop $5 ; Address
Pop $4 ; Type
Pop $3 ; Name
Pop $2 ; Path
System::Call 'ADVAPI32::RegCreateKey(is, tr2, *p.r1)i.r0'
IntCmp $0 0 "" fail fail
System::Call 'ADVAPI32::RegSetValueEx(pr1,tr3,i0,ir4,pr5,ir6)i.r0'
System::Call 'ADVAPI32::RegCloseKey(pr1)'
fail:
System::Store L
FunctionEnd
!macro RegWriteRawData HKEY Path Name Type Address Size
${If} ${RunningX64}
SetRegView 64
${Else}
SetRegView 32
${EndIf}
Push ${HKEY}
Push "${Path}"
Push "${Name}"
Push "${Type}"
Push "${Address}"
Push "${Size}"
Call RegWriteRawData
!macroend
Am I missing anything? Would I be able to remove "
SetRegView 64" and "
SetRegView 32" from "
Function RegWriteRawData" and "
!macro RegWriteRawData" since I already have those set in "
.onInit"? Keep in mind that each of my sections has a 64-bit part (
${If} ${RunningX64}) and a 32-bit part (
${Else}) so I would like to keep things compatible on both platforms.