I have tried to request execution level user,admin and highest, neither seems to be letting NSIS write to HKLM.... Am I doing something wrong or missing an important step?
Thanks in advance! Here is a truncated version of the script I am trying to put together, you can see the WriteRegStr is just a test entry there for debugging purposes until I find out why it's not writing.
!include "Sections.nsh"
!include "LogicLib.nsh"
var /GLOBAL VER
Name "BSC Suite $VER"
BrandingText "Bayside Computer Shop"
OutFile "bayside-installer.exe"
RequestExecutionLevel admin
CRCCheck off
Icon hdup.ico
Page components
Page directory
Page instfiles
Section "Malware Bytes Anti-Malware" g2o7
SetOutPath "$INSTDIR\Anti-Malware"
File "bin\mbam-setup.exe"
WriteRegStr HKLM "SOFTWARE\My Software" "" $INSTDIR
SectionEnd
Function .onInit
StrCpy $VER 10.4.27
StrCpy $INSTDIR "$DOCUMENTS\tech\User Software"
FunctionEnd
Function .onInstSuccess
MessageBox MB_YESNO|MB_ICONQUESTION "The computer has to reboot before any$\r$\nof the software you selected is$\r$\ninstalled.$\r$\n$\r$\nDo you wish to reboot the system?" IDNO +2
Reboot
FunctionEnd