How to make an installer register an IE addon

136 views Asked by At

I have an Internet Explorer addon with an installer project. The project contains an install class that should register the dll, making it available on ie.

But no matter what I try, this never works. What does work is if I run a batch file to register the dll.

This is the installer code:

public override void Install(System.Collections.IDictionary stateSaver) {
  base.Install(stateSaver);

  RegistrationServices regsrv = new RegistrationServices();
  if (!regsrv.RegisterAssembly(this.GetType().Assembly,
    AssemblyRegistrationFlags.SetCodeBase)) {
      throw new InstallException("Failed To Register for COM");
  }
}

And here is the batch file that is registering the dll, making the extension appear on ie:

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" "%~dp0extension.dll"

There are two easy paths from here: the install script is just wrong, so I could fix it, or I could just run the batch script from the installer. Well, that is the weirdest part of all this.

If I run the batch file manually on the install folder, everything works fine, including subsequent uninstall and installs after that. That means the installer class is working, at least partially.

Also, running the registration command manually does work, running it from the installer doesn't. The console output says the library is registered, but it doesn't show up in ie. After a manual run, everything works even on reinstall - which makes me think those issues are related.

Any tips I can further try?


Oh, I also tried combinations between the installer class and the Register property on the installer output, with no success.

0

There are 0 answers