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.
- 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?
- 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?
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
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.
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!
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.
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!
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.