I am using Inno Setup and am trying to associate a program that is located in the Program Files (x86) in Windows 7. I have the following:
#defin
Creating file associations has been answered on SO before. But the core documentation refers to it:
http://www.jrsoftware.org/isfaq.php#assoc
Creating File Associations
First set the
[Setup]section directiveChangesAssociationstoyes. Then create[Registry]entries as shown below.[Registry] Root: HKCR; Subkey: ".myp"; ValueType: string; ValueName: ""; ValueData: "MyProgramFile"; Flags: uninsdeletevalue
.mypis the extension we're associating.MyProgramFileis the internal name for the file type as stored in the registry. Make sure you use a unique name for this so you don't inadvertently overwrite another application's registry key.Root: HKCR; Subkey: "MyProgramFile"; ValueType: string; ValueName: ""; ValueData: "My Program File"; Flags: uninsdeletekey
My Program Fileabove is the name for the file type as shown in Explorer.Root: HKCR; Subkey: "MyProgramFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\MYPROG.EXE,0"
DefaultIconis the registry key that specifies the filename containing the icon to associate with the file type.,0tells Explorer to use the first icon fromMYPROG.EXE. (,1would mean the second icon.)Root: HKCR; Subkey: "MyProgramFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\MYPROG.EXE"" ""%1"""
shell\open\commandis the registry key that specifies the program to execute when a file of the type is double-clicked in Explorer. The surrounding quotes are in the command line so it handles long filenames correctly.