cnblogs/dcrenl/vs.net打包(自动检测环境并安装.net framwork)(1).html
2024-09-24 12:43:01 +08:00

33 lines
2.6 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div id="sina_keyword_ad_area2" class="articalContent ">
<div>vs.net打包程序或者制作安装程序时自动检测环境并安装.netframwork的设置方法之前我看过文档也做过但是过一段时间又忘了现在终于又找到方法了还是把这个方法写下来吧方便自己也方便大家将来查询用。</div>
<div>&nbsp;&nbsp; &nbsp;&nbsp; vs.net打包或者制作安装程序时进行自动检测环境并安装.netframwork的设置方法</div>
<div><br />
</div>
<div>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp;1. 新建一个&ldquo;安装和部署&rdquo;的项目;</div>
<div><br />
</div>
<div>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp;2.然后点击&ldquo;视图&rdquo;菜单,选择&ldquo;编辑器&rdquo;--&ldquo;文件系统&rdquo;,然后将要打包的程序以及相关文件添加进来,之后程序将自动检测依赖项;</div>
<div><br />
</div>
<div>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp;3.再次选择&ldquo;视图&rdquo;菜单,选择&ldquo;编辑器&rdquo;--&ldquo;启动条件&rdquo;,打开这个界面后会自动启动条件里一般都会自动添加&ldquo;.NETFramework&rdquo;项;</div>
<div><br />
</div>
<div>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp;4. 右键点击应用程序名选择&ldquo;属性&rdquo;,在弹出的属性页对话框中,点击&ldquo;系统必备&rdquo;按钮;</div>
<div><br />
</div>
<div>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp;5. 在&ldquo;请选择要安装的系统必备组件&rdquo;里把&ldquo;.NET Framework2.0&rdquo;复选框勾上;</div>
<div><br />
</div>
<div>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp;6.在&ldquo;指定系统必备的安装位置&rdquo;里选中&ldquo;从与我应用程序相同的位置下载系统必备组件&rdquo;,这样就可以保证你下载的.netframwork版本跟自己所做的程序需要的.net framwork版本相同</div>
<div><br />
</div>
<div>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp;7.确定后再次编译在debug文件夹下会自动下载并生成&ldquo;dotnetfx&rdquo;文件夹,里面有应用程序需要的.netframwork安装程序</div>
<div><br />
</div>
<div>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp;8. 选中第3步的启动条件选项卡展开&ldquo;启动条件&rdquo;文件夹,点击&ldquo;.NETFramework&rdquo;,切换到属性管理器中,将其属性&ldquo;InstallUrl&rdquo;的值设置为&ldquo;dotnetfx\dotnetfx.exe&rdquo;路径即可;</div>
<div><br />
</div>
<div>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp;9. 再次编译安装程序就完整的制作出来啦。</div>
</div>
<p>&nbsp;</p>