CPack: NSIS installer uses the wrong registry key for 64bit installs
I'm porting code in Merkaartor to generate NSIS packages directly from CMake (work in progress here: https://github.com/krakonos/merkaartor/tree/improve-cmake-support ). I figured most of the things, but debugging why CPack generated installer does not properly detect the installer generated by the old-style NSIS. Setting CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL
works, but only if the installed version is generated by CPack, not by the old NSIS script.
Upon investigation, it appears CPack writes uninstaller info into the wrong registry key - I am generating win64 installer, but the keys written into are inside HKLM\Software\WOW6432Node
. Reading about that issue, this registry key is an alternate registry view for 32bit apps that run on 64bit windows. Looking into the NSIS, it appears SetRegView 64
would need to be used in the installer script. I did not find anything in the template.
I think this is a bug in the NSIS generator.
Did I miss something? I case I did not, would adding "SetRegview ${CPACK_REG_VIEW}" and deriving this variable from CPACK_SYSTEM_NAME be an acceptable solution? I can prototype on my project and submit PR if so.