Is it possible to update an installations summary script during runtime?

I'm trying to create a standard install that handles 32 and 64 bit components and attempting to change the Template info at runtime by doing this in OnBegin:


hDatabase = MsiGetActiveDatabase(ISMSI_HANDLE);

MsiGetSummaryInformation(hDatabase,"",0,hInfo);
dwSize = 255;
pvt = &vt;
MsiSummaryInfoGetProperty(hInfo,7,pvt,pret,pft,szSumInfo,dwSize);

//Change the property to Intel64
szSumInfo = "Intel64;1033";
MsiSummaryInfoSetProperty(hInfo,7,pvt,pret,pft,szSumInfo);
MsiSummaryInfoPersist(hInfo);
MsiCloseHandle(hInfo);
MsiCloseHandle(hDatabase);
hDatabase = MsiGetActiveDatabase(ISMSI_HANDLE);

I can read the info but I can't seem to write it.
Do I need to explicitly open the .msi file to do this, or can I do this in another point in the install?