James Hawkins wrote:
WCHAR user[MAX_PATH];
size = MAX_PATH;
type = REG_SZ;
user[0] = '\0';
res = RegQueryValueExW( hkey, szRegisteredUser, NULL, &type, (LPBYTE)user, &size );
MSI_SetPropertyW( package, szUSERNAME, user );
How about:
LPWSTR user = msi_reg_get_val_str( hkey, szRegisteredUser ). MSI_SetPropertyW( package, szUserName, user ); msi_free( user );
(All upper case is usually for macros...)
Mike
On 10/16/06, Mike McCormack mike@codeweavers.com wrote:
James Hawkins wrote:
WCHAR user[MAX_PATH];
size = MAX_PATH;
type = REG_SZ;
user[0] = '\0';
res = RegQueryValueExW( hkey, szRegisteredUser, NULL, &type, (LPBYTE)user, &size );
MSI_SetPropertyW( package, szUSERNAME, user );
How about:
LPWSTR user = msi_reg_get_val_str( hkey, szRegisteredUser ). MSI_SetPropertyW( package, szUserName, user ); msi_free( user );
Ah these wonderful shortcuts. I should probably write them down somewhere ;)
(All upper case is usually for macros...)
I'd rather keep it uppercase. The property name is uppercase and hypothetically there could be a UserName property too, like we have SourceDir/SOURCEDIR. I know it almost looks like a macro, but it helps me and possibly others know at first glace that we're talking about the USERNAME property.
Thanks, James Hawkins