Registering application in windows registry

10,449

Yes there are multiple places in the registry where you can put application information and which key to use depends on what/why you are registering.

I would argue that the main registration point is the registration for "Default Programs" under SOFTWARE\RegisteredApplications. If your application fits one of the client types then you should point your RegisteredApplications value to Software\Clients\%ClientType%\%YourCanonicalName%\Capabilities, otherwise you can use any key like Software\%YourCompany%\%YourApp%\Capabilities or Software\Classes\Applications\%Filename%\Capabilities.

If you want your application to appear in the "Open With" dialog of a specific file extension then you can list your ProgId under HKCR\%.ext%\OpenWithProgids or the application filename under HKCR\%.ext%\OpenWithList.

General "Open With" information is stored under HKCR\Applications\%Filename%.

The Software\Microsoft\Windows\CurrentVersion\App Paths key is mainly used as a %Path% environment variable extension for the shell so it can find the full path to your executable if the user types just the filename in the Run dialog. It can also contain some information about how your application handles "drag & drop" and URL protocols.

There is also some application info under HKCR\AppID but this is not applicable unless you have a COM server.


As far as you specific question goes, HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\MyApp.exe and HKEY_CURRENT_USER\Software\Classes\Applications\MyApp.exe are documented registrations keys I already covered. The SupportedTypes key is documented here.

HKEY_CURRENT_USER\Software\Classes\MyApp looks like a ProgId and those are generally used to register file types and URL protocol handlers.

Share:
10,449
Tympanix
Author by

Tympanix

Updated on June 04, 2022

Comments

  • Tympanix
    Tympanix almost 2 years

    Windows has a vague and unambiguous way of declaring standards for registering applications in the windows registry.

    Following the official documentation for application registration Microsoft recommends registering apps under

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\MyApp.exe
    

    This recommendation however doesn't seem to be followed by developers since this key has not even been created on my system yet while other applications being registered into

    HKEY_CURRENT_USER\Software\Classes\MyApp
    

    and

    HKEY_CURRENT_USER\Software\Classes\Applications\MyApp.exe
    

    Each of the keys above has a different structure and thus different options (i.e. the key SupportedTypes being available in one but not the other). What is the difference between registering apps under these different keys and in what scenarios would you chose one over another?