Mike McCormack : msi: Set the InstallerLocation value when registering msi. dll.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Mar 20 06:18:20 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 5052dcccf2cb329d350e3c28f872a61a166481d4
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=5052dcccf2cb329d350e3c28f872a61a166481d4

Author: Mike McCormack <mike at codeweavers.com>
Date:   Sun Mar 19 16:52:31 2006 +0900

msi: Set the InstallerLocation value when registering msi.dll.

---

 dlls/msi/regsvr.c |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/dlls/msi/regsvr.c b/dlls/msi/regsvr.c
index f49b78a..f8bfbbb 100644
--- a/dlls/msi/regsvr.c
+++ b/dlls/msi/regsvr.c
@@ -595,6 +595,39 @@ static struct regsvr_interface const int
     { NULL }			/* list terminator */
 };
 
+static HRESULT register_msiexec(void)
+{
+    static const WCHAR key[] = {
+        'S','o','f','t','w','a','r','e',
+        '\\','M','i','c','r','o','s','o','f','t',
+        '\\','W','i','n','d','o','w','s',
+        '\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n',
+        '\\','I','n','s','t','a','l','l','e','r',0 };
+    static const WCHAR val[] = {
+        'I','n','s','t','a','l','l','e','r','L','o','c','a','t','i','o','n',0 };
+    WCHAR path[MAX_PATH];
+    HKEY hkey;
+    LONG res;
+    INT len;
+
+    len = GetSystemDirectoryW(path, MAX_PATH);
+    if (!len || len > MAX_PATH)
+        return E_FAIL;
+
+    res = RegCreateKeyExW(HKEY_LOCAL_MACHINE, key, 0,
+			  NULL, 0, KEY_READ | KEY_WRITE, NULL,
+			  &hkey, NULL);
+    if (res != ERROR_SUCCESS)
+        return E_FAIL;
+
+    res = RegSetValueExW(hkey, val, 0, REG_SZ,
+			 (BYTE*)path, (len + 1)*sizeof(WCHAR));
+
+    RegCloseKey(hkey);
+
+    return (res == ERROR_SUCCESS) ? S_OK : E_FAIL;
+}
+
 /***********************************************************************
  *		DllRegisterServer (MSI.@)
  */
@@ -607,6 +640,8 @@ HRESULT WINAPI DllRegisterServer(void)
     hr = register_coclasses(coclass_list);
     if (SUCCEEDED(hr))
 	hr = register_interfaces(interface_list);
+    if (SUCCEEDED(hr))
+	hr = register_msiexec();
     return hr;
 }
 




More information about the wine-cvs mailing list