Looking at the macOS packaging stuff, I see nothing that explicitly removes older versions. I guess this is done automatically by the generated installer logic. I guess this happens whatever the version numbers, and not only between 4.5 and 4.6. Maybe there is an option to deactivate it somewhere, but I don’t know how to do that.
In any case, I am considering dropping all this installer stuff, and only distributing a zip file on macOS (at the same time as moving to cross-compilation, since tools for creating macOS packages are not available on GNU/Linux). That would de facto resolve this issue. Leaving opened for the time being.
I doubt that this is the solution. Setting BundleIsRelocatable to true allows the installer to use another installation path than the one recommended by the package installer. Given that the version number is part of the installation path recommended by our installer, I hardly see how that could solve the problem.
Or maybe the problem comes from the fact that our installer uses two hierarchical levels (/Applications/Dynare/5.1/) instead of one as does MATLAB (so this would be /Applications/Dynare-5.1/).