Dependencies 元素参考

Dependencies 元素用于指定哪些插件包必须可用,才能加载另一个插件包。

有时,一个插件捆绑包可能依赖于另一个插件捆绑包的文件才能正常运行。通过使用 Dependencies 元素,可以指示 AutoCAD 和 AutoCAD LT 仅在已安装并加载某个具有特定升级代码或版本的捆绑包时才加载插件捆绑包。

Dependencies 元素是可选的,可以包含一个或多个 Dependency 元素。Dependency 元素用于标识在可以加载您的插件捆绑包之前必须先安装并加载的插件捆绑包。

Dependency 元素

属性

说明

UpgradeCode

必须与相关插件捆绑包的 ApplicationPackage 元素中的 UpgradeCode 属性相同。

Optional

可选;确定是否需要插件捆绑包,如果发现缺少,则忽略。

有效值:

  • True - 需要捆绑包
  • False - 不需要捆绑包

VersionMin

可选;定义此插件捆绑包所依赖插件捆绑包的最低版本。

该值会与相关插件捆绑包的e ApplicationPackage 元素中的 AppVersion 属性进行比较。

VersionMax

可选;定义此插件捆绑包所依赖插件捆绑包的最大版本。

该值会与相关插件捆绑包的e ApplicationPackage 元素中的 AppVersion 属性进行比较。

Dependency 元素可以包含或封装 Component 元素。通过添加 Component 元素,可以定义对插件捆绑包内特定组件条目的依赖。Component 元素的 Name 属性必须与此插件捆绑包所依赖的 ComponentEntryAppName 属性相匹配。

以下示例使用与“GUID-Value”匹配的 UpgradeCode 定义了插件捆绑包不同组件上的多个依存关系:

<Dependencies>
  <Dependency UpgradeCode="GUID-Value" Optional="True" VersionMin="1.0"/>
  <Dependency UpgradeCode="GUID-Value" Optional="False" VersionMin="2.0" VersionMax="5.0">
      <Component AppName="App1" />
      <Component AppName="App2" />
  </Dependency>
</Dependencies>