[PATCH] Common Files is translated to current language

Marcus Meissner marcus at jet.franken.de
Tue Oct 16 14:41:39 CDT 2007


Hi,

In german it is "Gemeinsame Dateien". So handle translated strings.

Ciao, Marcus
---
 dlls/msi/tests/install.c |   31 +++++++++++++++++++++++++------
 1 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c
index 0c50156..d49ed68 100644
--- a/dlls/msi/tests/install.c
+++ b/dlls/msi/tests/install.c
@@ -42,6 +42,7 @@ static const char *msifile2 = "winetest2.msi";
 static const char *mstfile = "winetest.mst";
 static CHAR CURR_DIR[MAX_PATH];
 static CHAR PROG_FILES_DIR[MAX_PATH];
+static CHAR COMMON_FILES_DIR[MAX_PATH];
 
 /* msi database data */
 
@@ -995,19 +996,23 @@ static void create_cab_file(const CHAR *name, DWORD max_size, const CHAR *files)
     ok(res, "Failed to destroy the cabinet\n");
 }
 
-static BOOL get_program_files_dir(LPSTR buf)
+static BOOL get_program_files_dir(LPSTR buf, LPSTR buf2)
 {
     HKEY hkey;
-    DWORD type = REG_EXPAND_SZ, size;
+    DWORD type, size;
 
     if (RegOpenKey(HKEY_LOCAL_MACHINE,
                    "Software\\Microsoft\\Windows\\CurrentVersion", &hkey))
         return FALSE;
 
-    size = MAX_PATH;
+    size = MAX_PATH; type = REG_EXPAND_SZ;
     if (RegQueryValueEx(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)buf, &size))
         return FALSE;
 
+    size = MAX_PATH; type = REG_EXPAND_SZ;
+    if (RegQueryValueEx(hkey, "CommonFilesDir", 0, &type, (LPBYTE)buf2, &size))
+        return FALSE;
+
     RegCloseKey(hkey);
     return TRUE;
 }
@@ -1064,6 +1069,20 @@ static BOOL delete_pf(const CHAR *rel_path, BOOL is_file)
         return RemoveDirectoryA(path);
 }
 
+static BOOL delete_cf(const CHAR *rel_path, BOOL is_file)
+{
+    CHAR path[MAX_PATH];
+
+    lstrcpyA(path, COMMON_FILES_DIR);
+    lstrcatA(path, "\\");
+    lstrcatA(path, rel_path);
+
+    if (is_file)
+        return DeleteFileA(path);
+    else
+        return RemoveDirectoryA(path);
+}
+
 static void delete_test_files(void)
 {
     DeleteFileA("msitest.msi");
@@ -1620,8 +1639,8 @@ static void test_setdirproperty(void)
 
     r = MsiInstallProductA(msifile, NULL);
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
-    ok(delete_pf("Common Files\\msitest\\maximus", TRUE), "File not installed\n");
-    ok(delete_pf("Common Files\\msitest", FALSE), "File not installed\n");
+    ok(delete_cf("msitest\\maximus", TRUE), "File not installed\n");
+    ok(delete_cf("msitest", FALSE), "File not installed\n");
 
     /* Delete the files in the temp (current) folder */
     DeleteFile(msifile);
@@ -2889,7 +2908,7 @@ START_TEST(install)
     if(len && (CURR_DIR[len - 1] == '\\'))
         CURR_DIR[len - 1] = 0;
 
-    get_program_files_dir(PROG_FILES_DIR);
+    get_program_files_dir(PROG_FILES_DIR, COMMON_FILES_DIR);
 
     test_MsiInstallProduct();
     test_MsiSetComponentState();
-- 
1.5.2.4



More information about the wine-patches mailing list