I currently want to create a installer for a VS2017 project. This project has as prerequisite vcredist_x64.
To create an installer I have installed: - ClickOnce Publishing (via VS2017 installer) - Microsoft Visual Studio 2017 Installer Projects (VS2017 Addon by Microsoft)
Now I created a setup project and in properties => prerequisite I selected Visual C++ "14" Runtime Libraries (x64)
and Download prerequisites from the component vendor's web site
.
If I now start created setup.exe I'm getting on my target machine an error during installing of prerequisites: The following packages could not be found:
(there is not a single packages listed).
Log file:
The following properties have been set: Property: [AdminUser] = true {boolean} Property: [InstallMode] = HomeSite {string} Property: [NTProductType] = 1 {int} Property: [ProcessorArchitecture] = AMD64 {string} Property: [VersionNT] = 10.0.0 {version} Running checks for package 'Visual C++ "14" Runtime Libraries (x64)', phase BuildList Running MsiProductCheck with ProductCode '{C99E2ADC-0347-336E-A603-F1992B09D582}' MsiQueryProductState returned '-1' Setting value '-1 {int}' for property 'VCRedistInstalled' The following properties have been set for package 'Visual C++ "14" Runtime Libraries (x64)': Property: [VCRedistInstalled] = -1 {int} Running checks for command 'vc_redist.x64.exe' Result of running operator 'ValueGreaterThanEqualTo' on property 'VCRedistInstalled' and value '3': false Result of running operator 'ValueEqualTo' on property 'AdminUser' and value 'false': false Result of running operator 'ValueNotEqualTo' on property 'ProcessorArchitecture' and value 'AMD64': false Result of running operator 'VersionLessThan' on property 'VersionNT' and value '6.00': false Result of checks for command 'vc_redist.x64.exe' is 'Install' 'Visual C++ "14" Runtime Libraries (x64)' RunCheck result: Install Needed Installation of components 'Visual C++ "14" Runtime Libraries (x64)' was accepted. Copying files to temporary directory "C:\Users\blubb_user\AppData\Local\Temp\VSD1A14.tmp\" Error: The following package files could not be found:
In VS 2015 I had same trouble. Fix there was to fix PublicKey in bootstrapp file. But I was not able to find correct PublicKey. I was trying using the PublicKey of signature of matching installer. In C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\vcredist_x64\product.xml
GUID C99E2ADC-0347-336E-A603-F1992B09D582
is mentioned, so I looked for setup with this GUID in C:\ProgramData\Package Cache\
and took this PublicKey.
Any idea how to fix it for VS2017?
Update (Solution):
I was able to fix it for me (VS2017 Update 7): In packages.xml (C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\vcredist_x64\en) path of VCRedistExe was invalid. Instead of
<String Name="VCRedistExe">https://aka.ms/vs/15/release/26405.00/VC_Redist.x64.exe</String>
I have now
<String Name="VCRedistExe">https://aka.ms/vs/15/release/26429.04/VC_Redist.x64.exe</String>
C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\vcredist_x64\product.xml I changed too
<Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper" ProductCode="Microsoft.Visual.C++.14.0.x64">
<!-- Defines list of files to be copied on build -->
<PackageFiles CopyAllPackageFiles="false">
<PackageFile Name="vc_redist.x64.exe" HomeSite="VCRedistExe" PublicKey="3082010a0282010100a829fed410c8ff550a9e990003528fdcb0bff9abf851fe5c8c54c227ce4c2b96ebdb811ccb862b79ca757eb867832686bdd62f1c3ec758aa8f6f95fb5afca7c61bc1c3e84c174e223db75b565c7fd75af52dbabba609bf067cee98fe40f930b86bfe406f74b3b8d63849c9d087072f31dfb6bc4ea3d09eb7627b5670754f67bf05cca3aebe0092c21b50a1613b100001b186d029f340f50fd9a30f57ab6309a8dca96ae74743a7be15c43d27a4e8565288cf5999a10084369bd039d22a0d2fe604e2bf13968883a95137184189e2f9859d8e651a3d0364ccc5de50705df20b85a98fb145e877ff839d09bb72e0e6560895b92b83128931fce758721dbdf983230203010001" />
</PackageFiles>
<InstallChecks>
<MsiProductCheck Property="VCRedistInstalled" Product="{03EBF679-E886-38AD-8E70-28658449F7F9}"/>
</InstallChecks>
<!-- Defines how to invoke the setup for the Visual C++ 14.0 redist -->
<Commands Reboot="Defer">
<Command PackageFile="vc_redist.x64.exe" Arguments=' /q '>
<!-- These checks determine whether the package is to be installed -->
<InstallConditions>
<BypassIf Property="VCRedistInstalled" Compare="ValueGreaterThanOrEqualTo" Value="3"/>
<!-- Block install if user does not have admin privileges -->
<FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
<!-- Block install on any platform other than x64 -->
<FailIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="AMD64" String="InvalidOS"/>
<!-- Block install on Vista or below -->
<FailIf Property="VersionNT" Compare="VersionLessThan" Value="6.00" String="InvalidPlatformWinNT"/>
</InstallConditions>
<ExitCodes>
<ExitCode Value="0" Result="Success"/>
<ExitCode Value="3010" Result="SuccessReboot"/>
<DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
</ExitCodes>
</Command>
</Commands>
</Product>
I'm not sure about Product="{03EBF679-E886-38AD-8E70-28658449F7F9}"
, because Setup has GUID {80586c77-db42-44bb-bfc8-7aebbb220c00}
(MsiProductCheck does not work with it), so I took GUID from Microsoft Visual C++ 2017 x64 Minimum Runtime - 14.14.26429. Another possibility is to use GUID from Microsoft Visual C++ 2017 x64 Additional Runtime - 14.14.26429 ({B12F584A-DE7A-3EE3-8EC4-8A64DBC0F2A7}
). Minimum and Additional Runtime will be installed with script above, so it should doesn't matter which GUID we take.