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.
The generated msi will be modified so it can be installed by any user.