Hans Leidekker : msi: Set the LogonUser property.

Alexandre Julliard julliard at winehq.org
Tue Nov 17 09:28:21 CST 2009


Module: wine
Branch: master
Commit: fd549aa25d490a2db381ad0e3c495ff8dd1e605e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=fd549aa25d490a2db381ad0e3c495ff8dd1e605e

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Tue Nov 17 15:58:45 2009 +0100

msi: Set the LogonUser property.

---

 dlls/msi/package.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/dlls/msi/package.c b/dlls/msi/package.c
index 87f1092..574289f 100644
--- a/dlls/msi/package.c
+++ b/dlls/msi/package.c
@@ -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 )




More information about the wine-cvs mailing list