wrybread
29th July 2013 20:25 UTC
Possible for NSIS to install Visual C++ packages?
I'd like to install the Visual C++ 2010 Redistributable from an NSIS installer. Is that possible?
I've seen many other installers do this, but I don't think I've seen an NSIS package do it.
FYI, this is the VC++ package I'm referring to:
http://www.microsoft.com/en-us/downl...s.aspx?id=5555
Thanks for any tips.
nawfal
30th July 2013 07:09 UTC
Can't you bundle the redistributable yourself in the installer, copy it to some temp location, and then run the exe from there? Or do you want it all silently? Or do you want nsis to check for redistributable itself in the machine, and download from the internet if not installed?
wrybread
30th July 2013 20:40 UTC
Thanks for the reply.
Ideally I'd like to check for the presence of VC2010 and install it if necessary. No need to download it, I can package it with my installer.
nawfal
31st July 2013 00:02 UTC
You can check registry. See this link http://blogs.msdn.com/b/astebner/arc.../10008146.aspx
Something like:
!include x64.nsh
${If} ${RunningX64}
ReadRegStr $1 HKLM "SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x64" "Installed"
StrCmp $1 1 installed
${Else}
ReadRegStr $1 HKLM "SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86" "Installed"
StrCmp $1 1 installed
${EndIf}
;not installed, so run the installer
ExecWait 'MyPathWhereInstallerIs\vc++2010setup.exe'
installed:
;we are done
You could use the logic If in LogicLib to do the conditional check to make code look better.
wrybread
1st August 2013 05:30 UTC
Thanks hugely, works beautifully.