Same as above (don't forget to include LogicLib.nsh and x64.nsh)
Function .onInit
${If} ${RunningX64}
StrCpy $INSTDIR "$PROGRAMFILES64\myProduct"
${Else}
StrCpy $INSTDIR "$PROGRAMFILES\myProduct" ; $PROGRAMFILES32 also works
${EndIf}
FunctionEnd
Optionally, you can also set the registry view (see SetRegView)