Index: trunk/src/VBox/HostDrivers/VBoxUSB/win/Install/USBInstall.cpp
===================================================================
--- trunk/src/VBox/HostDrivers/VBoxUSB/win/Install/USBInstall.cpp	(revision 31898)
+++ trunk/src/VBox/HostDrivers/VBoxUSB/win/Install/USBInstall.cpp	(revision 36941)
@@ -33,4 +33,26 @@
 #include <stdio.h>
 
+#include <VBox/VBoxDrvCfg-win.h>
+
+static DECLCALLBACK(void) vboxUsbLog(VBOXDRVCFG_LOG_SEVERITY enmSeverity, char * msg, void * pvContext)
+{
+    switch (enmSeverity)
+    {
+        case VBOXDRVCFG_LOG_SEVERITY_FLOW:
+        case VBOXDRVCFG_LOG_SEVERITY_REGULAR:
+            break;
+        case VBOXDRVCFG_LOG_SEVERITY_REL:
+            RTPrintf("%s", msg);
+            break;
+        default:
+            break;
+    }
+}
+
+static DECLCALLBACK(void) vboxUsbPanic(void * pvPanic)
+{
+    AssertFailed();
+}
+
 int usblibOsCreateService(void);
 
@@ -43,4 +65,7 @@
     }
 
+    VBoxDrvCfgLoggerSet(vboxUsbLog, NULL);
+    VBoxDrvCfgPanicSet(vboxUsbPanic, NULL);
+
     RTPrintf("USB installation\n");
 
@@ -49,32 +74,24 @@
     if (RT_SUCCESS(rc))
     {
-        LPSTR  lpszFilePart;
-        TCHAR  szFullPath[MAX_PATH];
-        TCHAR  szCurDir[MAX_PATH];
+        LPWSTR  lpszFilePart;
+        WCHAR  szFullPath[MAX_PATH];
         DWORD  len;
 
-        len = GetFullPathName(".\\VBoxUSB.inf", sizeof(szFullPath), szFullPath, &lpszFilePart);
+        len = GetFullPathNameW(L".\\VBoxUSB.inf", RT_ELEMENTS(szFullPath), szFullPath, &lpszFilePart);
         Assert(len);
 
-        if (GetCurrentDirectory(sizeof(szCurDir), szCurDir) == 0)
-        {
-            rc = RTErrConvertFromWin32(GetLastError());
-            RTPrintf("GetCurrentDirectory failed with rc=%Rrc\n", rc);
+        HRESULT hr = VBoxDrvCfgInfInstall(szFullPath);
+        if (hr == S_OK)
+        {
+            RTPrintf("Installation successful.\n");
         }
         else
         {
-            /* Copy INF file to Windows\INF, so Windows will automatically install it when our USB device is detected */
-            BOOL b = SetupCopyOEMInf(szFullPath, NULL, SPOST_PATH, 0, NULL, 0, NULL, NULL);
-            if (b == FALSE)
-            {
-                rc = RTErrConvertFromWin32(GetLastError());
-                RTPrintf("SetupCopyOEMInf failed with rc=%Rrc\n", rc);
-            }
-            else
-            {
-                RTPrintf("Installation successful.\n");
-            }
-        }
-    }
+            rc = -1;
+        }
+    }
+
+    if (RT_SUCCESS(rc))
+        rc = 0;
 
     /** @todo RTR3Term(); */
Index: trunk/src/VBox/HostDrivers/VBoxUSB/win/Install/USBUninstall.cpp
===================================================================
--- trunk/src/VBox/HostDrivers/VBoxUSB/win/Install/USBUninstall.cpp	(revision 31898)
+++ trunk/src/VBox/HostDrivers/VBoxUSB/win/Install/USBUninstall.cpp	(revision 36941)
@@ -23,4 +23,5 @@
 #include <setupapi.h>
 #include <newdev.h>
+
 #include <iprt/assert.h>
 #include <iprt/err.h>
@@ -29,4 +30,5 @@
 #include <iprt/string.h>
 #include <VBox/err.h>
+#include <VBox/VBoxDrvCfg-win.h>
 #include <stdio.h>
 
@@ -35,27 +37,44 @@
 int usblibOsDeleteService(void);
 
+static DECLCALLBACK(void) vboxUsbLog(VBOXDRVCFG_LOG_SEVERITY enmSeverity, char * msg, void * pvContext)
+{
+    switch (enmSeverity)
+    {
+        case VBOXDRVCFG_LOG_SEVERITY_FLOW:
+        case VBOXDRVCFG_LOG_SEVERITY_REGULAR:
+            break;
+        case VBOXDRVCFG_LOG_SEVERITY_REL:
+            printf("%s", msg);
+            break;
+        default:
+            break;
+    }
+}
+
+static DECLCALLBACK(void) vboxUsbPanic(void * pvPanic)
+{
+    AssertFailed();
+}
+
 
 int __cdecl main(int argc, char **argv)
 {
-    BOOL   rc;
-    TCHAR  szFullPath[MAX_PATH];
-    CHAR  *lpszFilePart;
-    int    len;
+    printf("USB uninstallation\n");
 
-    printf("USB uninstallation\n");
+    VBoxDrvCfgLoggerSet(vboxUsbLog, NULL);
+    VBoxDrvCfgPanicSet(vboxUsbPanic, NULL);
 
     usblibOsStopService();
     usblibOsDeleteService();
 
-    len = GetFullPathName(".\\VBoxUSB.inf", sizeof(szFullPath), szFullPath, &lpszFilePart);
-    Assert(len);
-
-    /* Remove the inf plus all associated files. */
-    rc = SetupUninstallOEMInf(szFullPath, SUOI_FORCEDELETE, NULL);
-    if (rc == FALSE)
+    HRESULT hr = VBoxDrvCfgInfUninstallAllF(L"USB", L"USB\\VID_80EE&PID_CAFE", SUOI_FORCEDELETE);
+    if (hr != S_OK)
     {
-        printf("SetupUninstallOEMInf failed with rc=%x\n", GetLastError());
+        printf("SetupUninstallOEMInf failed with hr=0x%x\n", hr);
         return 1;
     }
+
+    printf("USB uninstallation succeeded!\n");
+
     return 0;
 }
