Devesh Agarwal
Devesh Agarwal

Reputation: 19

how to start multiple files in windows in one process?

I have a java audio player with a exe launcher which I made with launch4j and created a installer with inno setup. In windows when I select multiple files and open them, each file opens in different process, but what I want is all the files to open in one process.

In inno setup-

Root: HKA; Subkey: "Software\Classes\.mp3\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocKeyMP3}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKeyMP3}"; ValueType: string; ValueName: ""; ValueData: "{#MyAppAssocName}"; Flags: uninsdeletekey
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKeyMP3}\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppExeName},0"
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKeyMP3}\shell\open"; ValueType: string; ValueName: "MultiSelectModel"; ValueData: ""
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKeyMP3}\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1"""

Do I have to change the open command in inno setup? If yes, what is the right command?

Thanks.

Upvotes: 0

Views: 179

Answers (1)

Martin Prikryl
Martin Prikryl

Reputation: 202594

This is not really an Inno Setup question. There's no registry setting that can make that for you.

You need to code this into your application. When the application is started to open a file/document/media, it needs to check if there's another instance of itself. And if there is, it will tell the existing instance to open the file instead. And the new instance will silently exit then.

If your application is expensive to start, you may want to implement a small bootstrapper app for this purpose (possibly not in Java).

Upvotes: 1

Related Questions