Index: /trunk/Config.kmk
===================================================================
--- /trunk/Config.kmk	(revision 59388)
+++ /trunk/Config.kmk	(revision 59389)
@@ -545,4 +545,10 @@
 # The main api.
 VBOX_WITH_MAIN = 1
+# Enables proxy stub for MS COM (speeds up setting IPC for objects).
+# (The VBOX_MIDL_PROXY_CLSID and VBOX_MIDL_PROXY_CLSID_IS are just two
+#  representations of the class ID for the proxy stub.)
+#VBOX_WITH_MIDL_PROXY_STUB = 1
+VBOX_MIDL_PROXY_CLSID    := {0bb3b78c-1807-4249-5ba5-ea42d66af0bf}
+VBOX_MIDL_PROXY_CLSID_IS := {0x0bb3b78c,0x1807,0x4249,{0x5b,0xa5,0xea,0x42,0xd6,0x6a,0xf0,0xbf}}
 # Whether to also ship 32-bit main API on 64-bit systems.
 if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), solaris.amd64 win.amd64)
Index: /trunk/src/VBox/Main/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Main/Makefile.kmk	(revision 59388)
+++ /trunk/src/VBox/Main/Makefile.kmk	(revision 59389)
@@ -1044,7 +1044,5 @@
  DLLS += VBoxProxyStub
  VBoxProxyStub_TEMPLATE = VBOXMAINCOMP
- VBoxProxyStub_DEFS     = REGISTER_PROXY_DLL \
- 	PROXY_CLSID_IS="{0x0bb3b78c,0x1807,0x4249,{0x5b,0xa5,0xea,0x42,0xd6,0x6a,0xf0,0xbf}}"
-	# => 0bb3b78c-1807-4249-5ba5-ea42d66af0bf: Also hardcoded in VBoxMergeCOM32On64.wxi and VBoxMergeApp.wxi!
+ VBoxProxyStub_DEFS     = REGISTER_PROXY_DLL PROXY_CLSID_IS="$(VBOX_MIDL_PROXY_CLSID_IS)"
  VBoxProxyStub_DEFS.win.x86 = WIN32
  VBoxProxyStub_SDKS     = VBOX_NTDLL
Index: /trunk/src/VBox/Main/src-all/win/VBoxProxyStub.c
===================================================================
--- /trunk/src/VBox/Main/src-all/win/VBoxProxyStub.c	(revision 59388)
+++ /trunk/src/VBox/Main/src-all/win/VBoxProxyStub.c	(revision 59389)
@@ -401,5 +401,6 @@
     rc = RegOpenKeyExA(hkeyRoot, pszSubRoot, 0 /*fOptions*/, pState->fSamBoth, &pState->hkeyClassesRootDst);
     AssertMsgReturn(rc == ERROR_SUCCESS, ("%u\n", rc), pState->rc = rc);
-    rc = RegOpenKeyExA(pState->hkeyClassesRootDst, "CLSID", 0 /*fOptions*/, pState->fSamBoth, &pState->hkeyClsidRootDst);
+    rc = RegCreateKeyExW(pState->hkeyClassesRootDst, L"CLSID", 0 /*Reserved*/, NULL /*pszClass*/, 0 /*fOptions*/,
+                         pState->fSamBoth, NULL /*pSecAttr*/, &pState->hkeyClsidRootDst, NULL /*pdwDisposition*/);
     AssertMsgReturn(rc == ERROR_SUCCESS, ("%u\n", rc), pState->rc = rc);
 
@@ -491,5 +492,5 @@
     {
         /* Try open the CLSID subkey, it's fine if it doesn't exists. */
-        rc = RegOpenKeyExA(pState->aAltDeletes[i].hkeyClasses, "CLSID", 0 /*fOptions*/, pState->fSamDelete,
+        rc = RegOpenKeyExW(pState->aAltDeletes[i].hkeyClasses, L"CLSID", 0 /*fOptions*/, pState->fSamDelete,
                            &pState->aAltDeletes[i].hkeyClsid);
         if (rc == ERROR_SUCCESS || rc == ERROR_FILE_NOT_FOUND)
@@ -537,6 +538,10 @@
     if (pState->hkeyInterfaceRootDst == NULL)
     {
-        rc = RegOpenKeyExW(pState->hkeyClassesRootDst, L"Interface", 0 /*fOptions*/, pState->fSamBoth,
-                           &pState->hkeyInterfaceRootDst);
+        if (pState->fSamUpdate)
+            rc = RegCreateKeyExW(pState->hkeyClassesRootDst, L"Interface", 0 /*Reserved*/, NULL /*pszClass*/, 0 /*fOptions*/,
+                                 pState->fSamBoth, NULL /*pSecAttr*/, &pState->hkeyClsidRootDst, NULL /*pdwDisposition*/);
+        else
+            rc = RegOpenKeyExW(pState->hkeyClassesRootDst, L"Interface", 0 /*fOptions*/, pState->fSamBoth,
+                               &pState->hkeyClsidRootDst);
         AssertMsgReturnStmt(rc == ERROR_SUCCESS, ("%u\n", rc), pState->hkeyInterfaceRootDst = NULL,  pState->rc = rc);
     }
@@ -1015,5 +1020,14 @@
     }
 
-    rc = RegOpenKeyExW(pState->hkeyClassesRootDst, L"AppID", 0 /*fOptions*/, pState->fSamBoth, &hkeyAppIds);
+    if (pState->fUpdate)
+        rc = RegCreateKeyExW(pState->hkeyClassesRootDst, L"AppID", 0 /*Reserved*/, NULL /*pszClass*/, 0 /*fOptions*/,
+                             pState->fSamBoth, NULL /*pSecAttr*/, &hkeyAppIds, NULL /*pdwDisposition*/);
+
+    else
+    {
+        rc = RegOpenKeyExW(pState->hkeyClassesRootDst, L"AppID", 0 /*fOptions*/, pState->fSamBoth, &hkeyAppIds);
+        if (rc == ERROR_FILE_NOT_FOUND)
+            return ERROR_SUCCESS;
+    }
     AssertMsgReturn(rc == ERROR_SUCCESS, ("%u\n", rc), pState->rc = rc);
 
@@ -1317,4 +1331,5 @@
             vbpsCreateRegKeyWithDefaultValueAA(pState, hkeyMajMin, "FLAGS", "0", __LINE__);
 
+#if 0 /* Skip it. It's for non-existing help files and regsvr32 and msi have different ides about trailing slashes. */
             /* {UUID}/Major.Minor/HELPDIR */
             rc = RTUtf16Copy(wszBuf, MAX_PATH, pwszVBoxDir); AssertRC(rc);
@@ -1324,4 +1339,5 @@
             wszBuf[off] = '\0';
             vbpsCreateRegKeyWithDefaultValueAW(pState, hkeyMajMin, "HELPDIR", wszBuf, __LINE__);
+#endif
 
             vbpsCloseKey(pState, hkeyMajMin, __LINE__);
@@ -1424,5 +1440,6 @@
                 vbpsCreateRegKeyWithDefaultValueAA(pState, hkeyIfId, "NumMethods", szMethods, __LINE__);
                 /** @todo Not having the typelib here means we'll have to fix the orphan cleanup
-                 *        code below. */
+                 *        code below.
+                 *  Update: MSI puts the typelib here. Hmm. */
 
                 vbpsCloseKey(pState, hkeyIfId, __LINE__);
@@ -2201,4 +2218,7 @@
 #endif
 
+    /** @todo Should probably skip this when VBoxSVC is already running...  Use
+     *        some mutex or something for checking. */
+
     /*
      * Find the VirtualBox application directory first.
