简体   繁体   English

引导程序(setup.exe)提示“未找到.NET 3.5”,但启动.msi可直接安装应用程序而不会出现问题

[英]Bootstrapper (setup.exe) says “.NET 3.5 not found” but launching .msi directly installs application without problem

Our installer generates a bootstrapper (setup.exe) and a MSI file - a pretty common scenario. 我们的安装程序会生成引导程序(setup.exe)和MSI文件-一种非常常见的情况。

One of the production machines reports a strange problem during install: 其中一台生产机器在安装过程中报告了一个奇怪的问题:

  • If the user launches the bootstrapper (setup.exe), it reports that .NET 3.5 is not installed . 如果用户启动引导程序(setup.exe),则会报告未安装.NET 3.5 This happens with account under administator group. 这在管理员组下的帐户中发生。 No matter if they launch it as administrator or not, same behavior. 不管他们是否以管理员身份启动它,都具有相同的行为。

  • the application installs fine when application.msi or OurInstallLauncher.exe (see below for explanation) is started directly no matter if run as administrator is applied. 直接启动application.msiOurInstallLauncher.exe (请参见以下说明),无论是否以管理员身份运行,应用程序都可以很好地安装。

  • We have checked that .NET is installed on the machine (both 64bit and 32bit "versions" = under both C:\\Windows\\Microsoft.NET\\Framework64 and C:\\Windows\\Microsoft.NET\\Framework there is a folder named v3.5 . 我们已经检查了计算机上是否安装了.NET(64位和32位“版本” =在C:\\Windows\\Microsoft.NET\\Framework64C:\\Windows\\Microsoft.NET\\Framework存在一个名为v3.5的文件夹) v3.5

This happens on a 64 bit Windows 7. I can not reproduce it on my development 64 bit Windows 7. On Windows XP and Vista, it has worked without any problem for a long time so far. 在64位Windows 7上会发生这种情况。我无法在开发的64位Windows 7上重现它。在Windows XP和Vista上,到目前为止,它一直没有任何问题。

Part of our build script that declares the GenerateBootStrapper task (nothing special): 我们的构建脚本的一部分,用于声明GenerateBootStrapper任务(没什么特别的):

<ItemGroup>
  <BootstrapperFile Include="Microsoft.Windows.Installer.3.1">
    <ProductName>Microsoft Windows Installer 3.1</ProductName>
  </BootstrapperFile>
  <BootstrapperFile Include="Microsoft.Net.Framework.3.5">
    <ProductName>Microsoft .NET Framework 3.5</ProductName>
  </BootstrapperFile>
</ItemGroup>

  <GenerateBootstrapper
    ApplicationFile=".\Files\OurInstallLauncher.exe"        
    ApplicationName="App name"
    Culture="en"
    ComponentsLocation ="HomeSite"
    CopyComponents="True"
    Validate="True"
    BootstrapperItems="@(BootstrapperFile)"
    OutputPath="$(OutSubDir)"
    Path="$(SdkBootstrapperPath)" />

Note: OurInstallLauncher.exe is language selector that applies a transform to the msi based on user selection. 注意: OurInstallLauncher.exe是一种语言选择器,可根据用户选择对msi应用转换。 This is not relevant to the question at all because the installer never gets as far as launching this exe! 这根本与问题无关,因为安装程序永远不会启动该exe!

EDIT: It displays that .NET 3.5 is missing right after starting setup.exe and proposes to install .NET 3.5. 编辑:它显示在启动setup.exe之后立即缺少.NET 3.5,并建议安装.NET 3.5。 When the user agrees with the install, the .NET 3.5 installer says that .NET 3.5 is already installed and the MSI installer proceeds. 当用户同意安装时,.NET 3.5安装程序会说已安装.NET 3.5,并且MSI安装程序会继续。 If they choose to not install .NET 3.5, the installation ends. 如果他们选择不安装.NET 3.5,则安装结束。

Has anyone seen this behavior before? 有人见过这种行为吗?

This seems to be a bug either in Bootstrapper or in Windows 7. 这似乎是Bootstrapper或Windows 7中的错误。

Solution: 解:

C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\Bootstrapper\\Packages\\DotNetFX35\\en\\package.xml has to be tweaked on the build machine, because default German Windows 7 installations do not have this key present: C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\Bootstrapper\\Packages\\DotNetFX35\\en\\package.xml必须在构建计算机上进行调整,因为默认的德语Windows 7安装没有此密钥:

  <RegistryCheck Property="DotNet35InstallSuccess" 
Key="HKLM\Software\Microsoft\NET Framework Setup\NDP\v3.5\1033" Value="Install" />

As a result, the installer reported that .NET 3.5 is not installed on the target machine (German Windows 7). 结果,安装程序报告目标计算机(德语Windows 7)上未安装.NET 3.5。

In order for the setup to detect installed .NET correctly, the C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\Bootstrapper\\Packages\\DotNetFX35\\en\\package.xml file must be tweaked as following: 为了使安装程序能够正确检测已安装的.NET,必须对C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\Bootstrapper\\Packages\\DotNetFX35\\en\\package.xml文件进行如下调整:

\\1033 must be removed from the registry check key: \\ 1033必须从注册表检查项中删除:

  <RegistryCheck Property="DotNet35InstallSuccess" 
Key="HKLM\Software\Microsoft\NET Framework Setup\NDP\v3.5" Value="Install" />

The fact that the MSI installs without problems is not surprising, considering that it is only the bootstrapper which concerns itself with installing .NET 3.5. 考虑到只是引导程序本身与安装.NET 3.5有关,MSI可以毫无问题地安装,这一事实不足为奇。 MSI packages don't need .NET in order to be installed (unless you use custom actions implemented in .NET assemblies, or register .NET assemblies in the GAC). MSI软件包不需要.NET即可安装(除非您使用在.NET程序集中实现的自定义操作,或在GAC中注册.NET程序集)。

Uninstall and reinstall .NET on the machine that has the issue. 在出现问题的计算机上卸载并重新安装.NET。 It is most likely just a .NET install that has been corrupted somehow. 它很可能只是因为某种原因已损坏的.NET安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM