win32ss / supermium

Chromium fork for Windows XP/2003 and up
https://win32subsystem.live/supermium/
BSD 3-Clause "New" or "Revised" License
2.17k stars 72 forks source link

On Windows XP SP1, Supermium 124.0.6367.245 R2 gives an error on every startup #814

Open EgorKuzevanov opened 3 weeks ago

EgorKuzevanov commented 3 weeks ago

On Windows XP SP1 (released September 9, 2002), every time I run unpacked Supermium 124.0.6367.245 R2 I get an error related to a library included in the Microsoft Visual C++ 2015 Redistributable Package (which in turn is incompatible with Windows XP SP1): Снимок At the same time, the Supermium browser itself works properly and its official website https://win32subsystem.live/supermium still claims to support Windows XP SP1. As a result, I have to click the OK button every time.

Vangelis66 commented 3 weeks ago

... For the time being, and if/until this is somehow addressed (?) by the maintainer, you must get rid of the custom DirectWrite implementation, i.e. lose all DLLs adjacent to chrome.exe except for progwrp.dll - then you'll fall back to GDI under XP SP1 (just like with the previous 124-r1 release), without getting the annoying prompt about missing api-ms-win-*.dlls; unless someone can come up with XP-SP1-x86-compatible Win10uCRT runtime (the essential part inside MSVC++2015-2019 needed by DWrite.dll to properly function under XP) ...

JoachimHenze commented 3 weeks ago

You can apply the following interim solution, which should avoid the dependency to the new MSVCPP2015 runtime entirely. https://github.com/IDA-RE-things/Chrome-xp-api-adapter/issues/20#issuecomment-2304823691 This works for me on 124r2, and this is how I do currently use it. I do it for different reasons than you, but it will solve our both problems.

I do hope that future versions of Supermium will not break this neat little trick again.

win32ss commented 3 weeks ago

The intent is to eventually redirect all dwrite components towards msvcrt, with an intermediate (p_vcrt) layer to handle whatever msvcrt doesn't have.

JoachimHenze commented 3 weeks ago

sounds like a good idea to aim for minimizing external dependencies.

trlkly commented 3 weeks ago

You should be able to fix this error by installing this:

https://download.visualstudio.microsoft.com/download/pr/566435ac-4e1c-434b-b93f-aecc71e8cffc/0D59EC7FDBF05DE813736BF875CEA5C894FFF4769F60E32E87BD48406BBF0A3A/VC_redist.x86.exe

That is the latest version of Microsoft Visual C++ 2015 Redistributable Package that runs on Windows XP. (From discussion #696)

Vangelis66 commented 3 weeks ago

@JoachimHenze wrote:

which should avoid the dependency to the new MSVCPP2015 runtime entirely.

... But in that way you won't have DirectWrite font rendering under Windows XP SP3; I know you personally prefer (the default under XP) GDI font rendering, but other XP SP3 users may prefer the advantages DW offers :wink: ...

As for OP under XP SP1, you simply proposed what I already did here, but directed the OP to use the alternate wrapper implementation by IDA-RE-things (which offers H/W (paint) accel under XP; unsure whether this feature works under just SP1, though) ... No issue with that myself, the more choice, the merrier :smile: ...

@trlkly wrote:

That is the latest version of Microsoft Visual C++ 2015 Redistributable Package that runs on Windows XP

... Right, but the OP is running XP SP1 x86 and according to his claim:

a library included in the Microsoft Visual C++ 2015 Redistributable Package (which in turn is incompatible with Windows XP SP1)

so it appears that VC_redist.x86.exe file won't install under just XP SP1 ? MS seem to agree here, as the minimum system requirements for MSVC++2015 demand SP3:

https://www.microsoft.com/en-us/download/details.aspx?id=48145

Supported Operating Systems

Windows 10, Windows 7 Service Pack 1, Windows 8, Windows 8.1, Windows Server 2003 Service Pack 2, Windows Server 2008 R2 SP1, Windows Server 2008 Service Pack 2, Windows Server 2012, Windows Vista Service Pack 2, Windows XP Service Pack 3

GeorgeK1ng commented 3 weeks ago

... For the time being, and if/until this is somehow addressed (?) by the maintainer, you must get rid of the custom DirectWrite implementation, i.e. lose all DLLs adjacent to chrome.exe except for progwrp.dll - then you'll fall back to GDI under XP SP1 (just like with the previous 124-r1 release), without getting the annoying prompt about missing api-ms-win-*.dlls; unless someone can come up with XP-SP1-x86-compatible Win10uCRT runtime (the essential part inside MSVC++2015-2019 needed by DWrite.dll to properly function under XP) ...

Something like this? https://github.com/Blaukovitch/API-MS-WIN_XP

trlkly commented 3 weeks ago

@Vangelis66 Yeah, I missed the SP1 part. I presume they have a reason to not use SP3? If not, I would not only recommend installing that, but also subsequent updates.

Yeah, just removing the DLLs will remove the prompt, without affecting actual functionality. I did think it weird that the prompt is there. It should just fail to load silently, seeing as the DLL that loads it (the DWrite DLL) is itself optional.

Fallback to GDI if not all components are present for Directwrite should be silent. Sure, having it not depend on MVC 2015+ would be better. But graceful fallback is the best interim solution.

Vangelis66 commented 3 weeks ago

Something like this? Blaukovitch/API-MS-WIN_XP

IIUC, this project aims to backport various WinAPIs present on Win11/10/8.1 down to Win7/(Vista?/)XP; it's probably how Blaukovitch makes Cr127 work on Win7SP1 :stuck_out_tongue_winking_eye: ; I can't tell whether this project aims/accomplishes support down to XP SP1, which is what OP uses in his VM...

The fact is MS already provide an implementation of those stub DLLs that target XP (so no other APIs from later Windows versions need to be backported), the thing is, though, that vc_redist.x86.exe v14.x requires XP SP3 at minimum to install; whether this is an artificial block on lower SP levels (XP SP0/1/2) is hard to tell (and practically impossible for me to check here); if one feels adventurous, one can extract the Win10UCRT DLLs and probe them with DependencyWalker under XP SP1 - if missing functions are found, then these would have to be replaced/stubbed accordingly :wink: ; but this is above my pay grade :smile: ...

thellmer-source commented 2 weeks ago

For what it's worth, I also get the exact same error message on XP SP3 as well as get it in Vista SP2. The browser still works fine after clicking ok to dismiss the popup.

Vangelis66 commented 2 weeks ago

as well as get it in Vista SP2.

WFM :wink: ; for Vista SP2, look here (you need install KB2999226) ...

The browser still works fine after

Not really; "fine" in that case (v124-r2) means:

  1. No DirectWrite for XP SP3 (fallback to GDI is used)
  2. Vista SP2's inferior/immature/crippled DirectWrite implementation is being used by default (unless you force-disabled it, in such a case GDI is used there, too), instead of the DirectWrite implementation backported from Win10...
trlkly commented 2 weeks ago

@Vangelis66 It works just as well as previous versions.

The point is, usually such error messages mean the app won't run at all. It says "the application has failed to start." It's a misleading message. Ideally, it would not show, and just fall back gracefully.

thellmer-source commented 2 weeks ago

Ah! Well it seems "fine" for the little browsing I do on that machine. But I installed the Visual C++ mentioned above for both the XP and Vista installs and the error message no longer comes up on either.