Refactor some of the subprocess stuff (maybe naming is not best). On windows the subprocess must have the SYSTEMROOT env var, otherwise it cannot load DLLs.