added WaitForExit when generating the installer