Old 29th July 2013, 19:25   #1
wrybread
Junior Member
 
Join Date: Oct 2007
Posts: 16
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.
wrybread is offline   Reply With Quote
Old 30th July 2013, 06:09   #2
nawfal
Junior Member
 
Join Date: Jul 2012
Posts: 22
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?
nawfal is offline   Reply With Quote
Old 30th July 2013, 19:40   #3
wrybread
Junior Member
 
Join Date: Oct 2007
Posts: 16
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.
wrybread is offline   Reply With Quote
Old 30th July 2013, 23:02   #4
nawfal
Junior Member
 
Join Date: Jul 2012
Posts: 22
You can check registry. See this link http://blogs.msdn.com/b/astebner/arc.../10008146.aspx

Something like:

code:
!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.
nawfal is offline   Reply With Quote
Old 1st August 2013, 04:30   #5
wrybread
Junior Member
 
Join Date: Oct 2007
Posts: 16
Thanks hugely, works beautifully.
wrybread is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump