From a8b33400a2874856bf6983e738235a391540bddf Mon Sep 17 00:00:00 2001 From: Whindmar Saksit Date: Wed, 24 Jul 2024 22:55:29 +0200 Subject: [PATCH] [INF][BOOTDATA][SETUPAPI] Use Inf instead of Cmd.exe to register IExplore (#7171) This moves the IExplore registration from cmd.exe (established in 4a4060ce3c139060cf88716b5159b3c563dd2ccf (r52196) for CORE-1370) to syssetup.inf to avoid console popups on first boot. --- boot/bootdata/hivesft.inf | 4 +--- dll/win32/setupapi/install.c | 9 +++++---- media/inf/syssetup.inf | 16 ++++++++++++++++ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/boot/bootdata/hivesft.inf b/boot/bootdata/hivesft.inf index dde9d756a03..7824855220a 100644 --- a/boot/bootdata/hivesft.inf +++ b/boot/bootdata/hivesft.inf @@ -457,9 +457,7 @@ HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions",,0x00000012 HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\ShellServiceObjectDelayLoad",,0x00000012 ; FIXME - Setup doesn't handle extra paths -HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce","",0x00000000,"cmd /c md ""%programfiles%\Internet Explorer\"" && move %windir%\iexplore.exe ""%programfiles%\Internet Explorer\"" && ""%programfiles%\Internet Explorer\iexplore.exe"" /RegServer" -; Create .NET Framework InstallRoot key, reg_sz & full path -HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce","InstallRoot.NET",0x00000000,"cmd /c reg add HKLM\SOFTWARE\Microsoft\.NETFramework /v InstallRoot /t REG_SZ /d %SystemRoot%\Microsoft.NET\Framework\" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\Finalize","1",,"||rundll32.exe setupapi.dll,InstallHinfSection Finalize 128 %systemroot%\inf\syssetup.inf" HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons",,0x00000012 HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu",,0x00000012 diff --git a/dll/win32/setupapi/install.c b/dll/win32/setupapi/install.c index 8cc93d047bf..742c4ba3f19 100644 --- a/dll/win32/setupapi/install.c +++ b/dll/win32/setupapi/install.c @@ -533,9 +533,7 @@ static BOOL do_register_dll( const struct register_dll_info *info, const WCHAR * HMODULE module; HRESULT res; SP_REGISTER_CONTROL_STATUSW status; -#ifdef __WINESRC__ IMAGE_NT_HEADERS *nt; -#endif status.cbSize = sizeof(status); status.FileName = path; @@ -565,7 +563,6 @@ static BOOL do_register_dll( const struct register_dll_info *info, const WCHAR * goto done; } -#ifdef __WINESRC__ if ((nt = RtlImageNtHeader( module )) && !(nt->FileHeader.Characteristics & IMAGE_FILE_DLL)) { /* file is an executable, not a dll */ @@ -604,7 +601,6 @@ static BOOL do_register_dll( const struct register_dll_info *info, const WCHAR * CloseHandle( info.hProcess ); goto done; } -#endif // __WINESRC__ if (flags & FLG_REGSVR_DLLREGISTER) { @@ -697,7 +693,12 @@ static BOOL register_dlls_callback( HINF hinf, PCWSTR field, void *arg ) if (!SetupGetIntField( &context, 4, &flags )) flags = 0; /* get timeout */ +#ifdef __REACTOS__ + /* "11,,cmd.exe,,,/K dir" means default timeout, not a timeout of zero */ + if (!SetupGetIntField( &context, 5, &timeout ) || timeout == 0) timeout = 60; +#else if (!SetupGetIntField( &context, 5, &timeout )) timeout = 60; +#endif /* get command line */ args = NULL; diff --git a/media/inf/syssetup.inf b/media/inf/syssetup.inf index 0196d9bca52..14700f060e1 100644 --- a/media/inf/syssetup.inf +++ b/media/inf/syssetup.inf @@ -144,3 +144,19 @@ Control="System\CurrentControlSet\Control" [Classes] HKLM,%CurrentVersion%\Installer,"InstallerLocation",,"%11%" +HKLM,Software\Microsoft\.NETFramework,InstallRoot,,"%10%\Microsoft.NET\Framework\" + +[DestinationDirs] +IECopy=16422,Internet Explorer + +[Finalize] ; Executed by RunOnceEx on first normal boot +; FIXME: This should be moved to ie.inf,DefaultInstall and executed by [Infs.Always] +CopyFiles=IECopy +RegisterDlls=IEReg + +[IECopy] +iexplore.exe,..\iexplore.exe,,0x00002000 + +[IEReg] +16422,Internet Explorer,iexplore.exe +11,,rundll32.exe,,,"advpack.dll,DelNodeRunDLL32 ""%10%\iexplore.exe"""