![]() |
Register a BHO through an NSIS installer
I have an IE BHO which I was packaging through the Visual Studio setup and deployment project. I now want to the package it through an NSIS installer.
My BHO was registering in the following way: [ComRegisterFunctionAttribute] public static void Register(Type t) { string guid = t.GUID.ToString("B"); RegistryKey rkClass = Registry.ClassesRoot.CreateSubKey(@"CLSID\"+guid ); RegistryKey rkCat = rkClass.CreateSubKey("Implemented Categories"); string name = toolbarName; string help = toolbarHelpText; rkClass.SetValue(null, name ); rkClass.SetValue("MenuText", name ); rkClass.SetValue("HelpText", help ); 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); } While this is taken care of by the msi installer that is made by VS, I want to know how can I do the same using NSIS? Any help would be appreciated! Kapil |
If it's just a matter of writing those registry values then you've got all the registry functions in the NSIS documentation. You'll just have to get the GUID and pass it to NSIS. You could do this via a .NET DLL (invoked using the CLR plug-in) or via a .NET console app which you execute with ExecDos/nsExec.
Stu |
Quote:
If your shell extension DLL (hopefully) meets the Microsoft design guidlines there is also an much more easier way: You can use the exported function DllRegisterServer (and for uninstalling DllUnregisterServer). This can easyly done using "RegSvr32.exe". This would be in NSIS like this command: Install: code: Uninstall: code: It is important tu use quotation marks in the command argument of RegSvr32 since the setup directory may contain spaces. If the quotation marks are missing the command argument will be cut at the first space in the argument by RegSvr32! In case your shell extension DLL does not support the registering and unregistering process completely I advice you to implement this in you DLL. This may be needed in case a re-registering or a manual unregistering is nesessary. This makes life much much easier for your customer support! hope this helped a little!? Best regards th_mi |
Do you have to use regsvr32? What about NSIS's RegDLL?
Stu |
Quote:
Quote:
|
| All times are GMT. The time now is 17:33. |
Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.