How can I reference a custom icon for a file association in Inno Setup?

martinez314

My application creates documents. I want to have a special icon for the documents it creates, other than just the application icon. On OS X, there is a clear way to do this via the Info.plist. In Windows, however, I'm having trouble. I am using Launch4J and Inno Setup.

Inno Setup describes how to specify an icon via a file association. The example uses the application EXE that contains multiple icons, referencing them as 0, 1, 2, etc. However, Launch4J appears to only support creating an EXE with a single icon, the application icon. So this example won't work for me.

Here is my current Icons section:

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon

Here is an example file association:

[Registry]
Root: HKCR; Subkey: ".ext"; ValueType: string; ValueName: ""; ValueData: "EXT"; Flags: uninsdeletevalue; Tasks: associateext
Root: HKCR; Subkey: "EXT"; ValueType: string; ValueName: ""; ValueData: "EXT"; Flags: uninsdeletekey; Tasks: associateext
Root: HKCR; Subkey: "EXT\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\MyProg.exe,0"; Tasks: associateext
Root: HKCR; Subkey: "EXT\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\MyProg.exe"" ""%1"""; Tasks: associateext

How can I reference a custom icon for a file association in Inno Setup? (Or embed multiple icons in a Launch4J EXE?)

RobeN

You can point any icon file or choose an icon from EXE/DLL file:

Root: "HKCR"; Subkey: "EXT\DefaultIcon"; ValueType: string; 
 ValueData: """PATH\Icon.file"""; Flags: uninsdeletekey; Tasks: associateext

In your case it could be:

Root: "HKCR"; Subkey: "EXT\DefaultIcon"; ValueType: string; 
 ValueData: """{app}\MyCustomIcon.ico"""; Flags: uninsdeletekey; Tasks: associateext

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I reference a custom icon for a file association in Inno Setup?

From Dev

With Inno Setup how can I rename and copy a file a user chooses (an image) to the program files directory

From Dev

How can I set the exit code from return code of my Execute File in Inno Setup?

From Dev

How can I reference an icon from a plugin?

From Dev

Inno Setup: How can I get the Exception Code of a raised Exception?

From Dev

How can i get Inno setup uninstaller script to remove a service

From Dev

How can I install .NET framework as a prerequisite using Inno Setup?

From Dev

How can i get Inno setup uninstaller script to remove a service

From Dev

Electron app file association - Custom icon not appearing

From Dev

How can I set a custom icon for a folder?

From Dev

How to add two custom pages in Inno Setup?

From Dev

Custom command line parameter in Inno Setup with default value so I can pass build configuration

From Dev

How can I setup ~/.tidyrc file for XML?

From Dev

How to create a hotkey for desktop icon using Inno Setup

From Dev

Inno setup: how to replace a string in XML file?

From Dev

Inno Setup (How to get dynamically path to file)?

From Dev

Inno Setup Compiler: How to modify file content

From Dev

How to call the GetNativeSystemInfo at Inno Setup iss file?

From Dev

Inno Setup: Custom classes

From Dev

Inno Setup: Custom classes

From Dev

Inno Setup task bar icon

From Dev

Inno Setup: Hide icon in titlebar?

From Dev

Inno Setup: How can I give a serial number to installer when I execute it silently in command line?

From Dev

How can I reference this data in this JSON file?

From Dev

Inno Setup - How can I tell the installation when it execute Google Chrome, it should open stackoverflow.com?

From Dev

In Inno Setup, how can I set the text color of the text in an input field?

From Dev

Inno Setup - How can I put a version number on the bottom left corner of welcome page

From Dev

How can I use a SharePoint Site (365) as the source for Inno Setup files?

From Dev

How can I keep console window after executing a command in Inno Setup

Related Related

  1. 1

    How can I reference a custom icon for a file association in Inno Setup?

  2. 2

    With Inno Setup how can I rename and copy a file a user chooses (an image) to the program files directory

  3. 3

    How can I set the exit code from return code of my Execute File in Inno Setup?

  4. 4

    How can I reference an icon from a plugin?

  5. 5

    Inno Setup: How can I get the Exception Code of a raised Exception?

  6. 6

    How can i get Inno setup uninstaller script to remove a service

  7. 7

    How can I install .NET framework as a prerequisite using Inno Setup?

  8. 8

    How can i get Inno setup uninstaller script to remove a service

  9. 9

    Electron app file association - Custom icon not appearing

  10. 10

    How can I set a custom icon for a folder?

  11. 11

    How to add two custom pages in Inno Setup?

  12. 12

    Custom command line parameter in Inno Setup with default value so I can pass build configuration

  13. 13

    How can I setup ~/.tidyrc file for XML?

  14. 14

    How to create a hotkey for desktop icon using Inno Setup

  15. 15

    Inno setup: how to replace a string in XML file?

  16. 16

    Inno Setup (How to get dynamically path to file)?

  17. 17

    Inno Setup Compiler: How to modify file content

  18. 18

    How to call the GetNativeSystemInfo at Inno Setup iss file?

  19. 19

    Inno Setup: Custom classes

  20. 20

    Inno Setup: Custom classes

  21. 21

    Inno Setup task bar icon

  22. 22

    Inno Setup: Hide icon in titlebar?

  23. 23

    Inno Setup: How can I give a serial number to installer when I execute it silently in command line?

  24. 24

    How can I reference this data in this JSON file?

  25. 25

    Inno Setup - How can I tell the installation when it execute Google Chrome, it should open stackoverflow.com?

  26. 26

    In Inno Setup, how can I set the text color of the text in an input field?

  27. 27

    Inno Setup - How can I put a version number on the bottom left corner of welcome page

  28. 28

    How can I use a SharePoint Site (365) as the source for Inno Setup files?

  29. 29

    How can I keep console window after executing a command in Inno Setup

HotTag

Archive