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

扶醉桌前 提交于 2019-12-11 05:31:27

问题


Our installer generates a bootstrapper (setup.exe) and a MSI file - a pretty common scenario.

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. 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.

  • 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.

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.

Part of our build script that declares the GenerateBootStrapper task (nothing special):

<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. This is not relevant to the question at all because the installer never gets as far as launching this exe!

EDIT: It displays that .NET 3.5 is missing right after starting setup.exe and proposes to install .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. If they choose to not install .NET 3.5, the installation ends.

Has anyone seen this behavior before?


回答1:


This seems to be a bug either in Bootstrapper or in 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:

  <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).

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:

\1033 must be removed from the registry check key:

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



回答2:


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. 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).

Uninstall and reinstall .NET on the machine that has the issue. It is most likely just a .NET install that has been corrupted somehow.



来源:https://stackoverflow.com/questions/2591384/bootstrapper-setup-exe-says-net-3-5-not-found-but-launching-msi-directly-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!