How to easily install Microsoft VC ++ in Inno Setup?

How to easily install Microsoft VC ++ in Inno Setup? I used the following code, most of the installation does not work, except for the installation completion window.

Here is my [Run] section: -

 [Run] Filename: "{app}\bin\vcredist_x86.exe"; \ Parameters: "/passive /verysilent /norestart /q:a /c:""VCREDI~3.EXE /q:a /c:""""msiexec /i vcredist.msi /qn"""" """; \ Check: VCRedistNeedsInstall; WorkingDir: {app}\bin;Flags: runminimized nowait; \ StatusMsg: Installing CRT... 
+8
inno-setup
source share
4 answers

You can add them to your script setup:

 [Files] Source: "vcredist_x86.exe"; DestDir: {tmp}; Flags: deleteafterinstall [Run] Filename: {tmp}\vcredist_x86.exe; \ Parameters: "/q /passive /Q:a /c:""msiexec /q /i vcredist.msi"""; \ StatusMsg: "Installing VC++ 2008 Redistributables..." 

Please note that the launch options will change slightly if you have been using a different redistributable version since 2008.

+5
source share

I modified the above code as follows. Then I worked correctly, and the whole installation was quite smooth and silent.

 [Run] Filename: "{app}\bin\vcredist_x86.exe"; \ Parameters: "/q /norestart /q:a /c:""VCREDI~3.EXE /q:a /c:""""msiexec /i vcredist.msi /qn"""" """; \ Check: VCRedistNeedsInstall; WorkingDir: {app}\bin; 

References:

+2
source share

For a smooth installation, check if necessary to install the redistributable. If the installed version is already updated (quite likely), do not even unpack it.

 [Files] ; VC++ redistributable runtime. Extracted by VC2017RedistNeedsInstall(), if needed. Source: ".\Redist\VC_redist_2017.x64.exe"; DestDir: {tmp}; Flags: dontcopy [Run] Filename: "{tmp}\VC_redist_2017.x64.exe"; StatusMsg: "{cm:InstallingVC2017redist}"; Parameters: "/quiet"; Check: VC2017RedistNeedsInstall ; Flags: waituntilterminated [Code] function VC2017RedistNeedsInstall: Boolean; var Version: String; begin if (RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Version', Version)) then begin // Is the installed version at least 14.14 ? Log('VC Redist Version check : found ' + Version); Result := (CompareStr(Version, 'v14.14.26429.03')<0); end else begin // Not even an old version installed Result := True; end; if (Result) then begin ExtractTemporaryFile('VC_redist_2017.x64.exe'); end; end; 

Please note that redistributable 14.14 is also suitable for VS2015.

+2
source share

Here is my solution:

 Filename: "{tmp}\vc_redist.x86.exe"; Parameters: "/q /norestart"; \ Check: VCRedistNeedsInstall; StatusMsg: "Installing VC++ redistributables..." 
0
source share

All Articles