The msi modification failed because the msi file was still open when the script started modifying it. The simplest solution was to put all that in another separate setup_noadmin.py script.