I have a relative simple NSIS-installer, which needs to write some keys to the registry. Unfortunately this does not work. Relevant code-parts are:
RequestExecutionLevel admin
Function .onInit
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" "" ""
FunctionEnd
As far as I understand it, .oninit is called in every case? Nevertheless after executing this installer's .exe, I do not see my new Key "LocalDump". What could be wrong here?
Thanks!
64-bit Windows has two registry "views" and 32-bit applications see the 32-bit view by default. You can use the SetRegView
instruction to force a 32-bit NSIS installer to write to the 64-bit view:
!include x64.nsh
!include LogicLib.nsh
Section
${If} ${RunningX64}
SetRegView 64
WriteRegStr ... value for 64-bit systems
SetRegView LastUsed
${Else}
WriteRegStr ... value for 32-bit systems
${EndIf}
SectionEnd
.onInit
is always executed but you should not really make changes to the system there because the user might cancel the installation. You should do most of the installation related operations in Section
s.