Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Installer Project, Registry and Regasm

Installer Project, Registry and Regasm

Scheduled Pinned Locked Moved C#
csharpdotnetvisual-studiocomwindows-admin
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ranjan Banerji
    wrote on last edited by
    #1

    I have a COM object built in C#. Its a an IE deskband. It implements the following method: [ComRegisterFunctionAttribute] public static void Register( Type t ) Which gets called when regasm is used and it makes teh appropriate entries into the registry. Works great. Now I am trying to build a installer for this using VS 2005. I did the following: 1. I added all assemblies to the GAC 2. I marked my dll as Regsiter vsdrpCOM in the property window. The install works but my tool bar does not show up in IE. The I tried the following: 1. I added all assemblies to the GAC 2. I added my dll to the prgram folder in addition to the GAC. 3. I marked my dll (the program folder one) as Regsiter vsdrpCOM in the property window. Install works with no errors but toolbar does not show up in IE. BUT, now if I use the commandline and regasm my dll (program folder one), bingo... everything works. What do I have to do in the installer project to make this work. I know the installer lets you make registry entries, but I do not wish to do that. Its what the [ComRegisterFunctionAttribute] public static void Register( Type t ) is meant for. My first hunch was that regasm was not working. On further inspection I realized that regasm was working but not completely. My Register Method does the following: if( 0 != ( style & BandObjectStyle.Vertical ) ) rkCat.CreateSubKey( "{00021493-0000-0000-C000-000000000046}" ); if( 0 != ( style & BandObjectStyle.Horizontal ) ) rkCat.CreateSubKey( "{00021494-0000-0000-C000-000000000046}" ); if( 0 != ( style & BandObjectStyle.TaskbarToolBar ) ) rkCat.CreateSubKey( "{00021492-0000-0000-C000-000000000046}" ); if( 0 != ( style & BandObjectStyle.ExplorerToolbar ) ) Registry.LocalMachine.CreateSubKey( @"SOFTWARE\Microsoft\Internet Explorer\Toolbar" ).SetValue( guid, name ); On inspecting the registry after installation I notice that all entries but the last one are in the registry. So whats going on? A manual regasm works for all of the above, an installer based one does not.

    R 1 Reply Last reply
    0
    • R Ranjan Banerji

      I have a COM object built in C#. Its a an IE deskband. It implements the following method: [ComRegisterFunctionAttribute] public static void Register( Type t ) Which gets called when regasm is used and it makes teh appropriate entries into the registry. Works great. Now I am trying to build a installer for this using VS 2005. I did the following: 1. I added all assemblies to the GAC 2. I marked my dll as Regsiter vsdrpCOM in the property window. The install works but my tool bar does not show up in IE. The I tried the following: 1. I added all assemblies to the GAC 2. I added my dll to the prgram folder in addition to the GAC. 3. I marked my dll (the program folder one) as Regsiter vsdrpCOM in the property window. Install works with no errors but toolbar does not show up in IE. BUT, now if I use the commandline and regasm my dll (program folder one), bingo... everything works. What do I have to do in the installer project to make this work. I know the installer lets you make registry entries, but I do not wish to do that. Its what the [ComRegisterFunctionAttribute] public static void Register( Type t ) is meant for. My first hunch was that regasm was not working. On further inspection I realized that regasm was working but not completely. My Register Method does the following: if( 0 != ( style & BandObjectStyle.Vertical ) ) rkCat.CreateSubKey( "{00021493-0000-0000-C000-000000000046}" ); if( 0 != ( style & BandObjectStyle.Horizontal ) ) rkCat.CreateSubKey( "{00021494-0000-0000-C000-000000000046}" ); if( 0 != ( style & BandObjectStyle.TaskbarToolBar ) ) rkCat.CreateSubKey( "{00021492-0000-0000-C000-000000000046}" ); if( 0 != ( style & BandObjectStyle.ExplorerToolbar ) ) Registry.LocalMachine.CreateSubKey( @"SOFTWARE\Microsoft\Internet Explorer\Toolbar" ).SetValue( guid, name ); On inspecting the registry after installation I notice that all entries but the last one are in the registry. So whats going on? A manual regasm works for all of the above, an installer based one does not.

      R Offline
      R Offline
      Ranjan Banerji
      wrote on last edited by
      #2

      I should reply to my own post. I found the answer to this long ago, but never came back to update this. So here goes. Regasm comes with Visual Studio. So a machine with no visual studio and just the .Net framework will NOT have regasm on it. Hence, you cannot rely on [ComRegisterFunctionAttribute] public static void Register( Type t ) For this is called by regasm. You need to find other ways to register your DLL and make otehr registry entries.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups