Reputation: 10154
I have a C# Windows Forms project in Microsoft Visual Studio 2017. I have added a Visual Studio Installer Setup Wizard Project to create an installer for my application. This is my first time using an installer project.
The installer correctly has a prerequisite for .NET Framework 4.5.1. However, I would like to make the installer include the .NET Framework installation instead of asking the user to download and install it separately at install-time (some of the users' machines don't have internet connections).
I have already set the prerequisites to "Download prerequisites from the same location as my application" in the Setup Property Pages, but when I build the setup I see three errors as follows:
ERROR: To enable 'Download prerequisites from the same location as my application' in the Prerequisites dialog box, you must download file 'DotNetFX461\NDP461-KB3102436-x86-x64-AllOS-ENU.exe' for item 'Microsoft .NET Framework 4.6.1 (x86 and x64)' to your local machine. For more information, see http://go.microsoft.com/fwlink/?LinkId=616018.
The link included doesn't really help as it refers to ClickOnce installs. I have the mentioned NDP461 EXE file, but I don't know where to put it.
I see some other questions mention creating a bootstrapper package using the MS Bootstrapper Package Manager, but this seems to have disappeared from the Internet with Microsoft's closure of code.msdn.microsoft, apparently without any information on a replacement.
Additionally, most documentation and Stack Overflow questions that I can find on the subject relate to older versions of Visual Studio, and do not correlate (at least not directly enough for me to figure out!) to Visual Studio 2017.
How do I go about actually getting the setup project to find the EXE file? Do I simply need to plop it in the right location (already tried a few that were listed on various MSDN pages and under registry keys)? Or do I need to create a bootstrapper package? If the latter, is there up to date documentation on this process somewhere?
PS: Would the process be easier if I chose instead to use the (more recent) .NET Framework that is already installed on my development machine? (I'm guessing there might be install information for that already on the machine somewhere.)
I tried switching to targeting .NET 4.6 instead, downloaded NDP46-KB3045557-x86-x64-AllOS-ENU.exe and placed it in the directory C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\DotNetFX46
. The installer setup project now builds but gives the following warning (again, three of them):
WARNING: The value of the 'PublicKey' attribute in 'Microsoft .NET Framework 4.6 (x86 and x64)' does not match that of file 'C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\DotNetFX46\NDP46-KB3045557-x86-x64-AllOS-ENU.exe'.
I guess this means I'm not supposed to do it this way?
Upvotes: 20
Views: 21733
Reputation: 391
I did find an answer that worked for me on Visual Studio 2017.
Registry key "HKLM\SOFTWARE\Wow6432Node\Microsoft\GenericBootstrapper" contains a "Path" key that shows the path to the bootstrapper files. For me, it was the following:
C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\
I checked that path, and there was indeed a "Packages\DotNetFX461" directory there, but it didn't contain the NDP461...ENU.exe file. I just copied the file there and everything worked.
Upvotes: 1
Reputation: 101
For me (Visual Studio 2017 Enterprise), the correct path is (for 4.7.1) C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\DotNetFX471
Upvotes: 2
Reputation: 371
For Microsoft Visual Studio 2017 the correct folder to add the bootstrapper packages is:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\SDK\Bootstrapper\Packages\
Links for the various redistributable .NET packages can be found here along with info on different deployment options: .NET Framework deployment guide for developers
The error messages give you the correct folders to add to the packages folder. So the file NDP46-KB3045557-x86-x64-AllOS-ENU.exe should be added to a folder "DotNetFX46" under Packages.
I really do not understand why Microsoft has not taken the steps to make this an automated process or at least provide a step by step guide on how to add the bootstrap packages to different versions on Visual Studio. The procedure and folders have changed several times over the years.
The public key mismatch is most likely due to the fact that there have been at least two versions of the NDP46-KB3045557-x86-x64-AllOS-ENU.exe file distributed with the same filename, but different public keys. Check this link: https://connect.microsoft.com/VisualStudio/feedback/details/1584164/bootstrapper-packages-have-broken-links-and-wrong-public-keys
Upvotes: 2
Reputation: 842
Just download the NDP461-KB3102436-x86-x64-AllOS-ENU.exe file from this link.
And copy it to C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\DotNetFX461
Upvotes: 21