Bootstrap Manifest Generator(BMG) 生成的product.xml 试分析

BMG是一个应用于ClickOnce发布中自制系统必备包的图形化工具。ClickOnce的系统必备包放在C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\(VS2008)。通过BMG我们可以自行定义包括第三方组件在内的安装方案。以下是通过比对VS2008自带Packages,对product.xml的试分析。


定制的product.xml内容如下:


 <?xml  version="1.0" encoding="utf-8" ?>

<Productxmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"ProductCode="Microsoft.Net.Framework.2.0(显示在ClickOnce系统必备中的名称">


<RelatedProducts>( 关联安装包
 <IncludesProductCode( 包含方式,另外还有一种Depend依赖方式)=" Microsoft.Windows.Installer.2.0"/>
 </RelatedProducts>
-<!--Defines list of files to be copied on build  -->
<PackageFilesCopyAllPackageFiles=" false">( 为True的话是每次安装都下载全部系统必备安装包
 <PackageFileName=" instmsia.exe"HomeSite=" InstMsiAExe"PublicKey=" "/>
 <PackageFileName=" WindowsInstaller-KB893803-v2-x86.exe"HomeSite=" "/>
 <PackageFileName=" dotnetfx.exe"HomeSite=" DotNetFXExe"PublicKey=" "/>

 <PackageFileName="dotnetchk.exe"/> (这个小工具是检查客户机是否安装dotnetframwork

必备安装包内共四个文件

 </PackageFiles>
<InstallChecks>( 安装前进行检查
 <ExternalCheck Property=" DotNetInstalled"PackageFile=" dotnetchk.exe"/>( 外部程序检查,若本机安装dotnet,则退出代码为 " DotNetInstalled "

 <RegistryCheck Property="IEVersion"Key="HKLM\Software\Microsoft\Internet Explorer"Value="Version"/>(注册表检查

另外还有 AssemblyCheck(检查GAC中是否有指定的程序集)、FileCheck(检查指定文件是否存在)、MsiProductCheck(检查指定的 Microsoft Windows Installer 安装是否已运行完毕)

 </InstallChecks>

以上为全局检查,也可以每个包内组件各自检查。

-<!--Defines how to invoke the setup for the .NET Framework redist  -->
<CommandsReboot=" Immediate">( 若指定Reboot,则立即重启
<CommandPackageFile=" instmsia.exe"Arguments=" /q /c:"msiinst /delayrebootq"(可带参数运行安装组件"EstimatedInstallSeconds=" 20">
<InstallConditions>( 安装条件
 <BypassIfProperty=" VersionNT"Compare=" ValueExists"/> ( 这句的意思是检查NT版本,若存在则通过
 <BypassIfProperty=" VersionMsi"Compare=" VersionGreaterThanOrEqualTo"Value=" 2.0"/>( 若MSI安装器的版本大于等于2.0则通过
 </InstallConditions>
<ExitCodes>
 <ExitCodeValue=" 0"Result=" SuccessReboot"/> ( 退出代码为0,则返回提示成功并重启
 <ExitCodeValue=" 1641"Result=" SuccessReboot"/>
 <ExitCodeValue=" 3010"Result=" SuccessReboot"/>
 <DefaultExitCodeResult=" Fail"FormatMessageFromSystem=" true"String=" GeneralFailure"/>
 </ExitCodes>

 </Command>

以上为一个安装组件的配置——每个Command标签一个安装组件,下同。

<CommandPackageFile=" WindowsInstaller-KB893803-v2-x86.exe"Arguments=" /quiet  /norestart"EstimatedInstallSeconds=" 21">
<InstallConditions>
 <BypassIfProperty=" Version9x"Compare=" ValueExists"/>
 <BypassIfProperty=" VersionNT"Compare=" VersionLessThan"Value=" 5.0.3"/>
 <BypassIfProperty=" VersionMsi"Compare=" VersionGreaterThanOrEqualTo"Value=" 3.0"/>
 <FailIfProperty=" AdminUser"Compare=" ValueEqualTo"Value=" false"String=" AdminRequired"/>
 </InstallConditions>
<ExitCodes>
 <ExitCodeValue=" 0"Result=" Success"/>
 <ExitCodeValue=" 1641"Result=" SuccessReboot"/>
 <ExitCodeValue=" 3010"Result=" SuccessReboot"/>
 <DefaultExitCodeResult=" Fail"FormatMessageFromSystem=" true"String=" GeneralFailure"/>
 </ExitCodes>
 </Command>
<CommandPackageFile=" dotnetfx.exe"Arguments=" /q:a /c:"install /q /l""EstimatedInstalledBytes=" 180000000"EstimatedTempBytes=" 110000000"EstimatedInstallSeconds=" 420">
-<!--These checks determine whether the package is to be installed  -->
<InstallConditions>
-<!--Either of these properties indicates the .Net Framework is already installed  -->
 <BypassIfProperty=" DotNetInstalled"Compare=" ValueNotEqualTo"Value=" 0"/>
-<!--Block install if user does not have admin privileges  -->
 <FailIfProperty=" AdminUser"Compare=" ValueEqualTo"Value=" false"String=" AdminRequired"/>
-<!--Block install on Windows 95  -->
 <FailIfProperty=" Version9x"Compare=" VersionLessThan"Value=" 4.10"String=" InvalidPlatformWin9x"/>
-<!--Block install on Windows 2000 SP 2 or less  -->
 <FailIfProperty=" VersionNT"Compare=" VersionLessThan"Value=" 5.0.3"String=" InvalidPlatformWinNT"/>
-<!--Block install if IE 5.01 or greater is not present  -->
 <FailIfProperty=" IEVersion"Compare=" ValueNotExists"String=" InvalidPlatformIE"/>
 <FailIfProperty=" IEVersion"Compare=" VersionLessThan"Value=" 5.0.2900"String=" InvalidPlatformIE"/>
-<!--Block install if the platform is not x86  -->
 <FailIfProperty=" ProcessorArchitecture"Compare=" ValueNotEqualTo"Value=" Intel"String=" InvalidPlatformArchitecture"/>
 </InstallConditions>
<ExitCodes>
 <ExitCodeValue=" 0"Result=" Success"/>
 <ExitCodeValue=" 3010"Result=" SuccessReboot"/>
 <ExitCodeValue=" 4097"Result=" Fail"String=" AdminRequired"/>
 <ExitCodeValue=" 4099"Result=" Fail"String=" WindowsInstallerImproperInstall"/>
 <ExitCodeValue=" 4101"Result=" Fail"String=" AnotherInstanceRunning"/>
 <ExitCodeValue=" 4113"Result=" Fail"String=" BetaNDPFailure"/>
 <DefaultExitCodeResult=" Fail"FormatMessageFromSystem=" true"String=" GeneralFailure"/>
 </ExitCodes>
 </Command>
 </Commands>

 </Product>


BMG下载地址

BMG截图

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在Spring Cloud Config中,有几种常见的配置文件,包括`bootstrap.yml`、`bootstrap-dev.yml`和`bootstrap-local.yml`。这些配置文件具有不同的优先级和用途。 1. `bootstrap.yml`是用于获取外部配置的特殊配置文件,它的加载优先级比其他配置文件(如`application.yml`或`application.properties`)更高[^1]。它主要用于加载一些启动阶段需要用到的配置信息,例如连接到Spring Cloud Config Server的配置、加密/解密信息、连接到外部数据库的配置等。由于这些配置信息在应用程序启动的早期阶段就需要用到,所以放在`bootstrap.yml`中确保它们在其他配置之前加载。此外,`bootstrap.yml`不会被本地配置文件覆盖,它的优先级更高,确保这些关键配置的安全性和准确性。 2. `bootstrap-dev.yml`是`bootstrap.yml`的一个特定的开发环境profile,用于在开发环境下加载特定的外部配置信息。在开发环境中,可能需要与生产环境不同的配置,例如连接到不同的数据库、使用不同的服务地址等。通过使用`bootstrap-dev.yml`可以轻松地区分开发环境和其他环境的配置。当在开发环境启动应用程序时,Spring Cloud Config将会加载`bootstrap.yml`和`bootstrap-dev.yml`的配置,并根据当前激活的profile(如通过`spring.profiles.active`属性指定)加载对应的配置。 3. `bootstrap-local.yml`是一个自定义的本地配置文件,用于加载本地环境下的特定配置信息。它的优先级比`bootstrap.yml`和`bootstrap-dev.yml`更高,可以用于覆盖这两个文件中的配置。通过使用`bootstrap-local.yml`,可以在本地环境中加载特定的配置,例如本地数据库的连接信息、本地服务的地址等。 综上所述,`bootstrap.yml`具有最低的优先级,用于加载一些启动阶段需要用到的配置信息。`bootstrap-dev.yml`是用于开发环境的特定配置文件,用于加载开发环境下的配置。`bootstrap-local.yml`是一个自定义的本地配置文件,用于加载本地环境下的特定配置信息。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值