博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Vs2010 Setup Project 自定义系统必备包

Posted on 2013-05-03 17:20  脚印  阅读(867)  评论(0编辑  收藏  举报

以前有一个项目用到OpenWebkit.net,在发布这个应用程序的时候系统需要安装Apple Application Support。

以前都是把Apple Application Support和setup.exe一起给客户,虽然不影响使用,但是心里总觉得不专业,5.1期间研究了一下 Vs2010  Setup Project

Apple Application Support这个组件并非微软的必备,在系统必备中是找不到的因此需要自己将这个组件加入到系统必备中,

在MSDN中找到了几篇文章

http://msdn.microsoft.com/zh-cn/library/ms165429(v=vs.100).aspx

文章中提到可以使用工具创建一个系统必备组件选项

http://archive.msdn.microsoft.com/bmg/Release/ProjectReleases.aspx?ReleaseId=1567

但是这是一个for vs2008的。

再找for 2010的结果没有,后来找到这样一篇文章

You can include additional installer with your setup installer in VS2010 with the help BMG_2008. Just Build the Manifest using BMG_2008.

the Build results dialog box as you need to locate the generated files and manifest file, normally the location of this is here “C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\Your Installer” As this version of Bootstrapper Manifest Generator is version 2008 so it does generate in v6.0 folder. In order that this Prerequisites will appear in Visual Studio 2010 IDE you need to do some tricks. Just copy the whole folder to this path “C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages“, the v7.0A folder is the location for all the Prerequisites Packages for Visual Studio 2010 Projects.

After copying you can now view this Prerequisites package on Prerequisite Dialog box of VS2010.

大意:将工具生成好的包复制到C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages即可

我按照做了,结果发现怎么我添加 Apple Application Support组件怎么也不出现在系统必备中,

后来没办法,将C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages中的其他文件夹复制一下,发现系统必备中会出现了2次复制的组件,

因此我就只有将一个SQLCE 3.5 sp2的必备包改装成我所需要的Apple Application Support包,总算是黄天不负有心人,系统必备中可以看到我的Apple Application Support。

继续修改加入安装条件

 

注册一个变量

<InstallChecks>
<RegistryCheck Property="AppleApplication" Key="HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\057978BEDBCC3104FB5D20494DADB50D" Value="ProductName" />
</InstallChecks>

 

安装时判断此变量的值

<InstallConditions>
<BypassIf Property="AppleApplication" Compare="ValueEqualTo" Value="Apple Application Support" />
</InstallConditions>

终于把Apple Application Support 加入到安装包中。