http://bugs.winehq.org/show_bug.cgi?id=5768
------- Additional Comments From mike@codeweavers.com 2007-11-01 20:30 ------- The "AMT_WriteRemoveFileEntry" action problem is a bug in MsiGetPropertyA that we don't emulate.
Adobe products use MsiGetPropertyA in custom actions to fetch the value of various properties like this:
char *get_prop( const char *name ) { UINT r; DWORD sz; char *str;
/* sz is meant to be the size in TCHARs excluding nul */ r = MsiGetPropertyA( handle, name, NULL, &sz); if (r != ERROR_SUCCESS || sz == 0) return NULL;
/* sz would be too short here.... */ str = HeapAlloc(GetProcessHeap(), 0, sz); MsiGetPropertyA( handle, name, NULL, &sz); if (r != ERROR_SUCCESS || sz == 0) goto error;
return str; error: /* log a message and fail */ ... }
The above code works in the installer, but we have a number of test cases showing that it shouldn't.
The code is run in the context of a custom action. After writing a test case for the above code in a custom action, the problem was apparent. MsiGetPropertyA has a bug in this case; it returns the size of the wide string in bytes.
eg. if the property value is "Photoshop.dll" it returns 26, not 13, so the above code works.