Even though I'm logged in as a user with admin privs, Windows 7 still won't let me register with EsriRegAsm.exe. I need to explicitly run as Administrator.

Is there some way to configure a machine so that I can use EsriRegAsm without running as administrator?

Starting with ArcGIS 10, it has been decided to move away from the COM component category approach. The replacement consists of a new registration utility (ESRIRegAsm.exe) and an Extensible Markup Language (XML) database stored in published per product and version configuration folders, independent of the system registry; therefore, the registration of component and category information for a developer’s assembly or dynamic-link library (DLL) is achieved using the new ESRI provided utility called ESRIRegAsm. ESRIRegAsm performs registration on both native COM DLLs and managed COM assemblies, and as previously discussed, does not write the component category portion of the registration information into the system registry.

Update: So does it write anything to the system registry?

If not, why should admin privs be required for installation?

  • 1
    By "user with admin privs", do you mean a user who is a member of the Administrators group or a user who's assigned the Administrator privilege via the control panel? They're different now. Being in the Administrators group only gives you some administrative power. – mwalker Apr 4 '11 at 22:33
  • @nmwalker thanks for replying. My user account is a member of the Admistrators group, yet I still get an error running EsriRegAsm. Another annoyance: right clicking on most registration bat files and chosing run as administrator doesn't work. Apparently this sets the current directory to c:\Windows\System32, when it really needs to be the directory where the bat file is. – Kirk Kuykendall Apr 5 '11 at 2:01
  • 1
    Does it work if you right-click on cmd.exe and "run as administrator" and run the bat file in the elevated command promt? It works for me in VS when running VS as administrator, so it should be an issue with elevated administrator privilege. – MathiasWestin Apr 5 '11 at 15:14
  • @mathias Yes, but then I need to cd into the folder (which has a really long name) from the command prompt and then run the bat. I'm wanting to send a zip file containing the dll and bat files to someone so they can install. I want to keep it as simple as possible for them. EsriRegAsm doesn't write anything to the registry, does it? Seems like I should be able to config a machine to allow non-admins to run EsriRegAsm. – Kirk Kuykendall Apr 5 '11 at 15:34
  • Running an executable when logged on as a user which is member of the admin group is not the same as running it with administrator privileges. EsriRegAsm writes to a system folder and as such, it needs your confirmation - you need to tell the system: ok, I know what this program is doing, it is safe. This confirmation is obviously just as important when you are local admin as it important when you are not. It's pretty much the same when you run an installer. – Petr Krebs Apr 5 '11 at 22:46

The classes are still registered in the registry. It is just the component category information that is not added to the registry. The component category info is still written to a place requiring admin privileges. So, both the registration and the ecfg file writing require admin access.

  • Thanks Craig. If I just copy the ecfg instead of running EsriRegasm, will the classes somehow get registered in the registry? – Kirk Kuykendall Apr 7 '11 at 13:29
  • Kirk: no, they will not. ArcGIS will know which class goes into which component category but will not be able to instantiate any of those COM classes since they will not have been registered. To register classic ArcGIS COM components you can 1) use EsriRegAsm alone, 2) use EsriRegAsm to generate the ecfg file, copy it to ArcGIS' CATID folder AND use RegAsm to register COM classes. In any case, elevates privileges are a necessity. On Vista/7, there is (thankfully) no way to circumvent it. – Petr Krebs Apr 7 '11 at 18:38
  • @Petr - Thanks. On a whim I built a project with the "Register with COM Interop" unchecked. I sent it to someone to install and they said it ran fine after running EsriRegasm. I'd like to figure out why it works, but it's hard to prioritize this as a bug. – Kirk Kuykendall Apr 12 '11 at 2:03
  • EsriRegAsm does both - register types with COM (like RegAsm) and register them with Esri component categories (from ArcGIS 10 written to ArcGIS\Desktop10.0\Configuration\CATID instead of registry). This is the option 1 as I outlined above. Option 2 is both of these steps broken down individually. – Petr Krebs Apr 12 '11 at 6:25
  • The "Register with COM interop" checkbox has nothing to do with deployment or how the resulting DLL looks like. It merely says that after every build of your project in VS you want RegAsm.exe to be run for you on your machine. – Petr Krebs Apr 12 '11 at 6:29

I had exactly the same problem. To create the .ecfg files on a build machine without admin privileges and without changing the Local Machine hive of the registry we built a small utility: https://github.com/manimahler/HarvestArcGISComponentCategories

Once we created the files I (actually msbuild) add the .ecfg files to the installer (rather than creating a custom action in the msi).

Hope this works for others too Mani


If you have a single extension to deploy, I've found it easier to run esriRegAsm on the dev machine and then just deploy the created *.ecfg to the proper folder on the 10.0 machine ("$PROGRAMFILES\Common Files\ArcGIS\Desktop10.0\Configuration\CATID"). You still need Admin access but for whatever reason, the file copy operation on Win7 machines is more reliable then whatever esriRegAsm is doing internally (for instance, it needs access to the dll its registering which may be located elsewhere in Program Files)


cheers brian

  • Thanks Brian. I'm sending dlls to a user for testing on a corporate machine where he has to flag down an IT guy just to install my stuff. I was hoping to send him something he can install on his own. Eventually these will be re-written as Add-ins, but was hoping to put that off til later. I wish EsriRegAsm could write the ecfg file to some place similar to the add-in folder. – Kirk Kuykendall Apr 5 '11 at 23:00
  • Yes, EsriRegAsm needs to access the registry even when you use it just to create the *.ecfg file. Since COM registration can entail any custom code you put in ComRegisterFunction and ComUnregisterFunction (e.g. writing registry keys for component categories registration), EsriRegAsm essentially in this case works by monitoring the registry writes. Any registry updates it detects are saved to the *.ecfg file and then rolled back. – Petr Krebs Apr 6 '11 at 6:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.