Zaky
Zaky

Reputation: 409

Non-Admin registration of ActiveX Controls

according to Non-Admin ActiveX Controls, it is possible to register activeX under current user (that will not require admin right during the installation). I have crated ATL project (VS2008, native) and added some ATL Control that does nothing.

I created an inf file:

    [version]
    signature="$CHICAGO$"
    AdvancedINF=2.0

[Add.Code]
     Batman.dll=Batman.dll

[Deployment]
    InstallScope=user

[Batman.dll]
    file-win32-x86=thiscab
    clsid={2C10EC82-2BF3-4ED5-8AFC-E5146C672B3D}
    FileVersion=1,0,0,1
    RegisterServer=yes

Add both the dll and inf into CAB and signed it. I load an ActiveX from simple html page

<OBJECT ID="sampleControl" CLASSID="CLSID:2C10EC82-2BF3-4ED5-8AFC-E5146C672B3D" CODEBASE="Batman.cab#Version=1,0,0,1"></OBJECT>

And it does not register it under current user anyhow.

I case I specify InstallScope=machine there is not problem the activeX is loaded.

Any idea what should be done ?

Thanks

Upvotes: 3

Views: 3304

Answers (3)

weir
weir

Reputation: 41

I encounter the same problem, but the strangest part is, it's ok with Apache Server while not with Tomcat Server.

Finally, I found it also related to Web Server setting.

Your Web Server MUST support correct mime type mapping. If you test with Tomcat, add following to web.xml:

<mime-mapping>
    <extension>cab</extension>
    <mime-type>application/vnd.ms-cab-compressed</mime-type>
</mime-mapping>

Upvotes: 2

taxilian
taxilian

Reputation: 14324

With the version of ATL that comes with VS2008, you can do this with:

AtlSetPerUserRegistration(TRUE);

Call that in DllRegisterServer and DllUnregisterServer at the beginning. If you need to do this in vs2005 or earlier, you'll have to use a scarier hack.

An example of a class that takes care of both methods for you (depending on the vs ver) is here: https://github.com/firebreath/FireBreath/blob/master/src/ActiveXCore/axutil.cpp

and the example usage here: https://github.com/firebreath/FireBreath/blob/master/src/PluginAuto/Win/FireBreathWin.cpp

I hope it helps

Upvotes: 1

Eugene
Eugene

Reputation: 3427

Try this, at least it works for me:

[Deployment]    
  InstallScope=user|machine

[Batman.dll]
  file-win32-x86=thiscab
  clsid={2C10EC82-2BF3-4ED5-8AFC-E5146C672B3D}
  FileVersion=1,0,0,1
  RegisterServer=yes
  RedirectToHKCU=yes

Non-Admin ActiveX Controls

Upvotes: 0

Related Questions