You are here

KeePassXC Portable Single Instance support

5 posts / 0 new
Last post
hgtok
Offline
Last seen: 2 weeks 5 days ago
Joined: 2021-07-22 21:14
KeePassXC Portable Single Instance support

(Cross posting to Development Forum https://portableapps.com/node/71332)

Hi, I would like to request for proper support for single instance in the Launcher.

The app has an option to toggle single instance, but the Launcher ignores it and runs multiple instances.

According to https://portableapps.com/manuals/PortableApps.comLauncher/ref/launcher.i..., the SinglePortableAppInstance flag is false by default, which should resolve this issue.

Thanks

John T. Haller
John T. Haller's picture
Offline
Last seen: 9 hours 38 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Just Launches

The KeePassXCPortable.exe launcher launches KeePassXC.exe without any command line options or anything that would make multiple instances appear. If the app itself has a single instance mode and it is set, the launcher isn't doing anything that should interfere with it.

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

hgtok
Offline
Last seen: 2 weeks 5 days ago
Joined: 2021-07-22 21:14
still not supported for 2.7.10

hi John, i'm not sure if there were many changes since a year back, but i have perform the testing with the latest 2.7.10:

testing with KeePassXC.exe directly:
1. launch first instance of App\KeePassXC\KeePassXC.exe
2. ensure single instance of KeePassXC is enabled in Tools > Settings > Startup (otherwise enable it and restart exe from step 1)
3. launch second instance of App\KeePassXC\KeePassXC.exe
4. KeePassXC would detect previous instance correctly, and opens the first instance

however this does not work with KeePassXCPortable.exe:
1. launch first instance of KeePassXCPortable.exe
2. ensure single instance of KeePassXC is enabled in Tools > Settings > Startup (otherwise enable it and restart portable from step 1)
3. launch second instance of KeePassXCPortable.exe
4. KeePassXC would NOT detect previous instance, and opens another separate instance

This shows that KeePassXCPortable is interfering with the KeePassXC single instance detection.

John T. Haller
John T. Haller's picture
Offline
Last seen: 9 hours 38 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
QLockFiles and TEMP

Looks like KeePassXC is using Qt's QLockFiles to track instances instead of standard Windows APIs for processes or CreateMutex. QLockFiles uses TEMP files to try to track processes instead. This gets messy when we're trying to keep an eye on any TEMP files that KeePassXC itself is leaving behind.

You can disable the TEMP containment by opening up the KeePassXCPortable.ini file within KeePassXCPortable\App\AppInfo\Launcher and adding the line CleanTemp=false to the end of the [Launch] section.

I'll need to figure out if this will leave anything behind and, if not, include this change in the next release.

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

hgtok
Offline
Last seen: 2 weeks 5 days ago
Joined: 2021-07-22 21:14
testing with TempForPortableApps

yes! single instance works with CleanTemp=false as you have suggested.

assuming testing using TempForPortableApps could address your concerns

  1. testing without CleanTemp=false shows this structure:
TempForPortableApps/
KeePassXCPortableTemp/
keepassxc-username.lock
nse6FBC.tmp/
launcher.ini (and files)

nse6FBB.tmp

  1. while testing with CleanTemp=false shows this structure
TempForPortableApps/
nse6FBC.tmp/
launcher.ini (and files)

keepassxc-username.lock

nse6FBB.tmp

both testing does not leave any files behind in TempForPortableApps

Log in or register to post comments