msi: Handle the CompLocator table in the AppSearch action.
This commit is contained in:
parent
44349af11a
commit
e6431cd06e
@ -28,6 +28,7 @@
|
|||||||
#include "msiquery.h"
|
#include "msiquery.h"
|
||||||
#include "msidefs.h"
|
#include "msidefs.h"
|
||||||
#include "winver.h"
|
#include "winver.h"
|
||||||
|
#include "shlwapi.h"
|
||||||
#include "wine/unicode.h"
|
#include "wine/unicode.h"
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
#include "msipriv.h"
|
#include "msipriv.h"
|
||||||
@ -157,13 +158,26 @@ static void ACTION_FreeSignature(MSISIGNATURE *sig)
|
|||||||
static UINT ACTION_AppSearchComponents(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNATURE *sig)
|
static UINT ACTION_AppSearchComponents(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNATURE *sig)
|
||||||
{
|
{
|
||||||
static const WCHAR query[] = {
|
static const WCHAR query[] = {
|
||||||
's','e','l','e','c','t',' ','*',' ',
|
'S','E','L','E','C','T',' ','*',' ',
|
||||||
'f','r','o','m',' ',
|
'F','R','O','M',' ',
|
||||||
'C','o','m','p','L','o','c','a','t','o','r',' ',
|
'`','C','o','m','p','L','o','c','a','t','o','r','`',' ',
|
||||||
'w','h','e','r','e',' ','S','i','g','n','a','t','u','r','e','_',' ','=',' ',
|
'W','H','E','R','E',' ','`','S','i','g','n','a','t','u','r','e','_','`',' ','=',' ',
|
||||||
'\'','%','s','\'',0};
|
'\'','%','s','\'',0};
|
||||||
MSIRECORD *row;
|
static const WCHAR sigquery[] = {
|
||||||
LPWSTR guid;
|
'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
|
||||||
|
'`','S','i','g','n','a','t','u','r','e','`',' ',
|
||||||
|
'W','H','E','R','E',' ','`','S','i','g','n','a','t','u','r','e','`',' ','=',' ',
|
||||||
|
'\'','%','s','\'',0};
|
||||||
|
|
||||||
|
MSIRECORD *row, *rec;
|
||||||
|
LPCWSTR signature, guid;
|
||||||
|
BOOL sigpresent = TRUE;
|
||||||
|
BOOL isdir;
|
||||||
|
UINT type;
|
||||||
|
WCHAR path[MAX_PATH];
|
||||||
|
DWORD size = MAX_PATH;
|
||||||
|
LPWSTR ptr;
|
||||||
|
DWORD attr;
|
||||||
|
|
||||||
TRACE("%s\n", debugstr_w(sig->Name));
|
TRACE("%s\n", debugstr_w(sig->Name));
|
||||||
|
|
||||||
@ -176,11 +190,45 @@ static UINT ACTION_AppSearchComponents(MSIPACKAGE *package, LPWSTR *appValue, MS
|
|||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
guid = msi_dup_record_field( row, 2 );
|
signature = MSI_RecordGetString(row, 1);
|
||||||
FIXME("AppSearch CompLocator (%s) unimplemented\n", debugstr_w(guid));
|
guid = MSI_RecordGetString(row, 2);
|
||||||
msi_free( guid );
|
type = MSI_RecordGetInteger(row, 3);
|
||||||
msiobj_release( &row->hdr );
|
|
||||||
|
|
||||||
|
rec = MSI_QueryGetRecord(package->db, sigquery, signature);
|
||||||
|
if (!rec)
|
||||||
|
sigpresent = FALSE;
|
||||||
|
|
||||||
|
*path = '\0';
|
||||||
|
MsiLocateComponentW(guid, path, &size);
|
||||||
|
if (!*path)
|
||||||
|
goto done;
|
||||||
|
|
||||||
|
attr = GetFileAttributesW(path);
|
||||||
|
if (attr == INVALID_FILE_ATTRIBUTES)
|
||||||
|
goto done;
|
||||||
|
|
||||||
|
isdir = (attr & FILE_ATTRIBUTE_DIRECTORY);
|
||||||
|
|
||||||
|
if (type != msidbLocatorTypeDirectory && sigpresent && !isdir)
|
||||||
|
{
|
||||||
|
*appValue = strdupW(path);
|
||||||
|
}
|
||||||
|
else if (!sigpresent && (type != msidbLocatorTypeDirectory || isdir))
|
||||||
|
{
|
||||||
|
if (type == msidbLocatorTypeFileName)
|
||||||
|
{
|
||||||
|
ptr = strrchrW(path, '\\');
|
||||||
|
*(ptr + 1) = '\0';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
PathAddBackslashW(path);
|
||||||
|
|
||||||
|
*appValue = strdupW(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
done:
|
||||||
|
if (rec) msiobj_release(&rec->hdr);
|
||||||
|
msiobj_release(&row->hdr);
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5228,10 +5228,7 @@ static void test_complocator(void)
|
|||||||
|
|
||||||
lstrcpyA(expected, CURR_DIR);
|
lstrcpyA(expected, CURR_DIR);
|
||||||
lstrcatA(expected, "\\abelisaurus");
|
lstrcatA(expected, "\\abelisaurus");
|
||||||
todo_wine
|
|
||||||
{
|
|
||||||
ok(!lstrcmpA(prop, expected), "Expected %s, got %s\n", expected, prop);
|
ok(!lstrcmpA(prop, expected), "Expected %s, got %s\n", expected, prop);
|
||||||
}
|
|
||||||
|
|
||||||
size = MAX_PATH;
|
size = MAX_PATH;
|
||||||
r = MsiGetPropertyA(hpkg, "BACTROSAURUS", prop, &size);
|
r = MsiGetPropertyA(hpkg, "BACTROSAURUS", prop, &size);
|
||||||
@ -5254,10 +5251,7 @@ static void test_complocator(void)
|
|||||||
|
|
||||||
lstrcpyA(expected, CURR_DIR);
|
lstrcpyA(expected, CURR_DIR);
|
||||||
lstrcatA(expected, "\\");
|
lstrcatA(expected, "\\");
|
||||||
todo_wine
|
|
||||||
{
|
|
||||||
ok(!lstrcmpA(prop, expected), "Expected %s, got %s\n", expected, prop);
|
ok(!lstrcmpA(prop, expected), "Expected %s, got %s\n", expected, prop);
|
||||||
}
|
|
||||||
|
|
||||||
size = MAX_PATH;
|
size = MAX_PATH;
|
||||||
r = MsiGetPropertyA(hpkg, "FALCARIUS", prop, &size);
|
r = MsiGetPropertyA(hpkg, "FALCARIUS", prop, &size);
|
||||||
@ -5300,10 +5294,7 @@ static void test_complocator(void)
|
|||||||
|
|
||||||
lstrcpyA(expected, CURR_DIR);
|
lstrcpyA(expected, CURR_DIR);
|
||||||
lstrcatA(expected, "\\");
|
lstrcatA(expected, "\\");
|
||||||
todo_wine
|
|
||||||
{
|
|
||||||
ok(!lstrcmpA(prop, expected), "Expected %s, got %s\n", expected, prop);
|
ok(!lstrcmpA(prop, expected), "Expected %s, got %s\n", expected, prop);
|
||||||
}
|
|
||||||
|
|
||||||
size = MAX_PATH;
|
size = MAX_PATH;
|
||||||
r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size);
|
r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size);
|
||||||
@ -5311,10 +5302,7 @@ static void test_complocator(void)
|
|||||||
|
|
||||||
lstrcpyA(expected, CURR_DIR);
|
lstrcpyA(expected, CURR_DIR);
|
||||||
lstrcatA(expected, "\\neosodon\\");
|
lstrcatA(expected, "\\neosodon\\");
|
||||||
todo_wine
|
|
||||||
{
|
|
||||||
ok(!lstrcmpA(prop, expected), "Expected %s, got %s\n", expected, prop);
|
ok(!lstrcmpA(prop, expected), "Expected %s, got %s\n", expected, prop);
|
||||||
}
|
|
||||||
|
|
||||||
size = MAX_PATH;
|
size = MAX_PATH;
|
||||||
r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size);
|
r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user