sharpshell icon indicating copy to clipboard operation
sharpshell copied to clipboard

Docs: Reigstration and Installation Issues FAQ

Open Countryen opened this issue 5 years ago • 5 comments

Version of SharpShell used: 2.7.x

Related type(s) of SharpShell-Server: Any

Since there have been quite a few questions like "Why does my Extension not show up" or "How do I install/register my extension" and others, I will try to add a FAQ related only to registration and installation issues to the docs, referencing the issues and trying to give best practices.

Some of it might be soon obsolete, if/when a new method of registration comes in place, but most of the information will be the same regarding GAC, Registry, Explorer and others.

I'll keep this issue, as a reminder and to welcome others to join me in building the FAQ. If you have - new or old - questions to the registration/installation of Servers, post them here.

Countryen avatar Aug 31 '19 18:08 Countryen

Hey @dwmkerr something irritates me. You can install Servers. You can Register servers. Installing = Putting them into GAC Registering = Putting them into Registry (CLSID, etc.)

But now the SRM says here https://github.com/dwmkerr/sharpshell/blob/Countryen-patch-2-docs/docs/srm/srm.md#installing--uninstalling-servers

How to "install" servers - but doesn't it register them (too)? Is that - to me confusing wording - intentional?

I guess that "install" with -codebase flag means "register and do not install in GAC"?

Countryen avatar Sep 01 '19 15:09 Countryen

How can I help?

Also, I have noticed that is you use the simpler SRM approach, while it is easier (less steps) the downside is that if you are still developing your extension and adding it to the Explorer at while doing so, the next time you build the build will fail telling you that the dll is locked by the Explorer.

Using the GAC approach seems to avoid this issue at the expense of a more complicated install and uninstall procedure.

RichardSharpe avatar Sep 02 '19 16:09 RichardSharpe

Hey @RichardSharpe, if you wanna assist/help, see this:

If you have - new or old - questions to the registration/installation of Servers, post them here.

I want to make a simple FAQ with Numbers to reference later. Should handle all sorts of questions/issues/problems regarding installation and registration, including Registry, GAC, COM, SRM and SM. Format:

  • #XY - SHORTCUT - DATE
  • Question: How do I ...
  • Answer: Do ...
  • References: Issue #XYZ, https://...

How I handle the situation you mentioned:

  • Develop and compile the DLL
  • Install & Register with SRM
  • Restart Explorer with SRM
  • Test my Extension
  • Unregister & Uninstall with SRM
  • Restart Explorer with SRM
  • Close SRM
  • Develop again, the DLL is now unblocked for compilation again.

This can be done automatically at compiling with SRM or gacutil+regasm, too (via pre-/post-builds) but I tend to do it manually. Also, this isn't even always the case, only some (I think mainly PropertySheets and Namespace Extensions) block the DLL - not all of them :)

The best way is, imho, to separate the business logic of your application from the server/com/registry boilerplate. Like develop all the stuff that's actually "logic" in a seperate DLL and just load that DLL from your Server - this DLL will not be blocked. Getting the actual Server Registration and Configuration right can be tricky too, but usually it's simple and doesn't need as many re-compiles (Context Menu, etc.).

Oh also I think there is a way to tell the explorer to "hot-load" your extensions and not block them. But I don't remember how and never tested it.

Countryen avatar Sep 02 '19 17:09 Countryen

Oh also, if you are interested, I am currently working on more test coverage for the project, see project 4 for more information about that. I would appreciate any help. Even if the code is to be changed soon, the tests now will provide crucial information about what acutally breaks. @RichardSharpe

Countryen avatar Sep 02 '19 17:09 Countryen

Candidate for FAQ: #303 - especially the part about differences when uninstalling with srm.

Countryen avatar Sep 02 '19 17:09 Countryen