I am creating a setup project for my code using an extension for Visual Studio 2019 setup projects. I tried using the clickonce bootstrapper for downloading vcredist onto the client's computer, but it installed from a website. My client cannot use the internet at their location, so this is not a feasible solution.
I tried creating my own clickonce package for a local version of the .exe which works if it is a fresh install with no other version of the Visual C++ redistributable installed previously.
This is my product.xml
<InstallChecks>
<MsiProductCheck
Property="IsMsiInstalled"
Product="{2cbcedbb-f38c-48a3-a3e1-6c6fd821a7f4}"/>
</InstallChecks>
<!-- Defines how to invoke the setup for .NET Framework redist -->
<Commands Reboot="Immediate">
<!--Command for downlevel and future Operating Systems where netfx is not integrated within OS.-->
<Command PackageFile="vc_redist.x64.exe" Arguments=" /q /norestart /ChainingPackage FullX64Bootstrapper">
<!-- These checks determine whether the package is to be installed -->
<InstallConditions>
<BypassIf Property="IsMsiInstalled"
Compare="ValueGreaterThan" Value="0"/>
<FailIf Property="AdminUser"
Compare="ValueNotEqualTo" Value="True"
String="NotAnAdmin"/>
</InstallConditions>
<ExitCodes>
<ExitCode Value="0" Result="Success" />
<ExitCode Value="3010" Result="SuccessReboot" />
<DefaultExitCode Result="Fail" FormatMessageFromSystem="false" String="GeneralFailure" />
</ExitCodes>
</Command>
</Commands>
</Product>
This is my package.xml
<Package
xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
Name="DisplayName"
Culture="Culture"
>
<!-- Defines a localizable string table for error messages-->
<Strings>
<String Name="DisplayName">Visual C++ "14" Runtime Libraries (x64)</String>
<String Name="Culture">en</String>
<String Name="AdminRequired">You do not have the permissions required to install Visual C++ "14" Runtime Libraries (x64). Please contact your administrator.</String>
<String Name="InvalidOS">Installation of Visual C++ "14" Runtime Libraries (x64) is supported only on x64 machines.</String>
<String Name="GeneralFailure">A failure occurred attempting to install Visual C++ "14" Runtime Libraries (x64).</String>
</Strings>
</Package>
I get an error when running the setup for machines with this package (or a previous version of this package) already installed.
This is the error.
An error occurred while installing system components for (product name). Setup cannot continue until all system components have been successfully installed
>Component Visual C++ "14" Runtime Libraries (x64) has failed to install with the following error message:
"Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel. "
The following components failed to install:
- Visual C++ "14" Runtime Libraries (x64)
See the setup log file located at 'C:\Users\(username)\AppData\Local\Temp\VSD5A50.tmp\install.log' for more information.>
This is install.log
>The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [InstallMode] = SameSite {string}
Property: [NTProductType] = 1 {int}
Property: [ProcessorArchitecture] = AMD64 {string}
Property: [VersionNT] = 10.0.0 {version}
Running checks for package 'Microsoft .NET Framework 4.7.2 (x86 and x64)', phase BuildList
Reading value 'Release' of registry key 'HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Full'
Read integer value 528049
Setting value '528049 {int}' for property 'DotNetFull_Release'
Reading value 'v4' of registry key 'HKLM\SOFTWARE\Microsoft\NET Framework Setup\OS Integration'
Read integer value 1
Setting value '1 {int}' for property 'DotNetFull_OSIntegrated'
Reading value 'ThisVersionInstalled' of registry key 'HKLM\SOFTWARE\Microsoft\Updates\Microsoft .NET Framework 4.7.2\KB4087364'
Unable to read registry value
Not setting value for property 'DotNetFull_MSPDetection'
Reading value 'CurrentState' of registry key 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\Package_for_KB4054542~31bf3856ad364e35~amd64~~6.2.1.2142'
Unable to read registry value
Not setting value for property 'DotNetFull_Win8X86Identity'
Reading value 'CurrentState' of registry key 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\Package_for_KB4054542~31bf3856ad364e35~x86~~6.2.1.2142'
Unable to read registry value
Not setting value for property 'DotNetFull_Win8X64Identity'
Reading value 'CurrentState' of registry key 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\Package_for_KB4054566~31bf3856ad364e35~amd64~~6.3.1.2145'
Unable to read registry value
Not setting value for property 'DotNetFull_Win81X86Identity'
Reading value 'CurrentState' of registry key 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\Package_for_KB4054566~31bf3856ad364e35~x86~~6.3.1.2145'
Unable to read registry value
Not setting value for property 'DotNetFull_Win81X64Identity'
Reading value 'CurrentState' of registry key 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\Package_for_KB4054590~31bf3856ad364e35~amd64~~10.0.1.2072'
Unable to read registry value
Not setting value for property 'DotNetFull_Win10AX86Identity'
Reading value 'CurrentState' of registry key 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\Package_for_KB4054590~31bf3856ad364e35~x86~~10.0.1.2072'
Unable to read registry value
Not setting value for property 'DotNetFull_Win10AX64Identity'
Reading value 'CurrentState' of registry key 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\Package_for_KB4073120~31bf3856ad364e35~amd64~~10.0.1.2072'
Unable to read registry value
Not setting value for property 'DotNetFull_Win10BX86Identity'
Reading value 'CurrentState' of registry key 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\Package_for_KB4073120~31bf3856ad364e35~x86~~10.0.1.2072'
Unable to read registry value
Not setting value for property 'DotNetFull_Win10BX64Identity'
The following properties have been set for package 'Microsoft .NET Framework 4.7.2 (x86 and x64)':
Property: [DotNetFull_OSIntegrated] = 1 {int}
Property: [DotNetFull_Release] = 528049 {int}
Running checks for command 'DotNetFX472\NDP472-KB4054530-x86-x64-AllOS-ENU.exe'
Result of running operator 'ValueEqualTo' on property 'InstallMode' and value 'HomeSite': false
Result of running operator 'ValueGreaterThan' on property 'DotNetFull_Release' and value '461808': true
Result of checks for command 'DotNetFX472\NDP472-KB4054530-x86-x64-AllOS-ENU.exe' is 'Bypass'
Running checks for command 'DotNetFX472\NDP472-KB4054531-Web.exe'
Result of running operator 'ValueNotEqualTo' on property 'InstallMode' and value 'HomeSite': true
Result of checks for command 'DotNetFX472\NDP472-KB4054531-Web.exe' is 'Bypass'
'Microsoft .NET Framework 4.7.2 (x86 and x64)' RunCheck result: No Install Needed
Running checks for package 'Microsoft Visual C++ Redistributable 14.0', phase BuildList
Running MsiProductCheck with ProductCode '{2cbcedbb-f38c-48a3-a3e1-6c6fd821a7f4}'
MsiQueryProductState returned '-1'
Setting value '-1 {int}' for property 'VCRedistInstalled'
The following properties have been set for package 'Microsoft Visual C++ Redistributable 14.0':
Property: [VCRedistInstalled] = -1 {int}
Running checks for command 'vcredist_current_x64\vc_redist.x64.exe'
Skipping ByPassIf because Property 'IsMsiInstalled' was not defined
Result of running operator 'ValueNotEqualTo' on property 'AdminUser' and value 'True': false
Result of checks for command 'vcredist_current_x64\vc_redist.x64.exe' is 'Install'
'Microsoft Visual C++ Redistributable 14.0' RunCheck result: Install Needed
EULA for components 'Microsoft Visual C++ Redistributable 14.0' was accepted.
Copying files to temporary directory "C:\Users\(username)\AppData\Local\Temp\VSDA0C2.tmp\"
Copying from 'C:\Users\(username)\(product)\(installer)\Debug\vcredist_current_x64\vc_redist.x64.exe' to 'C:\Users\(username)\AppData\Local\Temp\VSDA0C2.tmp\vcredist_current_x64\vc_redist.x64.exe'
Verifying file integrity of C:\Users\(username)\AppData\Local\Temp\VSDA0C2.tmp\vcredist_current_x64\vc_redist.x64.exe
WinVerifyTrust returned 0
File trusted
Running checks for package 'Microsoft Visual C++ Redistributable 14.0', phase BeforePackage
Running MsiProductCheck with ProductCode '{2cbcedbb-f38c-48a3-a3e1-6c6fd821a7f4}'
MsiQueryProductState returned '-1'
Setting value '-1 {int}' for property 'VCRedistInstalled'
The following properties have been set for package 'Microsoft Visual C++ Redistributable 14.0':
Property: [VCRedistInstalled] = -1 {int}
Running checks for command 'vcredist_current_x64\vc_redist.x64.exe'
Skipping ByPassIf because Property 'IsMsiInstalled' was not defined
Result of running operator 'ValueNotEqualTo' on property 'AdminUser' and value 'True': false
Result of checks for command 'vcredist_current_x64\vc_redist.x64.exe' is 'Install'
'Microsoft Visual C++ Redistributable 14.0' RunCheck result: Install Needed
Verifying file integrity of C:\Users\(username)\AppData\Local\Temp\VSDA0C2.tmp\vcredist_current_x64\vc_redist.x64.exe
WinVerifyTrust returned 0
File trusted
Installing using command 'C:\Users\(username)\AppData\Local\Temp\VSDA0C2.tmp\vcredist_current_x64\vc_redist.x64.exe' and parameters ' /q /norestart /ChainingPackage FullX64Bootstrapper'
Process exited with code 1638
Status of package 'Microsoft Visual C++ Redistributable 14.0' after install is 'InstallFailed'
>
I've tried following the package and product manifest from Program File (x86)\Microsoft SDKs... for vcredist, but changing it from a website to local, but that doesn't seem to work. Following Microsoft's tutorial also didn't work for me.
I think I am having an issue with the product key not being the right product key.
What I need to do is for the setup to check if the product or a previous version is already installed. If so, then skip this part of the setup.
Guidance is appreciated!
Thanks!
Related
I am new to WSO2 microgateway and was following the steps given in the documentation : "https://docs.wso2.com/display/MG310/Quick+Start+Guide+-+Binary" for exposing the Petstore service via microgateway.
I was able to initialize the API using the swagger file as given in the steps. The Petstore project is also created under the project directory. But when i try to build the project as given in Step 1.2, it fails with an error as shown below. Need suggestions to resolve this issue.
In the ballerina-internal.log file, i get the below error.
[2020-07-16 21:13:19,009] SEVERE {b7a.log.crash} - Array index out of range: 0
java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
at org.ballerinalang.nativeimpl.jvm.interop.JMethodResolver.validateArgumentTypes(JMethodResolver.java:194)
at org.ballerinalang.nativeimpl.jvm.interop.JMethodResolver.validateMethodSignature(JMethodResolver.java:148)
at org.ballerinalang.nativeimpl.jvm.interop.JMethodResolver.resolve(JMethodResolver.java:107)
at org.ballerinalang.nativeimpl.jvm.interop.JInteropMethodValidator.resolveJMethod(JInteropMethodValidator.java:74)
at org.ballerinalang.nativeimpl.jvm.interop.JInteropMethodValidator.validateAndGetJMethod(JInteropMethodValidator.java:61)
at ballerina.jvm.$value$InteropValidator.validateAndGetJMethod(interop.bal:90)
at ballerina.jvm.$value$InteropValidator.call(interop.bal)
at ballerina.compiler_backend_jvm.interop.interop_method_gen.createJMethodWrapper(interop/interop_method_gen.bal:136)
at ballerina.compiler_backend_jvm.interop.interop_method_gen.createJInteropFunctionWrapper(interop/interop_method_gen.bal:128)
at ballerina.compiler_backend_jvm.interop.external_method_gen.createExternalFunctionWrapper(interop/external_method_gen.bal:180)
at ballerina.compiler_backend_jvm.jvm_package_gen.generateClassNameMappings(jvm_package_gen.bal:477)
at ballerina.compiler_backend_jvm.jvm_package_gen.generatePackage(jvm_package_gen.bal:149)
at ballerina.compiler_backend_jvm.jvm_package_gen.generateDependencyList(jvm_package_gen.bal:120)
at ballerina.compiler_backend_jvm.jvm_package_gen.generatePackage(jvm_package_gen.bal:142)
at ballerina.compiler_backend_jvm.jvm_package_gen.generateDependencyList(jvm_package_gen.bal:120)
at ballerina.compiler_backend_jvm.jvm_package_gen.generatePackage(jvm_package_gen.bal:142)
at ballerina.compiler_backend_jvm.jvm_package_gen.generateDependencyList(jvm_package_gen.bal:120)
at ballerina.compiler_backend_jvm.jvm_package_gen.generatePackage(jvm_package_gen.bal:142)
at ballerina.compiler_backend_jvm.jvm_package_gen.generateDependencyList(jvm_package_gen.bal:120)
at ballerina.compiler_backend_jvm.jvm_package_gen.generatePackage(jvm_package_gen.bal:142)
at ballerina.compiler_backend_jvm.main.generateJarBinary(main.bal:86)
at ballerina.compiler_backend_jvm.main.main(main.bal:60)
at ballerina.compiler_backend_jvm.___init.$lambda$main$(compiler_backend_jvm)
at ballerina.compiler_backend_jvm.___init$$Lambda$11.000000001107AEE0.apply(Unknown Source)
at org.ballerinalang.jvm.scheduling.SchedulerItem.execute(Scheduler.java:426)
at org.ballerinalang.jvm.scheduling.Scheduler.run(Scheduler.java:218)
at org.ballerinalang.jvm.scheduling.Scheduler.runSafely(Scheduler.java:191)
at org.ballerinalang.jvm.scheduling.Scheduler$$Lambda$6.0000000010F6DAF0.run(Unknown Source)
at java.lang.Thread.run(Thread.java:813)
Looking at the responses in the comments it looks like the external jdk is not fully compatible with mgw. Not sure on the exact reason though. Here is a bit more background on what going on during the build command and a possible workaround to force mgw use internal jdk.
All mgw distributions (toolkit/runtime) including the binary distribution, contains a jdk internally which is fully compatible with the ballerina version used in the mgw. However during the execution of mgw toolkit command it checks for externally installed jdks (by looking at JAVA_HOME variable) and pick it as the jdk if a compatible version is found in the system. Otherwise it will use the internal jdk.
So to avoid mgw from picking up external jdk, we should set JAVA_HOME variable to "" or invalid location. To do that open micro-gw.bat (assume you are on windows) file in the <TOOLKIT_HOME>/bin directory and around line 55 after SET HOME_CACHE=%MICROGW_HOME%\lib\gateway-balo add SET JAVA_HOME= as command. After the change code block around above line will look like below.
.
.
.
SET PATH=%BALLERINA_HOME%\bin\;%PATH%
SET JAVA_PATH=%MICROGW_HOME%\lib\jdk8u202-b08-jre
SET HOME_CACHE=%MICROGW_HOME%\lib\gateway-balo
REM ******* Below is the line we added to reset the JAVA_HOME *******
SET JAVA_HOME=
REM Check JAVA availability
if EXIST "%JAVA_HOME%" (
ECHO JAVA_HOME: %JAVA_HOME%
.
.
.
Save the file and try the build command again. It should work.
I create a visual studio installer project on visual studio 2017 for word add-in.
The registry is not set when installing it. What do I do wrong during the process?
I have a MyWordAddIn solution which when running through visual studio correctly open Word 2016 and launch the add-in. I went to the HKEY_CURRENT_USER/SOFTWARE/Microsoft/Office/Word/Addins/ and find the myAddIn folder which has been created by visual studio during the debug run.
I now no that I must add 3 string value :
Manifest : file:///[the local directory]/MyWordAddIn.vsto|vstolocal
Description : "MyWordAddInName"
FriendlyName : "My word Add-In name"
and 1 binary value :
LoadBehavior : 0x00000003
Back to My Installer Project MyWordAddInSetup :
right click on it > view > File System :
In the Application Folder I added the Assembly used by my project, the primary output, the manifest and the MyWordAddIn.vsto file.
right click on MyWordAddInSetup > view > Launch Conditions :
set the right .NET FrameWork (4.7.2)
right click on MyWordAddInSetup > view > Registry :
In the HKEY_LOCAL_MACHINE I created the following key tree :
SOFTWARE/Microsoft/Office/Word/Addins/MyWordAddIns
Then, I added three string value in MyWordAddIns :
Manifest : file:///[INSTALLDIR]/MyWordAddIn.vsto|vstolocal
Description : "MyWordAddInName"
FriendlyName : "My word Add-In name"
and 1 binary value :
LoadBehavior : 0x00000003
When Installing my MyWordAddIns, the Assembly, dll, manifest and vsto file are well created inside the chosen folder.
But the local registry is not set with the value I wanted.
If I create it myself then the add-In is correctly added in Word 2016.
I tried to create a simple key 'Test' in the HKEY_LOCAL_MACHINE in the Registry tab of my MyWordAddIns installer. And even that, the 'Test' folder does not appear in the HKEY_LOCAL_MACHINE registry of my machine.
If I set those registry valuenot in the HKEY_LOCAL_MACHINE but in the HKEY_CURRENT_USER it well create the values.
Any solution to corectly set the values in the HKEY_LOCAL_MACHINE ?
I found the problem. It was a user mistake.
To have the key values set in the HKEY_LOCAL_MACHINE you must click on 'Everyon' button during the Installation
I have a pretty straight forward WiX project. Nothing fancy. When trying to perform a MajorUpgrade over an existing installation, it is unable to start the service and inevitably rolls back to the previous version and starts the service just fine. I have removed the Start="install" and manually started the application successfully, so I know it's not a dependency issue.
I have searched endlessly and found no answers to my problem.
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." Schedule="afterInstallFinalize" />
My service install:
<ServiceInstall
Id="ServiceInstaller"
Type="ownProcess"
Name="LsdnService"
DisplayName="Lsdn Service"
Description="Placeholder for now."
Start="auto"
Account="[SERVICEACCOUNT]"
Password="[SERVICEPASSWORD]"
ErrorControl="normal"/>
<ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="LsdnService" Wait="yes" />
I dumped the MSI log to a file and got this error but it is quite vague.
MSI (s) (18:48) [22:41:27:349]: Note: 1: 2205 2: 3: Error
MSI (s) (18:48) [22:41:27:349]: Note: 1: 2228 2: 3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1920
There are some registry modifications during an installation. The installer attempts to read from the registry and inherit the already existing values.
<Property Id="LSDNADDRESS" Value="127.0.0.1">
<RegistrySearch Id="LsdnAddressProperty" Root="HKLM" Key="$(var.RegistryKey)" Name="LsdnAddress" Type="raw" />
</Property>
<Property Id="LSDNPORT" Value="9920">
<RegistrySearch Id="LsdnPortProperty" Root="HKLM" Key="$(var.RegistryKey)" Name="LsdnPort" Type="raw" />
</Property>
<Property Id="LSDNKEY" Value="6f380b07-0b54-4904-8303-95d1ec45d453">
<RegistrySearch Id="LsdnKeyProperty" Root="HKLM" Key="$(var.RegistryKey)" Name="LsdnKey" Type="raw" />
</Property>
Debugging Results: Following a lot of debugging (by original poster - OP) this turned out to be a known MSI issue described here:
https://wix-users.narkive.com/EMfQPDrM/a-bug-get-reg-sz-when-using-type-integer. Nice search work.
What is in a DWORD? (a REG_SZ apparently): Essentially MSI "converts" a DWORD value found via a RegistrySearch
operation to a formatted string - REG_SZ - during upgrade
installations (could be more involved too). This causes services that
expect a DWORD value to fall over on startup during major
upgrades. A very exotic error.
Workaround: One can try to "solve" this problem by making the service code capable of reading both DWORD and REG_SZ.
This yields a more robust solution than solving the problem in a
custom action since it is a "permanent" fix as long as the code is in
there (and the presence of the code alerts other developers about the
problem). Or maybe use only REG_SZ?
Quick Checks: Check the service password and login - obviously. Anything in the
Event Viewer? Windows Key + Tap R + eventvwr.msc + Enter. How to use the Event Viewer to troubleshoot problems with a Windows Service. Perhaps you can try to do a folder diff on the before and after folders and see if you see something unexpected in
the config files? Naturally there will be lots of binary
differences, but check the text files (also encoding). Check the MSI log file
again and search for "value 3" as described here: Tips For Checking MSI Log
Files. Manually copy the new files in place and attempt to start the service via the services.msc applet.
Service Experts: Windows Services Frequently Asked Questions (FAQ). Content seems to be up to date - at face value at least.
These guys claim to be experts on services. I have no idea who they
are.
Look in the "Errors" section in the link above. Here are some
extracts:
1053: The service did not respond to the start or control request in a timely fashion
Why doesn't my Windows Service start automatically after a reboot?
1069: The service did not start due to a logon failure
Generic Check Lists: If none of the above does anything, maybe try these "torpedoes full spread" check-lists (just ideas to start debugging):
Desktop applicaton not opening after installation in client system
Windows Application Startup Error Exception code: 0xe0434352
General Purpose Debugging: Throwing in some general-purpose debugging approaches.
Custom Action Debugging: WIxsharp debug custom action in console
Dependency Scanning: Which winform project files should be packed up into the installer
Some Further Links:
C# Debug folder when copied to another location does not run the exe
wix service install not enough permission
How exactly does the WiX 'Service Install' work internally?
WiX Toolset PermissionEx Problem - App Does Not Run After Installation
It certainly could be a dependency issue. For example, GAC / WinSXS files don't get installed into the GAC until the commit phase which is after StartServices.
I would leave the Start="Install" in and while it's sitting at the failed to start prompt inspect the state of the machine and debug the service start manually. I bet you'll find something missing.
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.
I had this problem with the x86 redist and was eventually able to blame everything on the MS supplied vcredist_x86\product.xml file. You should be able to apply the same fix to the vcredist_x64\product.xml file.
The problem arises due to file name and public key mismatches with the actual redist file that you download from MS.
You must change the name in both the PackageFiles\PackageFile node and Commands\Command node of product.xml to vcredist_x64.exe, as well as renaming the redist package from MS to vcredist_x64.exe. Then, change the publickey attribute in the PackageFile node to match the public key of the EXE you got from MS. You can get this by looking at the EXE's SHA1 certificate with File Explorer (Properties -> Digital Signatures (SHA1) -> Details -> View Certificate -> Details -> Public Key)
Same problem. Microsoft had a typo in their bootstrapper file. In C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\vcredist_x86\product.xml
replace vcredist_x86.exe with vc_redist.x86.exe and reload Visual Studio.
For vs2015,vs2017,vs2019: I had to right-click select Properties on the VC_redist.x86.exe file, then select Digital Signatures tab, select sha256 (not sha1) as above, then Details button to get the Certificate properties window, then the Details tab on that. Then I had to scroll down to Public Key. From there I had to select and Ctrl+C copy the hexadecimal Public key text from the ASCII dump window below since the Copy to File button only creates .cer files. Then I had to edit the product.xml file in Notepad++ launched in Administrator mode or else you won't be able to save the updated file. After pasting the Public key text into the product.xml file, I had to select the lines of the key and replace all the spaces separating the hex digits with "". Then I replaced the PublicKey value and finally saved.
Does anyone else think it odd that in 2020 the vc_redist.*.exe file still has no versioning reflected in the name, that the download site doesn't indicate the version in the text, does not indicate the public key, and that therefore the only way to know it's been updated since you last downloaded it is to compare the file size with your last version?
Update 2020-11-04: After downloading the latest redist from https://support.microsoft.com/en-ca/help/2977003/the-latest-supported-visual-c-downloads and updating product.xml as above, when installing my application with the updated msi, I get an error indicating "The following package files could not be found: vc_runtimeMinimum_x64.msi". In comparing the vc_redist exe I downloaded today to the one I had been using, I noted it is smaller. Looks like I get to go back to an older version.
I am currently trying to upgrade our c++ mfc solution from visual studio 2010 to a visual studio 2013 solution. When i try to build it i get the error MSB4018 The "ResolveComReference" task failed unexpectedly. I enabled fusion logging and this is what it tells me:
=== Pre-bind state information ===
LOG: DisplayName = System
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: System | Domain ID: 1
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Program Files (x86)/MSBuild/12.0/bin/
LOG: Initial PrivatePath = NULL
Calling assembly : Microsoft.Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. ===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files (x86)\MSBuild\12.0\bin\MSBuild.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Program Files (x86)/MSBuild/12.0/bin/System.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/MSBuild/12.0/bin/System/System.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/MSBuild/12.0/bin/System.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/MSBuild/12.0/bin/System/System.EXE.
I understand that msbuild has been moved, but i dont understand why it is trying to find System.dll in the msbuild path, how can i make it look for it in its proper location?
Edit:
I have now also tried upgrading to visual studio 2012 which worked without bigger problems and I did not run into the same problem. However i noticed that when running devenv /upgrade (with vs2013) it seems to completely change everything under vc++ directories (it stayed unchanged when upgrading to vs2012). Could this have something to do with this issue?
Edit2:
Tried to build the project in vs2013 after upgrading it to 2012 (without running devenv /upgrade), this also didnt work so I guess the problem is not related to that...
After enabling diagonostic build output i found that it was 3 broken COM references in the project that where failing to load. Removing these references solved the building issue. These where only showing up as warnings in vs2010 but resulted in MSB4018 in vs 2013 for some reason.
This is your problem:
LOG: Appbase = file:///C:/Program Files (x86)/MSBuild/12.0/bin/
Fix the base folder in your build system if you really need it to point to another filder. However it would probably be better to redo you build system targeting 2013 instead of patching the 2010 version.