This sounds like you are using the BigSQL distribution. Do not use the installers for that since the PostgreSQL folder layout of BigSQL is different from PostgreSQL EDB distribution (which is what the installers are designed to work with). Use the binaries instead - http://postgis.net/windows_downloads/
The binaries also assume PostgreSQL EDB layout folder structure, so for BigSQL, you'll want to copy these into separate folders instead of the folder paths in the binaries.
Put and copy the files in right location as I described:
http://postgis.us/Presentations/postgis_install_guide_23.html#/windows
Instructions excerpted from above link
BigSQL does not include pgRouting yet, but for windows you can use the zip files from - http://postgis.net/windows_downloads/ to get pgRouting. Make sure to use the zip files (not the installer) (and change the path where you copy share folder contents to pg96/share/postgresql, copy lib folder contents to pg96/lib/postgresql folder, bin folder contents pg96/bin).
You'll also need the libstdc++-6.dll which you can find in the osm2pgrouting zip files in the extra_deps folder. Copy this to pg96/bin.