Alexandre Julliard : wineboot: Add a generic mechanism for pre-installing things before the main wine.inf section.

Alexandre Julliard julliard at winehq.org
Fri Sep 17 16:03:08 CDT 2021


Module: wine
Branch: master
Commit: 0f284520ec45fcbed25e01399107c1df8c7de91a
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=0f284520ec45fcbed25e01399107c1df8c7de91a

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Sep 17 12:45:46 2021 +0200

wineboot: Add a generic mechanism for pre-installing things before the main wine.inf section.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/setupapi/install.c      |  9 ---------
 loader/wine.inf.in           |  8 ++++++--
 programs/wineboot/wineboot.c | 19 +++++++++----------
 3 files changed, 15 insertions(+), 21 deletions(-)

diff --git a/dlls/setupapi/install.c b/dlls/setupapi/install.c
index 23f0fbdd4f1..df39fd440b3 100644
--- a/dlls/setupapi/install.c
+++ b/dlls/setupapi/install.c
@@ -1076,15 +1076,6 @@ BOOL WINAPI SetupInstallFromInfSectionW( HWND owner, HINF hinf, PCWSTR section,
     BOOL ret;
     int i;
 
-    if (flags & SPINST_REGISTRY)
-    {
-        struct registry_callback_info info;
-
-        info.default_root = key_root;
-        info.delete = FALSE;
-        if (!iterate_section_fields( hinf, section, L"WinePreInstall", registry_callback, &info ))
-            return FALSE;
-    }
     if (flags & SPINST_REGSVR)
     {
         if (iterate_section_fields( hinf, section, L"WineFakeDlls", fake_dlls_callback, NULL ))
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index ac30d9560c6..e600ee82b37 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -26,6 +26,12 @@
 [version]
 signature="$CHICAGO$"
 
+[PreInstall.ntamd64]
+AddReg=Wow64
+
+[PreInstall.ntarm64]
+AddReg=Wow64
+
 [DefaultInstall]
 RegisterDlls=RegisterDllsSection
 WineFakeDlls=FakeDllsWin32,FakeDlls
@@ -78,7 +84,6 @@ AddReg=\
 [DefaultInstall.ntamd64]
 RegisterDlls=RegisterDllsSection
 WineFakeDlls=FakeDllsWin64,FakeDlls
-WinePreInstall=Wow64
 UpdateInis=SystemIni
 CopyFiles=ColorFiles,EtcFiles,InfFiles,NlsFiles,SortFiles
 AddReg=\
@@ -105,7 +110,6 @@ AddReg=\
 [DefaultInstall.ntarm64]
 RegisterDlls=RegisterDllsSection
 WineFakeDlls=FakeDllsWin64,FakeDlls
-WinePreInstall=Wow64
 UpdateInis=SystemIni
 CopyFiles=ColorFiles,EtcFiles,InfFiles,NlsFiles,SortFiles
 AddReg=\
diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c
index 92276fcbe76..4a18265c1de 100644
--- a/programs/wineboot/wineboot.c
+++ b/programs/wineboot/wineboot.c
@@ -1327,7 +1327,7 @@ static HWND show_wait_window(void)
     return hwnd;
 }
 
-static HANDLE start_rundll32( const WCHAR *inf_path, WORD machine )
+static HANDLE start_rundll32( const WCHAR *inf_path, const WCHAR *install, WORD machine )
 {
     WCHAR app[MAX_PATH + ARRAY_SIZE(L"\\rundll32.exe" )];
     STARTUPINFOW si;
@@ -1345,12 +1345,7 @@ static HANDLE start_rundll32( const WCHAR *inf_path, WORD machine )
     len = lstrlenW(app) + ARRAY_SIZE(L" setupapi,InstallHinfSection DefaultInstall 128 ") + lstrlenW(inf_path);
 
     if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return 0;
-
-    lstrcpyW( buffer, app );
-    lstrcatW( buffer, L" setupapi,InstallHinfSection" );
-    lstrcatW( buffer, machine != IMAGE_FILE_MACHINE_TARGET_HOST ? L" Wow64Install" : L" DefaultInstall" );
-    lstrcatW( buffer, L" 128 " );
-    lstrcatW( buffer, inf_path );
+    swprintf( buffer, len, L"%s setupapi,InstallHinfSection %s 128 %s", app, install, inf_path );
 
     if (CreateProcessW( app, buffer, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ))
         CloseHandle( pi.hThread );
@@ -1480,7 +1475,7 @@ static void update_wineprefix( BOOL force )
         if (NtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, sizeof(process),
                                         machines, sizeof(machines), NULL )) machines[0] = 0;
 
-        if ((process = start_rundll32( inf_path, IMAGE_FILE_MACHINE_TARGET_HOST )))
+        if ((process = start_rundll32( inf_path, L"PreInstall", IMAGE_FILE_MACHINE_TARGET_HOST )))
         {
             HWND hwnd = show_wait_window();
             for (;;)
@@ -1490,9 +1485,13 @@ static void update_wineprefix( BOOL force )
                 if (res == WAIT_OBJECT_0)
                 {
                     CloseHandle( process );
-                    if (HIWORD(machines[count]) & 4 /* native machine */) count++;
                     if (!machines[count]) break;
-                    if (!(process = start_rundll32( inf_path, LOWORD(machines[count++]) ))) break;
+                    if (HIWORD(machines[count]) & 4 /* native machine */)
+                        process = start_rundll32( inf_path, L"DefaultInstall", IMAGE_FILE_MACHINE_TARGET_HOST );
+                    else
+                        process = start_rundll32( inf_path, L"Wow64Install", LOWORD(machines[count]) );
+                    count++;
+                    if (!process) break;
                 }
                 else while (PeekMessageW( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageW( &msg );
             }




More information about the wine-cvs mailing list