I actually created this account just to share this, because I had been looking for a solution for days and couldn’t find anything that worked.
I was having this issue with PostgreSQL and tried several things without success. After installation, I noticed that the data folder inside the PostgreSQL directory was always empty, which seemed to be causing the problem.
I tried downloading the data folder (where the cluster files are stored) through the Command Prompt, and even created a new user account on Windows, but nothing worked.
What eventually solved it for me was installing pgAdmin 4 separately from the PostgreSQL installer. I went to the specific download page for pgAdmin 4, installed it first, ran it, and then restarted my PC as usual.
After that, I downloaded PostgreSQL using the official installer, but this time I unchecked the option to install pgAdmin 4, since I had already installed it. For some reason, that did the trick. I no longer got the “Problem running post-install step; installation may not complete correctly” error, and the data folder was finally created correctly.