1

I think this is a very weird question, but anyway...

I have created two C# applications, himgr.exe and cimgr.exe. They're installed with Inno Setup, and copied to C:\Program Files [(x86)]\Imgr Suite.

They're done to be used through a context menu entry at explorer.exe, so I configured the installator to create a few keys in the registry:

[Registry]
Root: HKLM; Subkey: "SOFTWARE\classes\jpegfile\shell\Halve size"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\classes\jpegfile\shell\Halve size\command"; ValueType: string; ValueName: ""; ValueData: """{app}\himgr.exe"" ""%1"""
Root: HKLM; Subkey: "SOFTWARE\classes\pngfile\shell\Halve size"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\classes\pngfile\shell\Halve size\command"; ValueType: string; ValueName: ""; ValueData: """{app}\himgr.exe"" ""%1"""
Root: HKLM; Subkey: "SOFTWARE\classes\giffile\shell\Halve size"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\classes\giffile\shell\Halve size\command"; ValueType: string; ValueName: ""; ValueData: """{app}\himgr.exe"" ""%1"""
Root: HKLM; Subkey: "SOFTWARE\classes\jpegfile\shell\Resize to custom size"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\classes\jpegfile\shell\Resize to custom size\command"; ValueType: string; ValueName: ""; ValueData: """{app}\cimgr.exe"" ""%1"""
Root: HKLM; Subkey: "SOFTWARE\classes\pngfile\shell\Resize to custom size"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\classes\pngfile\shell\Resize to custom size\command"; ValueType: string; ValueName: ""; ValueData: """{app}\cimgr.exe"" ""%1"""
Root: HKLM; Subkey: "SOFTWARE\classes\giffile\shell\Resize to custom size"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\classes\giffile\shell\Resize to custom size\command"; ValueType: string; ValueName: ""; ValueData: """{app}\cimgr.exe"" ""%1"""

The full installation script is here.

Note: I also tried HKCR\jpegfile etc. and it worked for me, but...

Neither using the script above (using HKLM) nor with HKCR, for some people it doesn't work. 4 people out of 6 who have tried it haven't had any problems and it has worked as intended, but for 2 people it hasn't.

The entries were at the registry, but there were no context menu entries.

For one of the testers, the Edit with GIMP entry of the jpegfile key, although present in registry, wasn't shown in the context menu either. Also, for the same tester, the Preview entry for the context menu was shown twice.

In this thread you have more information about the program itself and the tests. A RAR file with all the files needed for the compilation of the installer is available here.

This is really worrying me, and we can't find any explanation for why is it not working.

Dennis Kriechel
  • 3,719
  • 14
  • 40
  • 62

1 Answers1

1

Most likely, the people whom it didn't work for have had .gif and/or .jpg associated with a different ProgId than "giffile" or "jpegfile".

You can get Inno to add the registration to whatever the current ProgId association is like so:

[Registry]
Root: HKLM; Subkey: "SOFTWARE\Classes\{reg:HKLM\SOFTWARE\Classes\.jpg|jpegfile}\shell\Halve size"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\Classes\{reg:HKLM\SOFTWARE\Classes\.jpg|jpegfile}\shell\Halve size\command"; ValueType: string; ValueName: ""; ValueData: """{app}\himgr.exe"" ""%1"""
Root: HKLM; Subkey: "SOFTWARE\classes\{reg:HKLM\SOFTWARE\Classes\.png|pngfile}\shell\Halve size"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\classes\{reg:HKLM\SOFTWARE\Classes\.png|pngfile}\shell\Halve size\command"; ValueType: string; ValueName: ""; ValueData: """{app}\himgr.exe"" ""%1"""

Abd so on for your other entries.

Bear in mind that if the user later changes their file associations (or installs an application that does so) then these options may disappear again until they re-run your installer.

Miral
  • 12,637
  • 4
  • 53
  • 93