- NSIS Discussion
- Installing VC++ 8.0.CRT redistributables
Archive: Installing VC++ 8.0.CRT redistributables
ojt
25th March 2008 15:17 UTC
Installing VC++ 8.0.CRT redistributables
I know this has been asked before, but I can't seem to find an answer.
I have a program which depends on the VC++ 8.0.CRT redistributables (msvcr80.dll and friends) beeing installed system wide.
We are currently using InstallShield Express, but would like to switch to NSIS.
IS has an option that automatically installs redistributables. How can this be done using NSIS? I'd like to avoid calling the VC++ 8.0.CRT installer, but rather have NSIS do the installation.
I'm a newbee to NSIS, so please spoonfeed me...
demiller9
25th March 2008 16:09 UTC
I did it for our installer by 'unpacking' the VC8 CRT exe, and getting the msi and cab files buried inside it. Then I call ExecWait to install those.
SetOutPath $PLUGINSDIR
File ".\SCC_LIB\WindowsInstaller-KB893803-v2-x86.exe"
File ".\SCC_LIB\VCRedist.msi"
File ".\SCC_LIB\VCRedis1.cab"
ExecWait '"$PLUGINSDIR\WindowsInstaller-KB893803-v2-x86.exe" /quiet /norestart'
ExecWait '"$SYSDIR\msiexec.exe" /i $PLUGINSDIR\VCRedist.msi /qn /norestart'
Windows Installer 3.1 is not standard on Windows 2000, so I am also installing that in the code above.
nooky59
25th March 2008 16:31 UTC
Hey,
I'm on a same subject today (but I embed a VC++ 9.0 CRT) but it's the same.
Here is what I've done :
Section "Microsoft Visual C++ 2008 Redistributable Package (x86)" SEC02
File "C:\Documents and Settings\nooky59\Bureau\vcredist_x86.exe"
ExecWait '$INSTDIR\vcredist_x86.exe /q:a /c:"VCREDI~3.EXE /q:a /c:""msiexec /i vcredist.msi /qn"" "'
SectionEnd
I've found it there :
http://blogs.msdn.com/astebner/archi...-packages.aspx
But I want to go one step further if possible (if someone know how to do). I would like to forbid or to warn the user if he try to uninstall the Visual C++ runtime independently from the add / remove panel.
Is this possible ?
Anders
25th March 2008 18:17 UTC
That is not really possible, but it's not your problem either if the user uninstall's random runtimes.
If the registry entry for VC9CRT does not have a comment, I guess you could add one, but that is a bit ugly and selfish
Or if it's that big of a deal, create a little loader application in VC6 or whatever, that checks for v9 of the CRT and warns/re-installs if needed, then starts your real app. Or maybe switch to MSI, I think it supports stuff like that with it's special shortcuts
Joost Verburg
25th March 2008 18:26 UTC
You can bundle the run-time with your application by adding a manifest file to the application folder. Check MSDN for details.
jimpark
25th March 2008 19:58 UTC
Hey Joost, could not find the article on MSDN. Can you post a link?
Anders
25th March 2008 20:05 UTC
http://msdn2.microsoft.com/en-us/lib...hy(VS.80).aspx maybe
but this would only work on XP and later no?
Joost Verburg
25th March 2008 21:53 UTC
See the second part of this page:
http://msdn2.microsoft.com/en-us/lib...91(VS.80).aspx
Basically you need to install Microsoft.VC80.CRT.manifest along with the run-time files in the same directory as the executable.
nooky59
25th March 2008 23:33 UTC
Originally posted by Joost Verburg
See the second part of this page:
http://msdn2.microsoft.com/en-us/lib...91(VS.80).aspx
Basically you need to install Microsoft.VC80.CRT.manifest along with the run-time files in the same directory as the executable.
Yes, but I don't know if this the same problem for ojt who has initiated the topic but in my particular case, I can't simply put the runtime in the same directory.
It works with my app, but I use Qt and the jpeg support is compiled as a DLL plugin, and it seems that this jpeg plugin don't find the runtime if it is not installed system-wide.
So, there is perhaps other cases where a system-wide install of the runtime is needed.
Thanks for your answers. Yes, perhaps with MSI has I've already seen such messages when trying to removing software parts.
Else, the launcher could be a good idea, I have thought about that, I will do that if it is necessary to protect against runtime removing.
Joost Verburg
26th March 2008 13:49 UTC
It works fine with Qt. Just make sure you compile Qt with the same version of Visual C++.
Huette
30th April 2008 08:27 UTC
Hoi!
Does anybody know, if there's a way to determine, wheter VC80 is already installed or not?
We have to install it via the microsoft redistributable during our updates, because our applications need firebird 2.1 and the gds32.dll (of fb 2.1) needs MS VC80.
kichik
2nd May 2008 00:05 UTC
See Koby's explanation on MSVCRT 8.0. You might be able to use the same interfaces to check if the module is already installed.
http://kobyk.wordpress.com/2008/04/1...sis-installer/
Huette
2nd May 2008 08:56 UTC
thanks, kichik. that's a very interesting tutorial.
you mean i should use the system-plugin to call a api-function, which tells me if i need to install vc8.0?
i gonna try to find that function...