Replace postinstall script in Bash with Python for portability to windows