James Hawkins : advpack: Perform an Advanced INF-level install in RegInstall.

Alexandre Julliard julliard at wine.codeweavers.com
Fri May 5 12:10:57 CDT 2006


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

Author: James Hawkins <truiken at gmail.com>
Date:   Fri Apr 28 19:57:23 2006 -0500

advpack: Perform an Advanced INF-level install in RegInstall.

---

 dlls/advpack/reg.c |   23 +++++++++--------------
 1 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/dlls/advpack/reg.c b/dlls/advpack/reg.c
index 63801e4..f1ab8e2 100644
--- a/dlls/advpack/reg.c
+++ b/dlls/advpack/reg.c
@@ -222,8 +222,10 @@ static HRESULT write_predefined_strings(
 HRESULT WINAPI RegInstallW(HMODULE hm, LPCWSTR pszSection, const STRTABLEW* pstTable)
 {
     int i;
+    CABINFOW cabinfo;
     WCHAR tmp_ini_path[MAX_PATH];
     HINF hinf = INVALID_HANDLE_VALUE;
+    HRESULT hr = E_FAIL;
 
     TRACE("(%p, %s, %p)\n", hm, debugstr_w(pszSection), pstTable);
 
@@ -246,20 +248,13 @@ HRESULT WINAPI RegInstallW(HMODULE hm, L
     /* flush cache */
     WritePrivateProfileStringW(NULL, NULL, NULL, tmp_ini_path);
 
+    /* FIXME: read AdvOptions val for dwFlags */
+    ZeroMemory(&cabinfo, sizeof(CABINFOW));
+    cabinfo.pszInf = tmp_ini_path;
+    cabinfo.pszSection = (LPWSTR)pszSection;
+    cabinfo.dwFlags = 0;
 
-    if((hinf = SetupOpenInfFileW(tmp_ini_path, NULL, INF_STYLE_WIN4, NULL)) ==
-       INVALID_HANDLE_VALUE) {
-        ERR("Setupapi can't open inf\n");
-        goto done;
-    }
-
-    /* append any layout files */
-    SetupOpenAppendInfFileW(NULL, hinf, NULL);
-
-    /* Need to do a lot more here */
-    SetupInstallFromInfSectionW(NULL, hinf, pszSection,
-                                SPINST_INIFILES | SPINST_REGISTRY | SPINST_PROFILEITEMS,
-                                HKEY_LOCAL_MACHINE, NULL, 0, NULL, NULL, NULL, NULL);
+    hr = ExecuteCabW(NULL, &cabinfo, NULL);
 
 done:
     if (hinf != INVALID_HANDLE_VALUE)
@@ -267,7 +262,7 @@ done:
 
     DeleteFileW(tmp_ini_path);
 
-    return S_OK;
+    return hr;
 }
 
 /***********************************************************************




More information about the wine-cvs mailing list