#656 Windows Install Bug: gm.exe unable to start correctly

After install of the prebuilt binary GraphicsMagick-1.3.36-Q16-win64-dll.exe , gm.exe just doesn't run.

I get a dialog that says "The application was unable to start correctly (0xc0150002)".

I tried Dependency Walker, and it reports a bad side-by-side config:

Error: The Side-by-Side configuration information for 
"c:\devel\graphicsmagick\CORE_RL_MAGICK_.DLL" contains errors. The 
application has failed to start because its side-by-side configuration is 
incorrect. Please see the application event log or use the command-line 
sxstrace.exe tool for more detail (14001).
  

With the recommendation above, I then ran sxstrace.exe and got this error from near the end of the log:

INFO: Parsing Manifest File C:\Windows\WinSxS\manifests\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9625_none_08e1c10da83fbc83.manifest.
INFO: Manifest Definition Identity is Microsoft.VC90.CRT,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.30729.9625".
INFO: Parsing Manifest File C:\devel\graphicsmagick\Microsoft.VC90.OpenMP.MANIFEST.
INFO: Manifest Definition Identity is Microsoft.VC90.OpenMP,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.30729.6161".
ERROR: Component identity found in manifest does not match the identity of the component requested. Reference is Microsoft.VC90.OpenMP,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8". Definition is Microsoft.VC90.OpenMP,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.30729.6161".
ERROR: Activation Context generation failed.
End Activation Context Generation.
  

AND after some digging I fixed it by digging up the Visual Studio 2008 Redist installer, so this is, I guess, a documentation bug--or an installer bug? Somehow the installer didn't install the Redist package for me.

So: Workaround is to install the VS2008 package from this page:

https://docs.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170

As to how to fix the bug (via documentation or updating the installer), I'll leave that to the maintainers to decide.

Bob Friesenhahn - 2021-12-08

What happened is that the Visual Studio 2019 installer offered to apply a Visual Studio 2008 SP1 update for me. I foolishly agreed. This update apparently has a bug in the SP1 re-distributables in that there is a mis-match between provided files. If I knew what the correct pair of files are, then I could correct my compiler installation and be able to offer a more useful installer.

Due to this problem and much larger ones (e.g. some third-party packages need to be updated due to security issues), I already posted to the graphicsmagick-announce list that

future releases of gm from me will no longer support windows.

Yes, installing the Visual Studio 2008 SP1 redistributables will solve the problem.

For modern Visual Studio, the efficient and simple two-file approach which worked before is no longer allowed. Instead a redistributables package which is 3X larger than the GraphicsMagick installer is required to be installed. But many/most systems won't need this. I refuse to make the GraphicsMagick installer package download so much larger by bundling the whole redistributables as some installers do. Either it needs to download and install from the Internet as needed or the end user needs to somehow know to do it.

Bob