How to “enable 'Download prerequisites from the same location as my application'”

走远了吗. 提交于 2020-06-24 11:28:44

问题


tl;dr Visual Studio 2013 Creating a plain installer, project template: Other Project Types > Visual Studio Installer > Setup Project

There's gotta be something simple I'm missing. I've got the installers (i.e NDP451-KB2858728-x86-x64-AllOS-ENU.exe) for my prerequisites downloaded, how hard can it be to tell Visual Studio where to find them (or to put them where it naturally will look)?

=================================================

Got everything working, except for incorporating prerequisites.

I have google this, found some other stack exchange articles, but nothing quite answers the question.

I have created a plain "Setup Project" with some prerequisites, which I want bundled with the installer (no downloading by the end user at install time). I get this error:

Error 1 To enable 'Download prerequisites from the same location as my application' in the Prerequisites dialog box, you must download file 'DotNetFX45\dotNetFx45_Full_x86_x64.exe' for item 'Microsoft .NET Framework 4.5 (x86 and x64)' to your local machine. For more information, see http://go.microsoft.com/fwlink/?LinkId=239883. d:\junk\installerWalkthrough\Setup1\Setup1.vdproj Setup1

This is pretty clear.

EXCEPT: after I download it, where do I put it so Visual Studio knows where to find it to include it in the build of the setup project?

I've looked for some option/properties to specify a path to the setup files for prerequisites, no luck. If I go to the url mentioned in the error message, it goes on about "clickonce" and other types of install. Nothing about plain "Setup Project" type of install. And the instructions about where to put the downloaded file are as clear as mud, seem to be specific for win version 8.1A, but if you go down into "C:\Program Files (x86)\Microsoft SDKs\Windows\" there are many different win version listed as subfolders, some with a bootstrapper folder, others not, etc.

I tried putting NDP451-KB2858728-x86-x64-AllOS-ENU.exe in C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\Bootstrapper\Packages\DotNetFX451\en which seems to be where (url from error message) is telling me to put it, but VS does not find it on build.

There's gotta be something simple I'm missing. I've got the installers for my prerequisites downloaded, how hard can it be to tell Visual Studio where to get them?


回答1:


Visual Studio 2017 path has changed again - go with

C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\vcredist_x64




回答2:


There is 2 solution: 1. Download the file which visual studio given error. in your case it is

http://www.microsoft.com/en-us/download/details.aspx?id=40779

and past the file in to this path

also set the prerequist

Step 2:

https://msdn.microsoft.com/en-us/library/hh873130%28v=vs.110%29.aspx




回答3:


That works for VS 2017-2019 and .Net 4.7.2:

Put the file into **c:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\DotNetFX472**




回答4:


Put it in this folder:

C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages\DotNetFX45



回答5:


In my case, I need to install a VSTO in Windows 10.

First I download the redistributable package from Microsoft to:

C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\DotNetFX461

Then I copy all folder included to C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\Bootstrapper\Packages\DotNetFX461.

The redistributable package for VSTO I have downloaded to C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\VSTOR40. Then I have published from VS2017 and it works.




回答6:


Paste it in here. It worked for me.

C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\Bootstrapper\Packages\DotNetFX45




回答7:


You can download the corresponding version from the here and put it in the correct folder for example...

I got this error To enable 'Download prerequisites from the same location as my application' in the Prerequisites dialog box, you must download file 'DotNetFX452\NDP452-KB2901907-x86-x64-AllOS-ENU.exe' for item 'Microsoft .NET Framework 4.5.2 (x86 and x64)' to your local machine. For more information, see http://go.microsoft.com/fwlink/?LinkId=616018

Then I downloaded .NET Framework 4.5.2 for all operating systems offline installer from https://docs.microsoft.com/en-us/dotnet/framework/deployment/deployment-guide-for-developers and copied into C:\Program Files (x86)\Microsoft Visual Studio 14.0\SDK\Bootstrapper\Packages\DotNetFX452. then every thing works fine




回答8:


Add it to "C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\DotNetFX45" Apparently, you have to find the folder which matches your .Net Framework in ClickOnce Bootstrapper folder. In my case, it is DotNetFX452 as I used the .Net Framework 4.5.2. In your case, it should be DotNetFX45.




回答9:


Those answers are wrong. What you want to do is to include all the files necessary for your application to work within your setup package. They're telling you to go to your own computer and install those by hand. Read this from Microsoft instead:

https://msdn.microsoft.com/en-us/library/hh873130.aspx




回答10:


I tried all the above answers without success using VS 2019 and Windows 7. What eventually worked for me was to put each of the prerequisite files in their specific folder in C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\*.

For eg: The DotNetFX472 package needed to be in:C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\DotNetFX472\NDP472-KB4054530-x86-x64-AllOS-ENU.exe

Sql LocalDB 2012 files needed some tinkering, it required both the x64 and x86 files, this is what worked for me:

  • x64: C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\SqlLocalDB2012\x64\SqlCmdLnUtils.msi,C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\SqlLocalDB2012\x64\SqlLocalDB.msi, and C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\SqlLocalDB2012\x64\sqlncli.msi.
  • And similarly for x86: C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\SqlLocalDB2012\x86\SqlCmdLnUtils.msi,C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\SqlLocalDB2012\x86\SqlLocalDB.msi, and C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\SqlLocalDB2012\x86\sqlncli.msi.

I hope this saves you some time.



来源:https://stackoverflow.com/questions/28709432/how-to-enable-download-prerequisites-from-the-same-location-as-my-application

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