You are here

Thoughts about the keys "SinglePortableAppInstance" and "WaitForOtherInstances"

7 posts / 0 new
Last post
tapsklaps
Offline
Last seen: 5 years 5 months ago
Developer
Joined: 2010-10-17 08:11
Thoughts about the keys "SinglePortableAppInstance" and "WaitForOtherInstances"

For the following considerations I assume, that a portable app called "AppName" stores its settings in the registry key HKCU\Software\AppName. Furthermore this app is able to run multiple instances simultaneously.

  1. Case 1: The portable app uses the default values of the 2 keys

    First, I run two instances of the app simultaneously. Now I close one of the both instances. Due to the fact, that the value of the key "WaitForOtherInstances" is true, this means that the Launcher doesn't starts the clean-up. Instead the Launcher wait until both instances are closed. Only after the closure of both instances the launcher starts with the clean-up.

    Are these statements so far correct?

  2. Case 2: The portable app uses not the default values of the 2 keys

    Assume the portable app uses the default value of the key "SinglePortableAppInstance" but the value of the key "WaitForOtherInstances" may be false.

    Again I run two instances of the app simultaneously. Now I close one of the both instances. Due to the fact, that the value of the key "WaitForOtherInstances" is false, this means that the Launcher starts the clean-up. In my special case that means, the launcher deletes the registry key HKCU\Software\AppName. However, because still a second instance is running, this deletion will result that this instance is not working correctly.

    Are these statements so far correct?

Simeon
Simeon's picture
Offline
Last seen: 9 years 5 months ago
DeveloperTranslator
Joined: 2006-09-25 15:15
1. Yes. 2. Yes, but it

1. Yes.
2. Yes, but it depends on the app how it reacts to the missing key. It may crash, it may keep working, and throw an error or not.

"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate

tapsklaps
Offline
Last seen: 5 years 5 months ago
Developer
Joined: 2010-10-17 08:11
Storage of the settings

Thanks for your immediate reply. Regarding to the case 2 that surely also means, that the second instance isn't able to store its settings because of the missing registry key.

John T. Haller
John T. Haller's picture
Offline
Last seen: 2 hours 57 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Developer Prevent

It is up to the developer to choose the appropriate settings. Other portable app instances should not be used in the case of registry keys.

Sometimes, the impossible can become possible, if you're awesome!

tapsklaps
Offline
Last seen: 5 years 5 months ago
Developer
Joined: 2010-10-17 08:11
meaningful use of multiple instances

I agree. The same problem surely occurs, if the app stores its settings in %AppData%. But in which case it's meaningful, that I can use multiple instances? A case might be, if the app stores its settings in the program directory.

John T. Haller
John T. Haller's picture
Offline
Last seen: 2 hours 57 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Directed

Usually, it's only with apps where you can direct it to a specific directory (command line switch, environment variable, etc), so the launcher doesn't need to wait around to clean up.

Sometimes, the impossible can become possible, if you're awesome!

tapsklaps
Offline
Last seen: 5 years 5 months ago
Developer
Joined: 2010-10-17 08:11
Storage in a registry key or in %AppData%

Once again I agree. Another important aspect would be, that the value of the key "WaitForOtherInstances" necessarily must be true, if the app stores its settings in a registry key or in %AppData%. Or I doesn't use multiple instances how you mentioned above.

Log in or register to post comments