Commit fd549aa2 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Set the LogonUser property.

parent 76ae295a
......@@ -345,7 +345,7 @@ static VOID set_installer_properties(MSIPACKAGE *package)
WCHAR *ptr;
OSVERSIONINFOEXW OSVersion;
MEMORYSTATUSEX msex;
DWORD verval;
DWORD verval, len;
WCHAR verstr[10], bufstr[20];
HDC dc;
HKEY hkey;
......@@ -445,11 +445,12 @@ static VOID set_installer_properties(MSIPACKAGE *package)
static const WCHAR szUserLangID[] = {'U','s','e','r','L','a','n','g','u','a','g','e','I','D',0};
static const WCHAR szSystemLangID[] = {'S','y','s','t','e','m','L','a','n','g','u','a','g','e','I','D',0};
static const WCHAR szProductState[] = {'P','r','o','d','u','c','t','S','t','a','t','e',0};
static const WCHAR szLogonUser[] = {'L','o','g','o','n','U','s','e','r',0};
/*
* Other things that probably should be set:
*
* ComputerName LogonUser VirtualMemory
* ComputerName VirtualMemory
* ShellAdvSupport DefaultUIFont PackagecodeChanging
* CaptionHeight BorderTop BorderSide TextHeight
* RedirectedDllSupport
......@@ -653,6 +654,18 @@ static VOID set_installer_properties(MSIPACKAGE *package)
sprintfW(bufstr, szIntFormat, MsiQueryProductStateW(package->ProductCode));
MSI_SetPropertyW( package, szProductState, bufstr );
len = 0;
if (!GetUserNameW( NULL, &len ) && GetLastError() == ERROR_MORE_DATA)
{
WCHAR *username;
if ((username = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
{
if (GetUserNameW( username, &len ))
MSI_SetPropertyW( package, szLogonUser, username );
HeapFree( GetProcessHeap(), 0, username );
}
}
}
static UINT msi_load_summary_properties( MSIPACKAGE *package )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment