Used wizard, found one stray ".myp"

116 views
Skip to first unread message

Stijn Sanders

unread,
Nov 22, 2024, 4:55:12 PM11/22/24
to innosetup
I've just recently upgraded to 6.3.3 and used the script wizard, selected my file association, 
selected to use #define's, but found one ".myp" that wasn"t replaced with my file extension, in the line:

Root: HKA; Subkey: "Software\Classes\Applications\{#MyAppExeName}\SupportedTypes"; ValueType: string; ValueName: ".myp"; ValueData: ""

Then, when I try the setup file, the install is listed by Windows in its list by the default application icon, not with the icon I specified with SetupIconFile or the main application executable's icon... Is that a bug or do I need an extra assignment in [Setup]?

Stijn Sanders

unread,
Nov 22, 2024, 5:00:44 PM11/22/24
to innosetup
update: I found out it's this one I needed:

UninstallDisplayIcon={app}\{#MyAppName}

so I would humbly propose to add this to the script wizard?

Op vrijdag 22 november 2024 om 22:55:12 UTC+1 schreef Stijn Sanders:

Martijn Laan

unread,
Dec 11, 2024, 11:32:12 AM12/11/24
to inno...@googlegroups.com
Hi,

Op 22-11-2024 om 23:00 schreef Stijn Sanders:
update: I found out it's this one I needed:

UninstallDisplayIcon={app}\{#MyAppName}

so I would humbly propose to add this to the script wizard?

I've made it so it now always adds this line when it can (if there's a main executable file chosen which is actually a file with an .exe extension). Thanks for the suggestion!.

Greetings,
Martijn

Jordan Russell

unread,
Dec 28, 2024, 2:00:48 AM12/28/24
to inno...@googlegroups.com
On 11/22/2024 3:47 PM, Stijn Sanders wrote:
> I've just recently upgraded to 6.3.3 and used the script wizard, selected
> my file association,
> selected to use #define's, but found one ".myp" that wasn"t replaced with
> my file extension, in the line:
>
> Root: HKA; Subkey:
> "Software\Classes\Applications\{#MyAppExeName}\SupportedTypes"; ValueType:
> string; ValueName: "*.myp*"; ValueData: ""

I was going to fix that hard-coded .myp, but now I'm puzzled as to why
that line exists at all.

It appears that the lines generated by the Script Wizard were copied
from this post:
https://groups.google.com/g/innosetup/c/TQeEXXkm9PA/m/F9GFkCczBAAJ

But there are other "Software\Classes\Applications" values at the top
that aren't included.

I tested the generated lines on Windows 11 without that SupportedTypes
key and everything seems to work fine. I created a file named
"test.myp", and Explorer immediately showed the correct icon. Didn't
have to open it or anything. And when right-clicking the file,
MyProg.exe is in the "Open with" list (it says MyProg.exe because the
EXE lacks version info).

The docs mention the SupportedTypes key on the "How to Exclude an
Application from the Open With Dialog Box for Unassociated File Types" page:
https://learn.microsoft.com/en-us/windows/win32/shell/how-to-exclude-an-application-from-the-open-with-dialog-box-for-unassociated-file-types

But if I'm reading the page correctly, that's only a problem you have to
worry about when you already have an Applications key:

"By default, any application registered as a subkey of
HKEY_CLASSES_ROOT\Applications is presented in the Open with dialog box.
These applications are presented in Open with regardless of whether the
application is registered to handle the file type."

So this line is creating a new Applications key, which creates the
problem, then creating the SupportedTypes subkey to fix the problem it
just created...?

-JR

Jernej Simončič

unread,
Dec 28, 2024, 7:39:04 AM12/28/24
to Jordan Russell on [innosetup]
On Saturday, December 28, 2024, 08:00:36, Jordan Russell wrote:

> So this line is creating a new Applications key, which creates the
> problem, then creating the SupportedTypes subkey to fix the problem it
> just created...?

IIRC, the whole point of Applications key is to set the FriendlyAppName value, which is presented in "Choose default program" dialog – but once you have that, you also need SupportedTypes.

--
< Jernej Simončič ><><><><>< https://eternallybored.org/ >

You can observe a lot just by watching.
-- First Law of Science

Jordan Russell

unread,
Dec 30, 2024, 1:13:51 AM12/30/24
to inno...@googlegroups.com
On 12/28/2024 6:38 AM, Jernej Simončič wrote:
> IIRC, the whole point of Applications key is to set the FriendlyAppName value, which is presented in "Choose default program" dialog – but once you have that, you also need SupportedTypes.

Ah, thanks.

The docs say that FriendlyAppName:
"Provides a way to get a localizable name to display for an application
instead of just the version information appearing, which may not be
localizable."

So I take it nothing breaks if it isn't specified.

I think I'll just remove that SupportedTypes key as it doesn't appear to
do anything by itself. It also wasn't being deleted at uninstall time.

-JR

Reply all
Reply to author
Forward
0 new messages