If you are using Autoit, depending on whether you install AutoIt / Scite on a 64bit machine or a 32bit machine, your default wrapper settings are set to a specific Architecture. You can specify what Arch. you want your wrapper to deploy with by using the Autoit Directives #AutoIt3Wrapper_UseX64=x.
This can have an effect on how to write your registry.
If you use 64-bit wrapper (#AutoIt3Wrapper_UseX64=Y)
Then you can use the normal HKLM to write to the 64-bit registry
If you are using the 32-Bit wrapper (#AutoIt3Wrapper_UseX64=N)