سؤال

I created an installer that run vcredist_x86.exe (version 9.0.x.x) as part of the installation. Before installing it however I would like to know if it's already in the user's system. I basically need to detect not only that the DLLs are present but that they have the right version number. Is there any reliable way to do that?

I'm using NSIS but any solution would be welcome.

هل كانت مفيدة؟

المحلول 2

There's no easy way to do that, so I ended up always installing the package whether it's already installed or not. Since it's a small install anyway it doesn't make much difference.

نصائح أخرى

Try this:

!include "x64.nsh"

Section
  var /GLOBAL hasCRT
  !define CRTCHECKDLL msvcr80.dll
  !define CRTCHECKNAME 'Microsoft.VC80.CRT,version="8.0.50727.6195",type="win32",processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b"'
  push '${CRTCHECKDLL}'
  push '${CRTCHECKNAME}'
  call WinSxS_HasAssembly
  pop $hasCRT
  DetailPrint ${CRTCHECKDLL}=$hasCRT
SectionEnd
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top