我在How to: Include Prerequisites with a ClickOnce Application中说过(注意包文件夹是在v8.1A文件夹而不是v8A文件夹中),但它仍然说它找不到文件.我已经尝试了VisualStudio2013和VisualStudio2015 RC.
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 07005.
To enable ‘Download prerequisites from the same location as my application’ in the Prerequisites dialog Box,you must download file ‘sqlExpress2012\sqlEXPR32_x86_ENU.EXE’ for item ‘sql Server 2012 Express’ to your local machine. For more information,you must download file ‘sqlExpress2012\sqlEXPR_x64_ENU.EXE’ for item ‘sql Server 2012 Express’ to your local machine. For more information,you must download file ‘DotNetFX40ClientKB2468871\dotNetFx40_Client_x86_x64.exe’ for item ‘Microsoft .NET Framework 4 Client Profile (x86 and x64) and Update for .NET Framework 4 (KB2468871)’ to your local machine. For more information,see 07005.
解决方法
Impact to the user’s computer. With Windows Installer deployment,applications often rely on shared components,with the potential for versioning conflicts; with ClickOnce deployment,each application is self-contained and cannot interfere with other applications.
Security permissions. Windows Installer deployment requires administrative permissions and allows only limited user installation; ClickOnce deployment enables non-administrative users to install and grants only those Code Access Security permissions necessary for the application.Does not affect shared components or other applications: Yes
Installation of shared files: No
Installation to Global Assembly Cache: No
Installation for multiple users: No
Install time registry access: Limited
这些故意限制旨在让用户对使用ClickOnce安装.NET程序感觉良好.他们不需要管理员的帮助来安装程序.并且安装程序无法对机器进行大幅更改,导致其他程序出现故障.安装人员非常非常常见的问题.
这与你要做的事情完全不相容. .NET Framework和sql Express都是共享组件,并且需要管理员访问才能安装,并且可能会破坏已安装.NET或sql Server的计算机的稳定性.
所以这根本行不通.您可以选择它们作为先决条件,但安装时发生的所有事情都是ClickOnce安装程序验证它们是否符合要求.换句话说,该机器必须已安装正确版本的.NET和sql Express.如果没有,那么部署将失败,用户将获得告诉他下载安装程序位置的对话框.然后完全取决于他(或他的管理员)下载并运行安装程序.之后,您的ClickOnce安装完成没有问题.
部署向导非常糟糕,它应该隐藏底部的单选按钮.只有“来自组件供应商的网站”才是这些先决条件的有效选择.引导程序.xml文件格式不够复杂,无法限制选择.