Visual Studio 2010 SP1安装项目不会安装Visual C++ 2010运行时库的SP1
我使用的是VS 2010 SP1,并且我已经创建了一个VS安装项目来安装我的应用程序。我的应用程序使用用C++编写的DLL,因此我需要包含VC++ 2010运行时库。Visual Studio 2010 SP1安装项目不会安装Visual C++ 2010运行时库的SP1
我的一位用户报告说,在运行我的安装程序时出现错误,我将其追溯到事实上该用户已安装SP1版本的VC++ 2010运行时库。我的安装程序尝试安装非SP1版本,然后在看到已安装的新版本(SP1版本)时退出。
我已经证实了这是这里的问题的根源:http://social.microsoft.com/Forums/en/crm/thread/db84d4c3-c58e-4ff9-997f-f4e0116bf043和http://notepad.patheticcockroach.com/1666/installing-visual-c-2010-and-windows-sdk-for-windows-7-offline-installer-and-installation-troubleshooting/
这似乎是对用户的唯一的解决方法是卸载SP1的运行时库,然后用我的安装程序。显然这不是理想的,所以我正在寻找更好的解决方案。
我唯一想到的是告诉我的VS安装项目从微软的SP1链接下载运行时库(http://download.microsoft.com/download/C/6/D/C6D0FD4E-9E53-4897-9B91-836EBA2AACD3/vcredist_x86.exe)。我有点担心,因为这感觉像一个黑客。任何人有更好的想法?
如果它是有帮助的,这里的安装日志从用户谁打这个错误:在Visual Studio安装项目
The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [InstallMode] = HomeSite {string}
Property: [ProcessorArchitecture] = AMD64 {string}
Property: [VersionNT] = 6.1.1 {version}
Running checks for package 'Windows Installer 3.1', phase BuildList
The following properties have been set for package 'Windows Installer 3.1':
Running checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe'
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsi' and value '3.1': true
Result of checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe' is 'Bypass'
'Windows Installer 3.1' RunCheck result: No Install Needed
Running checks for package 'Visual C++ 2010 Runtime Libraries (x86)', phase BuildList
Running MsiProductCheck with ProductCode '{196BB40D-1578-3D01-B289-BEFC77A11A1E}'
MsiQueryProductState returned '-1'
Setting value '-1 {int}' for property 'VCRedistInstalled'
The following properties have been set for package 'Visual C++ 2010 Runtime Libraries (x86)':
Property: [VCRedistInstalled] = -1 {int}
Running checks for command 'vcredist_x86\vcredist_x86.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
Skipping FailIf because Property 'Version9X' was not defined
Result of running operator 'VersionLessThan' on property 'VersionNT' and value '5.00': false
Result of checks for command 'vcredist_x86\vcredist_x86.exe' is 'Install'
'Visual C++ 2010 Runtime Libraries (x86)' RunCheck result: Install Needed
Running checks for package 'Microsoft .NET Framework 4 Client Profile (x86 and x64)', phase BuildList
Reading value 'Version' of registry key 'HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Client'
Read string value '4.0.30319'
Setting value '4.0.30319 {string}' for property 'DotNet40Client_TargetVersion'
The following properties have been set for package 'Microsoft .NET Framework 4 Client Profile (x86 and x64)':
Property: [DotNet40Client_TargetVersion] = 4.0.30319 {string}
Running checks for command 'DotNetFX40Client\dotNetFx40_Client_x86_x64.exe'
Result of running operator 'ValueEqualTo' on property 'InstallMode' and value 'HomeSite': true
Result of checks for command 'DotNetFX40Client\dotNetFx40_Client_x86_x64.exe' is 'Bypass'
Running checks for command 'DotNetFX40Client\dotNetFx40_Client_setup.exe'
Result of running operator 'ValueNotEqualTo' on property 'InstallMode' and value 'HomeSite': false
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'DotNet40Client_TargetVersion' and value '4.0.30129': true
Result of checks for command 'DotNetFX40Client\dotNetFx40_Client_setup.exe' is 'Bypass'
'Microsoft .NET Framework 4 Client Profile (x86 and x64)' RunCheck result: No Install Needed
Installation of components 'Visual C++ 2010 Runtime Libraries (x86)' was accepted.
Copying files to temporary directory "C:\Users\JAGDISH\AppData\Local\Temp\VSD653B.tmp\"
Downloading files to "C:\Users\JAGDISH\AppData\Local\Temp\VSD653B.tmp\"
(14-12-2011 14:03:32) Downloading 'vcredist_x86\vcredist_x86.exe' from 'http://go.microsoft.com/fwlink/?LinkID=177916&clcid=0x409' to 'C:\Users\JAGDISH\AppData\Local\Temp\VSD653B.tmp\'
Download completed at 14-12-2011 14:05:00
Verifying file integrity of C:\Users\JAGDISH\AppData\Local\Temp\VSD653B.tmp\vcredist_x86\vcredist_x86.exe
WinVerifyTrust returned 0
File trusted
Running checks for package 'Visual C++ 2010 Runtime Libraries (x86)', phase BeforePackage
Running MsiProductCheck with ProductCode '{196BB40D-1578-3D01-B289-BEFC77A11A1E}'
MsiQueryProductState returned '-1'
Setting value '-1 {int}' for property 'VCRedistInstalled'
The following properties have been set for package 'Visual C++ 2010 Runtime Libraries (x86)':
Property: [VCRedistInstalled] = -1 {int}
Running checks for command 'vcredist_x86\vcredist_x86.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
Skipping FailIf because Property 'Version9X' was not defined
Result of running operator 'VersionLessThan' on property 'VersionNT' and value '5.00': false
Result of checks for command 'vcredist_x86\vcredist_x86.exe' is 'Install'
'Visual C++ 2010 Runtime Libraries (x86)' RunCheck result: Install Needed
Verifying file integrity of C:\Users\JAGDISH\AppData\Local\Temp\VSD653B.tmp\vcredist_x86\vcredist_x86.exe
WinVerifyTrust returned 0
File trusted
Installing using command 'C:\Users\JAGDISH\AppData\Local\Temp\VSD653B.tmp\vcredist_x86\vcredist_x86.exe' and parameters ' /q:a '
Process exited with code 5100
Status of package 'Visual C++ 2010 Runtime Libraries (x86)' after install is 'InstallFailed'
预定义的先决条件是不是很好。他们很少更新的事实也是一个问题。
所以最好的解决方案是创建自己的自定义先决条件。 Visual Studio安装项目不支持自定义先决条件创建。但是,可以通过手动生成required manifests来完成。
这些清单可以通过Bootstrapper Manifest Generator tool自动生成。
生成软件包清单后,您可以在一个单独的文件夹添加所有这些文件(包括包装)在Visual Studio的先决条件文件夹,例如:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages
这种方式,您可以选择的先决条件您的设置项目属性页面。
您的自定义先决条件可以检测到原始运行时和SP1。你可以在这里找到SP1的检测标准:http://blogs.msdn.com/b/astebner/archive/2010/05/05/10008146.aspx
我可以通过将我的C++ DLL的目标输出添加到安装项目中来解决这个问题。一旦我这样做了,安装项目会自动将适当的C++ dll与我的安装程序捆绑在一起,现在一切正常。
最初的问题是由于我在安装项目的先决条件中手动检查了“C++运行时库”。
@Cosmin Pirvu - 您的解决方案可能有效,但这是我最终做的。
'检测标准'恰恰不起作用。有人的安装程序首先到达该机器,并将msvcr100.dll复制到c:\ windows \ system32。因为那很容易。 – 2011-12-15 09:29:54