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