Make postinstall work on windows

This works on Windows and I've tested on a ubuntu VM too.