---
title: "使用批处理或C#代码 注册ArcEngine Runtime授权，自动检测AE Runtime安装位置"
author: "NickWar"
date: "2010-02-04T16:49:00Z"
tags: []
slug: "c-arcengine-runtime-ae-runtime"
draft: false
lastmod: "2012-04-20T20:55:42Z"
id: 1492372
url: "https://nickwar.iteye.com/blog/1492372"
---

ArcEngine Runtime 9.3版本，注册程序为其安装目录下的bin/SoftwareAuthorization.exe

安装位置在注册表中有记录：具体项为:

HKLM/SOFTWARE/ESRI/ArcGIS Engine Runtime

下的InstallDir值

授权文件名称为ecp后缀的，此处命名为lic.ecp

安装授权文件的参数为SoftwareAuthorization.exe -lif "lic.ecp" -s

其中-lif为指定授权文件，-S为不弹出界面

使用批处理文件处理过程：

1 检索注册表获取安装目录，拼装为完整路径，

2 使用参数注册授权文件

批处理方式下具体代码如下：

C#方式：