msi [3/3]: Set the USERNAME and COMPANYNAME properties when initializing a package

Mike McCormack mike at codeweavers.com
Mon Oct 16 20:26:51 CDT 2006


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



More information about the wine-devel mailing list