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:
#define MyAppName "MyView" #define MyAppExeName "MyView.exe" [Setup] AppName={#MyAppName} [Registry] Root: HKCR; Subkey: ".mpl"; ValueType: string; ValueName: ""; ValueData: "MyView"; Flags: uninsdeletevalue Root: HKCR; Subkey: "MyView"; ValueType: string; ValueName: ""; ValueData: "MyView"; Flags: uninsdeletekey Root: HKCR; Subkey: "MyView\delta.ico"; ValueType: string; ValueName: ""; ValueData: "{app}\GeoView.EXE,0" Root: HKCR; Subkey: "MyView\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\MYVIEW.EXE"" ""%1"""
Any suggestions for why the association is not working?
Windows allows you to change file associations by going into Settings > Apps > Default Apps and selecting at the bottom the option titled "Choose default apps by file type". This will open a screen that lists all of the configured extensions on the computer and the program associated with them.
File associations are registry settings that tell Windows what application to use to open files of a certain type. For example, Windows typically launches Notepad.exe when a text (. txt) file is opened.
Using File Association Fixer Tool is simplicity in motion; launch, choose the file requiring fixing and then load it. From there, it will restore the associations while keeping the file contents intact. Upon completion of the process, you will be notified to open the file with its intended program.
Inno Setup is a free software script-driven installation system created in Delphi by Jordan Russell. The first version was released in 1997. Inno Setup. Screenshot of the Inno Setup IDE running on Windows 7. Developer(s)
If you want to associate a program with an extension just add this instruction in your iss file :
In the section
[Setup] ChangesAssociations = yes
^-Setup will tell Explorer to refresh its file associations information at the end of the installation, and Uninstall will do the same at the end of uninstallation.
And in the section
[Registry] Root: HKCR; Subkey: ".mpl"; ValueData: "{#MyAppName}"; Flags: uninsdeletevalue; ValueType: string; ValueName: "" Root: HKCR; Subkey: "{#MyAppName}"; ValueData: "Program {#MyAppName}"; Flags: uninsdeletekey; ValueType: string; ValueName: "" Root: HKCR; Subkey: "{#MyAppName}\DefaultIcon"; ValueData: "{app}\{#MyAppExeName},0"; ValueType: string; ValueName: "" Root: HKCR; Subkey: "{#MyAppName}\shell\open\command"; ValueData: """{app}\{#MyAppExeName}"" ""%1"""; ValueType: string; ValueName: ""
Root: HKCR; Subkey: ".magi"; ValueData: "MyMAGIApplication"; ValueType: string; ValueName: ""; Flags: uninsdeletevalue
. This instruction add ".magi" key in the registry, with more accurate in HKEY_CLASSES_ROOT (HKCR). In this instruction we also have ValueName=""
so it get the default value in the registry.
Root: HKCR; Subkey: "MyMAGIApplication"; ValueData: "Program MAGI"; ValueType: string; ValueName: ""; Flags: uninsdeletekey
In order to add the key MyMAGIApplication
in HKCR with the value "Program MAGI".
Root: HKCR; Subkey: "MyMAGIApplication\DefaultIcon"; ValueData: "{app}\MAGI.EXE,0"; ValueType: string; ValueName: ""
In order to associate an icon contains in the executable. "0" indicates that it's the first icon present in the executable MAGI.EXE.
Root: HKCR; Subkey: "MyMAGIApplication\shell\open\command"; ValueData: """{app}\MAGI.EXE"" ""%1"""; ValueType: string; ValueName: ""
In order to add the subkey shell\open\command. With this instruction, Windows is able to launch application MAGI.EXE when an user click on a file with extension ".magi".
And the result in registry :
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With