wusa: Support additional expressions.
Signed-off-by: Mohamad Al-Jaf <mohamadaljaf@gmail.com> Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
fbfefb1533
commit
0720b4be85
|
@ -1,5 +1,5 @@
|
||||||
MODULE = wusa.exe
|
MODULE = wusa.exe
|
||||||
IMPORTS = cabinet shlwapi ole32 oleaut32 advapi32
|
IMPORTS = cabinet shlwapi ole32 oleaut32 advapi32 shell32
|
||||||
|
|
||||||
EXTRADLLFLAGS = -mwindows -municode
|
EXTRADLLFLAGS = -mwindows -municode
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include <fdi.h>
|
#include <fdi.h>
|
||||||
#include <shlwapi.h>
|
#include <shlwapi.h>
|
||||||
|
|
||||||
|
#include "shlobj.h"
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
#include "wine/list.h"
|
#include "wine/list.h"
|
||||||
#include "wusa.h"
|
#include "wusa.h"
|
||||||
|
@ -479,27 +480,52 @@ static BOOL strbuf_append(struct strbuf *buf, const WCHAR *str, DWORD len)
|
||||||
static WCHAR *lookup_expression(struct assembly_entry *assembly, const WCHAR *key)
|
static WCHAR *lookup_expression(struct assembly_entry *assembly, const WCHAR *key)
|
||||||
{
|
{
|
||||||
WCHAR path[MAX_PATH];
|
WCHAR path[MAX_PATH];
|
||||||
|
int csidl = 0;
|
||||||
|
|
||||||
if (!wcsicmp(key, L"runtime.system32"))
|
if (!wcsicmp(key, L"runtime.system32") || !wcsicmp(key, L"runtime.drivers") || !wcsicmp(key, L"runtime.wbem"))
|
||||||
{
|
{
|
||||||
#ifdef __x86_64__
|
#ifdef __x86_64__
|
||||||
if (!wcsicmp(assembly->identity.architecture, L"x86"))
|
if (!wcsicmp(assembly->identity.architecture, L"x86")) csidl = CSIDL_SYSTEMX86;
|
||||||
{
|
|
||||||
GetSystemWow64DirectoryW(path, ARRAY_SIZE(path));
|
|
||||||
return strdupW(path);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
GetSystemDirectoryW(path, ARRAY_SIZE(path));
|
if (!csidl) csidl = CSIDL_SYSTEM;
|
||||||
return strdupW(path);
|
|
||||||
}
|
}
|
||||||
if (!wcsicmp(key, L"runtime.windows"))
|
else if (!wcsicmp(key, L"runtime.windows") || !wcsicmp(key, L"runtime.inf")) csidl = CSIDL_WINDOWS;
|
||||||
|
else if (!wcsicmp(key, L"runtime.programfiles"))
|
||||||
{
|
{
|
||||||
GetWindowsDirectoryW(path, ARRAY_SIZE(path));
|
#ifdef __x86_64__
|
||||||
return strdupW(path);
|
if (!wcsicmp(assembly->identity.architecture, L"x86")) csidl = CSIDL_PROGRAM_FILESX86;
|
||||||
|
#endif
|
||||||
|
if (!csidl) csidl = CSIDL_PROGRAM_FILES;
|
||||||
|
}
|
||||||
|
else if (!wcsicmp(key, L"runtime.commonfiles"))
|
||||||
|
{
|
||||||
|
#ifdef __x86_64__
|
||||||
|
if (!wcsicmp(assembly->identity.architecture, L"x86")) csidl = CSIDL_PROGRAM_FILES_COMMONX86;
|
||||||
|
#endif
|
||||||
|
if (!csidl) csidl = CSIDL_PROGRAM_FILES_COMMON;
|
||||||
|
}
|
||||||
|
#ifdef __x86_64__
|
||||||
|
else if (!wcsicmp(key, L"runtime.programfilesx86")) csidl = CSIDL_PROGRAM_FILESX86;
|
||||||
|
else if (!wcsicmp(key, L"runtime.commonfilesx86")) csidl = CSIDL_PROGRAM_FILES_COMMONX86;
|
||||||
|
#endif
|
||||||
|
else if (!wcsicmp(key, L"runtime.programdata")) csidl = CSIDL_COMMON_APPDATA;
|
||||||
|
else if (!wcsicmp(key, L"runtime.fonts")) csidl = CSIDL_FONTS;
|
||||||
|
|
||||||
|
if (!csidl)
|
||||||
|
{
|
||||||
|
FIXME("Unknown expression %s\n", debugstr_w(key));
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
if (!SHGetSpecialFolderPathW(NULL, path, csidl, TRUE))
|
||||||
|
{
|
||||||
|
ERR("Failed to get folder path for %s\n", debugstr_w(key));
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
FIXME("Unknown expression %s\n", debugstr_w(key));
|
if (!wcsicmp(key, L"runtime.inf")) wcscat(path, L"\\inf");
|
||||||
return NULL;
|
else if (!wcsicmp(key, L"runtime.drivers")) wcscat(path, L"\\drivers");
|
||||||
|
else if (!wcsicmp(key, L"runtime.wbem")) wcscat(path, L"\\wbem");
|
||||||
|
return strdupW(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
static WCHAR *expand_expression(struct assembly_entry *assembly, const WCHAR *expression)
|
static WCHAR *expand_expression(struct assembly_entry *assembly, const WCHAR *expression)
|
||||||
|
|
Loading…
Reference in New Issue