James Hawkins : msi: Handle searching for a file with no signature.

Alexandre Julliard julliard at winehq.org
Mon Oct 20 08:00:50 CDT 2008


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

Author: James Hawkins <jhawkins at codeweavers.com>
Date:   Mon Oct 20 04:19:57 2008 -0500

msi: Handle searching for a file with no signature.

---

 dlls/msi/appsearch.c     |   13 +++++++++++++
 dlls/msi/tests/package.c |   25 +++++--------------------
 2 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/dlls/msi/appsearch.c b/dlls/msi/appsearch.c
index 31a1f5d..6d92886 100644
--- a/dlls/msi/appsearch.c
+++ b/dlls/msi/appsearch.c
@@ -164,6 +164,19 @@ static LPWSTR app_search_file(LPWSTR path, MSISIGNATURE *sig)
 
     static const WCHAR root[] = {'\\',0};
 
+    if (!sig->File)
+    {
+        PathRemoveFileSpecW(path);
+        PathAddBackslashW(path);
+
+        attr = GetFileAttributesW(path);
+        if (attr != INVALID_FILE_ATTRIBUTES &&
+            (attr & FILE_ATTRIBUTE_DIRECTORY))
+            return strdupW(path);
+
+        return NULL;
+    }
+
     attr = GetFileAttributesW(path);
     if (attr == INVALID_FILE_ATTRIBUTES || attr == FILE_ATTRIBUTE_DIRECTORY)
         return NULL;
diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c
index 4225af8..a243957 100644
--- a/dlls/msi/tests/package.c
+++ b/dlls/msi/tests/package.c
@@ -6594,10 +6594,7 @@ static void test_appsearch_reglocator(void)
     sprintf(path, "%s\\", CURR_DIR);
     r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-    todo_wine
-    {
-        ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
-    }
+    ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
 
     size = MAX_PATH;
     r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
@@ -6672,19 +6669,13 @@ static void test_appsearch_reglocator(void)
     *ptr = '\0';
     r = MsiGetPropertyA(hpkg, "SIGPROP24", prop, &size);
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-    todo_wine
-    {
-        ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
-    }
+    ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
 
     size = MAX_PATH;
     sprintf(path, "%s\\", CURR_DIR);
     r = MsiGetPropertyA(hpkg, "SIGPROP25", prop, &size);
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-    todo_wine
-    {
-        ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
-    }
+    ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
 
     size = MAX_PATH;
     r = MsiGetPropertyA(hpkg, "SIGPROP26", prop, &size);
@@ -6953,10 +6944,7 @@ static void test_appsearch_inilocator(void)
     sprintf(path, "%s\\", CURR_DIR);
     r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-    todo_wine
-    {
-        ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
-    }
+    ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
 
     size = MAX_PATH;
     lstrcpyA(path, CURR_DIR);
@@ -6964,10 +6952,7 @@ static void test_appsearch_inilocator(void)
     *(ptr + 1) = '\0';
     r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-    todo_wine
-    {
-        ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
-    }
+    ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
 
     size = MAX_PATH;
     r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);




More information about the wine-cvs mailing list