Embedding other installers. The.NET CF Version 2 redistributable. I then install the Application I wrote for the client using a NSIS script. Right now it is installing all the files in c: I use the following command line to do a silent install: 'vcredist_x86 /q'. I use this in an NSIS script. Thek 16th March 2009 16:59 UTC. We solved this by installing the VS2008 redistributable always! If its already installed this will do nothing if its an old version it will upgrade. From NSIS Wiki. This function detects if VC++ 8.0 redistributables are installed on the machine. If VS 2005+ redist SP1 not installed, install it IfErrors 0.
PermalinkJoin GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up; ---------------------- |
; VCRedist11.nsh |
; ---------------------- |
; |
; Macros to help in installing the Visual C++ 11.0 redistributables (belonging to Visual Studio 2012.) |
; |
; Copyright (c) 2015 Uber Entertainment, Inc. All rights reserved. |
; Authored by Jørgen P. Tjernø <jorgenpt@gmail.com> |
; |
; Licensed under the MIT license, see the LICENSE file in the current directory. |
; |
; |
; This file will define two macros: |
; InstallVCRedist11_32bit and InstallVCRedist11_64bit. The latter will only do something if it's run on a 64-bit OS, otherwise it's a no-op. |
; They both take a parameter as to where they put temporary files, typically used something like: |
; |
; !insertmacro InstallVCRedist11_32bit '${TEMP}MyProduct' |
; !insertmacro InstallVCRedist11_64bit '${TEMP}MyProduct' |
; RMDir /r '${TEMP}MyProduct' |
; |
; The macros expect you to have vcredist_x86.exe and vcredist_x64.exe in the current directory, respectively. They only work right if you use them with the |
; VC11.0 (Visual Studio 2012) redistributable, as they check for a specific registry key to see if the redistributable has already been installed. |
; |
; |
; You can define the following macro in your code to control how status messages are updated: |
; !macro SetStatus Status |
; DetailPrint 'Aw yiss: ${Status}' |
; !macroend |
; |
; You can define the following macro in your code to control wether we check for the redist before installing it. This example will *always* install them, and never check. |
; !macro SkipIfForceDependencies Label |
; Goto ${Label} |
; !macroend |
; |
; You can define the following macro in your code to control how error checking is done. It will be called after our ExecWait calls. |
; !macro MessageBoxIfError Message |
; IfErrors 0 +2 |
; MessageBox MB_OK MB_ICONSTOP '${Message}' |
; !macroend |
!ifndef ___VC_REDIST_11__NSH___ |
!define ___VC_REDIST_11__NSH___ |
!include'X64.nsh' |
!macro _VCRedist11_SetStatus Status |
!ifmacrodef SetStatus |
!insertmacro SetStatus '${Status}' |
!else |
DetailPrint'${Status}' |
!endif |
!macroend |
!macro _VCRedist11_SkipIfForceDependencies Label |
!ifmacrodef SkipIfForceDependencies |
!insertmacro SkipIfForceDependencies ${Label} |
!endif |
!macroend |
!macro _VCRedist11_MessageBoxIfError Message |
!ifmacrodef MessageBoxIfError |
!insertmacro MessageBoxIfError '${Message}' |
!endif |
!macroend |
!macro InstallVCRedist11_32bit TempOutPath |
; Check if 32-bitVisual Studio 2012 redistributable is already installed |
!insertmacro _VCRedist11_SetStatus 'Checking for Visual C++ Redistributable for Visual Studio 2012 Update 4 (32-bit)' |
!insertmacro _VCRedist11_SkipIfForceDependencies +3 |
ReadRegStr$1HKLM'SoftwareMicrosoftDevDivvcServicing11.0RuntimeMinimum' Install |
StrCmp$1'1' InstallVCRedist11_32bitFinish |
; Install 32-bit Visual Studio 2012 Redistributable |
!insertmacro _VCRedist11_SetStatus 'Extracting Visual C++ Redistributable (32-bit)' |
SetOutPath${TempOutPath} |
File'vcredist_x86.exe' |
!insertmacro _VCRedist11_SetStatus 'Installing Visual C++ Redistributable (32-bit)' |
ClearErrors |
ExecWait''${TempOutPath}vcredist_x86.exe' /s /v' /qn'' |
!insertmacro _VCRedist11_MessageBoxIfError 'Failed to install 32-bit Visual C++ Redistributable.' |
InstallVCRedist11_32bitFinish: |
!macroend |
!macro InstallVCRedist11_64bit TempOutPath |
${If}${RunningX64} |
; Check if 64-bit Visual Studio 2012 redistributable is already installed |
!insertmacro _VCRedist11_SetStatus 'Checking for Visual C++ Redistributable for Visual Studio 2012 Update 4 (64-bit)' |
!insertmacro _VCRedist11_SkipIfForceDependencies +4 |
SetRegView64 |
ReadRegStr$1HKLM'SoftwareMicrosoftDevDivvcServicing11.0RuntimeMinimum' Install |
SetRegViewlastused |
StrCmp$1'1' InstallVCRedist11_64bitFinish |
; Install 64-bit Visual Studio 2012 Redistributable |
!insertmacro _VCRedist11_SetStatus 'Extracting Visual C++ Redistributable (64-bit)' |
SetOutPath${TempOutPath} |
File'vcredist_x64.exe' |
!insertmacro _VCRedist11_SetStatus 'Installing Visual C++ Redistributable (64-bit)' |
ClearErrors |
ExecWait''${TempOutPath}vcredist_x64.exe' /s /v' /qn'' |
!insertmacro _VCRedist11_MessageBoxIfError 'Failed to install 64-bit Visual C++ Redistributable.' |
InstallVCRedist11_64bitFinish: |
${EndIf} |
!macroend |
!endif |
Copy lines Copy permalink
I want to install VC++ Redist 2008 in my NSIS setup script. I got the following piece of script to do it:
Basically its for VC++ Redist 2005, but i've edited the reg settings to check for presence of 2008(is it ok to do so?). I need the piece of script/command to install the VC++ Redist 2008.
- where do i store the VC setup and how to execute in silent mode.
- Is it ok to check at
.onInit
?
Could someone please give a complete script which checks for presence and how to execute it in silent mode.
Service Manual for CANON IR3300, downloadable as a PDF file. Manual details • Immediate download after payment. • Delivered as a PDF file. Canon ir3300 hdd software repair.
Thanks,
Seki1 Answer
Well I am not much sure about how to check for if vcredist
is already installed from registry.What I do for my installer is, to check for a particular dll file in the system which the vcredist
installs (and for which I am installing vcredist
). So if that file is present in my $WinDir I assume vcredist
is already installed otherwise I download & install(silently) the vcredist
.
Following is my script which may be of some help to you:
foobarfoobar