Function Check32or64BitWindows
${If} ${RunningX64}
strcpy $INSTDIR "$PROGRAMFILES64\${APP_FULL_PATH}"
SetRegView 64
${Else}
SetRegView 32
strcpy $INSTDIR "$PROGRAMFILES32\${APP_FULL_PATH}"
${EndIf}
FunctionEnd
If an older version is detected then I execute
ExecWait '"$INSTDIR\uninst.exe" /S' $0
My uninstall section:
Section uninstall
!define APP_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_VENDOR} ${APP_NAME}"
!define APP_UNINST_ROOT_KEY "HKLM"
DeleteRegKey ${APP_UNINST_ROOT_KEY} "${APP_UNINST_KEY}"
SectionEnd
Section -Post
WriteRegStr ${APP_UNINST_ROOT_KEY} "${APP_UNINST_KEY}" "DisplayName" "${APP_FULL_NAME}"
SectionEnd
Post section creates the registry entry in the windows 64bit registry view but uninstaller is not deleting the registry entry.
If I remove the check for 64bit OS, then creation and deletion of registry in Wow6432Node works correctly.