Inno Registry

I have 3 associated filetypes to my App but I don’t seem to have the following correct as it is associating .cwwtext file type as a ‘Shape’ file and giving an incorrect icon

Root: HKCR; Subkey: “.cwwtext”; ValueType: string; ValueName: “”; ValueData: “Crossword Wizard”; Flags: uninsdeletevalue
Root: HKCR; Subkey: “Crossword Wizard”; ValueType: string; ValueName: “”; ValueData: “Crosswords”; Flags: uninsdeletevalue
Root: HKCR; Subkey: “Crossword Wizard\DefaultIcon”; ValueType: string; ValueName: “”; ValueData: “{app}\Icons\CWWDoc.ico,0”
Root: HKCR; Subkey: “Crossword Wizard\shell\open\command”; ValueType: string; ValueName: “”; ValueData: “”"{app}\Crossword Wizard.exe"" “”%1"""

Root: HKCR; Subkey: “.scwtext”; ValueType: string; ValueName: “”; ValueData: “Crossword Wizard”; Flags: uninsdeletevalue
Root: HKCR; Subkey: “Crossword Wizard”; ValueType: string; ValueName: “”; ValueData: “Shape”; Flags: uninsdeletevalue
Root: HKCR; Subkey: “Crossword Wizard\DefaultIcon”; ValueType: string; ValueName: “”; ValueData: “{app}\Icons\CWWShape.ico,0”
Root: HKCR; Subkey: “Crossword Wizard\shell\open\command”; ValueType: string; ValueName: “”; ValueData: “”"{app}\Crossword Wizard.exe"" “”%1"""

Root: HKCR; Subkey: “.cwptext”; ValueType: string; ValueName: “”; ValueData: “Crossword Wizard Player”; Flags: uninsdeletevalue
Root: HKCR; Subkey: “Crossword Wizard Player”; ValueType: string; ValueName: “”; ValueData: “CrosswordPlayerFile”; Flags: uninsdeletevalue
Root: HKCR; Subkey: “Crossword Wizard Player\DefaultIcon”; ValueType: string; ValueName: “”; ValueData: “{app}\Icons\CWWPlayer.ico,0”
Root: HKCR; Subkey: “Crossword Wizard Player\shell\open\command”; ValueType: string; ValueName: “”; ValueData: “”"{app}\Crossword Wizard Player.exe"" “”%1"""

I have checked against the Xojo Docs and it seems correct so will try installing on a fresh machine?

I should mention I am testing using Parallels

Hi Martin,

When you post code, be sure to put it in the code tags (see the little [< >] icon in the forum editor, it makes it easier to read

I’m comparing your ISS script code to my scripts, and I see a few differences - I have no idea if any of these matter:

  • you have uninsdeletevalue but my scripts use uninsdeletekey in a few places
  • my registry subkeys are all single words (no spaces) but you have spaces in your registry subKeys.
  • otherwise, it looks OK to me.

My app only has a single filetype however, so perhaps there’s some special magic you need to do when you have two or more filetypes?

If you’ve been testing on the same machine, you may want to do a full uninstall of your app (then go into RegEdit and manually clean up any remaining leftover keys/values)

Take a look at https://stackoverflow.com/questions/28297544/inno-setup-registry-section-link-2-files-extensions-in-the-same-entry

It looks like secondary filetypes / extenstions have to be in a subKey using the extension, e.g.

; first file type
Root: HKCR; Subkey: ".filetype1"; ValueType: string; ValueName: ""; ValueData: "MyFileType1"; Flags: uninsdeletevalue
Root: HKCR; Subkey: ".filetype1\\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\\Icons\\FileTypeIcon1.ico,0"; Flags: uninsdeletevalue

; second file type
Root: HKCR; Subkey: ".filetype2"; ValueType: string; ValueName: ""; ValueData: "MyFileType2"; Flags: uninsdeletevalue
Root: HKCR; Subkey: ".filetype2\\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\\Icons\\FileTypeIcon2.ico,0"; Flags: uninsdeletevalue

Thanks Michael that second line was the issue

Final solution that associates 2 filetypes with each launching the app

[code][Registry]
Root: HKCR; Subkey: “.cwwtext”; ValueType: string; ValueName: “”; ValueData: “com.rushsoftware.cww”; Flags: uninsdeletevalue
Root: HKCR; Subkey: “com.rushsoftware.cww”; ValueType: string; ValueName: “”; ValueData: “Crosswords”; Flags: uninsdeletekey
Root: HKCR; Subkey: “com.rushsoftware.cww\DefaultIcon”; ValueType: string; ValueName: “”; ValueData: “{app}\Icons\CWWDoc.ico,0”
Root: HKCR; Subkey: “com.rushsoftware.cww\shell\open\command”; ValueType: string; ValueName: “”; ValueData: “”"{app}\Crossword Wizard.exe"" “”%1"""

Root: HKCR; Subkey: “.scwtext”; ValueType: string; ValueName: “”; ValueData: “com.rushsoftware.cww”; Flags: uninsdeletevalue
Root: HKCR; Subkey: “com.rushsoftware.cww”; ValueType: string; ValueName: “”; ValueData: “Shape”; Flags: uninsdeletekey
Root: HKCR; Subkey: “.scwtext\DefaultIcon”; ValueType: string; ValueName: “”; ValueData: “{app}\Icons\CWWShape.ico,0”; Flags: uninsdeletevalue
Root: HKCR; Subkey: “com.rushsoftware.cww\shell\open\command”; ValueType: string; ValueName: “”; ValueData: “”"{app}\Crossword Wizard.exe"" “”%1"""
[/code]