Commit 5266f34c authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Set the ComputerName property.

parent 936c14f8
......@@ -751,14 +751,13 @@ static VOID set_installer_properties(MSIPACKAGE *package)
static const WCHAR szNetHoodFolder[] = {'N','e','t','H','o','o','d','F','o','l','d','e','r',0};
static const WCHAR szPrintHoodFolder[] = {'P','r','i','n','t','H','o','o','d','F','o','l','d','e','r',0};
static const WCHAR szRecentFolder[] = {'R','e','c','e','n','t','F','o','l','d','e','r',0};
static const WCHAR szComputerName[] = {'C','o','m','p','u','t','e','r','N','a','m','e',0};
/*
* Other things that probably should be set:
*
* ComputerName VirtualMemory
* ShellAdvSupport DefaultUIFont PackagecodeChanging
* CaptionHeight BorderTop BorderSide TextHeight
* RedirectedDllSupport
* VirtualMemory ShellAdvSupport DefaultUIFont PackagecodeChanging
* CaptionHeight BorderTop BorderSide TextHeight RedirectedDllSupport
*/
SHGetFolderPathW(NULL, CSIDL_COMMON_APPDATA, NULL, 0, pth);
......@@ -1014,6 +1013,17 @@ static VOID set_installer_properties(MSIPACKAGE *package)
msi_free( username );
}
}
len = 0;
if (!GetComputerNameW( NULL, &len ) && GetLastError() == ERROR_INSUFFICIENT_BUFFER)
{
WCHAR *computername;
if ((computername = msi_alloc( len * sizeof(WCHAR) )))
{
if (GetComputerNameW( computername, &len ))
msi_set_property( package->db, szComputerName, computername );
msi_free( computername );
}
}
}
static UINT msi_load_summary_properties( MSIPACKAGE *package )
......
......@@ -10103,6 +10103,11 @@ static void test_installprops(void)
ok( r == ERROR_SUCCESS, "failed to get property: %d\n", r);
trace("PackageCode = %s\n", buf);
size = MAX_PATH;
r = MsiGetProperty(hpkg, "ComputerName", buf, &size);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS got %d\n", r);
trace("ComputerName = %s\n", buf);
langid = GetUserDefaultLangID();
sprintf(path, "%d", langid);
......
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