I am trying to get Windows to recognise my program’s File extensions but without much luck, as usual.
This is what I am doing, please advise where or what I am doing wrong – I think I might have the registry locations or naming set incorrectly:
Sample Names
MyProg.exe = The name of the program.
%InstallPath% = Where the program will be installed.
.ext1 = 1st File Extension.
.ext2 = 2nd File Extension.
.ext3 = 3rd File Extension.
Registry Locations (where I have added to)
HKEY_CLASSES_ROOT\.ext1
HKEY_CLASSES_ROOT\.ext2
HKEY_CLASSES_ROOT\.ext3
HKEY_CLASSES_ROOT\.ext1\DefaultIcon,2
HKEY_CLASSES_ROOT\.ext1\shell\open\command\%InstallPath%\MyProg.exe %1
I got kind of lost off after that 🙁
File Images
I have added the 3 icon files from the XE IDE Resources Menu, and named them 2,3,4. I think if I have an Icon named 1, it will override the Project icon?
I want to get these working right before using an installer such as Inno Setup on a machine that has never seen my program (to see if the installation was flawless).
I can’t find any easy to follow guides 🙁
You are setting up the Registry keys wrong. You need to associate the file extensions with ProgIDs, then associate the ProgIDs with your app, like this:
Read the following documentation for more details:
File Types and File Associations
FYI, you should not be writing data to
HKEY_CLASSES_ROOTdirectly. Write to eitherHKEY_CURRENT_USER\Software\Classesand/orHKEY_LOCAL_MACHINE\Software\Classesinstead, depending on whether you want per-user or machine-global registration. Read the following documentation for more details as to why.HKEY_CLASSES_ROOT Key
Merged View of HKEY_CLASSES_ROOT