InnoSetup - Check if visual studio 2010 crt redist is installed, if not then run installer

前端 未结 3 1757
天命终不由人
天命终不由人 2021-01-03 11:07

I currently have this in this part of Inno script

[Run]
Filename: {app}\\bin\\vcredist_x86.exe; Parameters: \"/q:a /c:\"\"VCREDI~3.EXE /q:a /c:\"\"\"\"msiexe         


        
相关标签:
3条回答
  • 2021-01-03 11:34

    Follow this link https://www.codeproject.com/Articles/20868/NET-Framework-Installer-for-InnoSetup. Its for both NET framework and VC distributables.You can find out if there is a distributable, say 2013, is installed in a pc or not. If not installed, it will install it for you. I HIGHLY RECOMMEND this.

    0 讨论(0)
  • 2021-01-03 11:44

    Maybe you can use HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs. You can found all versions has been installed. DLL has special name depends of c++ Retribuitable installation:

    90: Visual Studio 2008 (Version 9.0) (atl90.dll, msvcr90.dll, msvcp90.dll)

    100: Visual Studio 2010 (Version 10.0) (atl100.dll, msvcr100.dll, msvcp100.dll)

    110: Visual Studio 2012 (Version 11.0) …110

    120: Visual Studio 2013 (Version 12.0) …120

    140: Visual Studio 2015 (Version 14.0) …140

    150: Visual Studio 2017 (Version 15.0) (atl150.dll, msvcr150.dll, msvcp150.dll)

    160: Visual Studio 2019 (Version 16.0) (atl160.dll, msvcr160.dll, msvcp160.dll)

    Regards,

    0 讨论(0)
  • 2021-01-03 11:52

    I follow the "official" MS way https://stackoverflow.com/a/199783/866333. Not exactly gone viral yet but it works for me.

    See Inno Setup: Verify that .NET 4.0 is installed for working code to detect just one version.

    This is the best example of the code I actually use: http://www.vincenzo.net/isxkb/index.php?title=.NET_-_Detect_framework

    All the above targets the .NET framework. For VCRT I would extract the redistributable from VC2010 and have InnoSetup copy the contents over to the application's target install directory. That way system files don't get altered.

    0 讨论(0)
提交回复
热议问题