2

I want to install .NEt Framework using bootstrapper/Clickonce application. The code I have used is as shown below -

But it fails with this error -

warning MSB3155: Item 'Microsoft.Net.Framework.4.7.1' could not be located in 'D:\a\1\s\src\ABC\Main'.

Error MSB3147: Could not find required file 'setup.bin' in 'D:\a\1\s\src\ABC\Main\Engine'.

What I want to do is to install .net framework from vendor site and hence the installers are not bundled. Can someone help here ?

<Target Name="BuildBootstrapper">
<ItemGroup>
 <BootstrapperFile Include="Microsoft.Net.Framework.4.7.1">
 <ProductName>.NET Framework 4.7.1</ProductName>
 </BootstrapperFile>
 </ItemGroup>
<GenerateBootstrapper
  ApplicationFile="ABC.application"
  ApplicationName="ABC"
  BootstrapperItems="@(BootstrapperFile)"
  ComponentsLocation="HomeSite"
/>
</Target>

I am using VS2017

Community
  • 1
  • 1
Pargarg
  • 33
  • 5
  • Does the installer [build](https://stackoverflow.com/questions/11139538/could-not-find-required-file-setup-bin) and can you [publish it locally](https://stackoverflow.com/questions/42499092/error-msb3147-could-not-find-required-file-setup-bin-publish-to-local-failure)? – stuartd Jan 04 '19 at 10:17
  • 1
    You cannot install the .NETFramework with a ClickOnce app, CO deployments are not allowed to make machine setup changes that require admin rights. It is the bigger bang behind CO, users can trust that your package does not mess up their machine. You can only test if 4.7.1 is available and direct the user to the installer web page if it is not. That bootstrapper is stored in C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\DotNetFX471 – Hans Passant Jan 04 '19 at 13:07

1 Answers1

0

This worked fine for me where it creates setup.exe at the outputpath and redirects user if they dont have framework installed .

<Target Name="BuildBootstrapper">
<PropertyGroup>
   <MyPathToPrerequisitePackages>C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper</MyPathToPrerequisitePackages>
   <MyDesiredOutputPath>C:\Bootstrapper</MyDesiredOutputPath>
</PropertyGroup>

 <ItemGroup>
  <BootstrapperFile Include=".NETFramework,Version=v4.7.1">
    <ProductName>Microsoft .NET Framework 4.7.1</ProductName>
  </BootstrapperFile>
 </ItemGroup>

 <GenerateBootstrapper
    ApplicationFile="ABC.application"
    ApplicationName="ABC"
    ApplicationUrl=""
    BootstrapperItems="@(BootstrapperFile)"
    ComponentsLocation="HomeSite"
    Path="$(MyPathToPrerequisitePackages)"
    OutputPath="" 
 />

Pargarg
  • 33
  • 5