Problem with XYplorer's single-instance setting

Things you’d like to miss in the future...
bossebengt
Posts: 16
Joined: 11 Feb 2018 18:36

Re: Problem with XYplorer's single-instance setting

Post by bossebengt »

Could you get back to me with which env vars are relevant for the single-instance mode? Maybe that will help me fix this.

highend
Posts: 13327
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Problem with XYplorer's single-instance setting

Post by highend »

No clue, can't replicate that behavior here. Compare all env vars and set them in the other environment to make them equal.
It musn't be a specific path, maybe it's enough that the environment differs. Again: Why do you get different env settings
from the OS?

Try this one in the meanwhile:
It automatically transforms the first parameter (if the passed file / folder really exists!) into a script command, like:

Code: Select all

"D:\XY_Single instance launcher" "<path to xyplorer.exe>" "%TEMP%"
to:

Code: Select all

"D:\XY_Single instance launcher" "<path to xyplorer.exe>" /script="::goto 'C:\Users\<username>\AppData\Local\Temp';" /flg=2
XY_Single instance launcher_v2018-02-12.zip
(63.84 KiB) Downloaded 71 times
One of my scripts helped you out? Please donate via Paypal

jupe
Posts: 2801
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Problem with XYplorer's single-instance setting

Post by jupe »

highend wrote:Why do you get different env settings from the OS?
Just a theory I'm throwing out there, the environment vars could be different because he seems to be loading it through a text editor so it may inherit the environment variables from Sublime/EMACs.

bossebengt
Posts: 16
Joined: 11 Feb 2018 18:36

Re: Problem with XYplorer's single-instance setting

Post by bossebengt »

I don't know why. This might be due to the internals of Emacs or Sublime.

I start cmd.exe, then launch Sublime/Emacs from that shell, then start XYplorer from Sublime/Emacs. Gives different env than starting from cmd.exe directly.

I'm content for now, I don't want to take more of your time. I would be happy if this could be solved in xyplorer.exe though, but no rush anymore. I bought it already due to your awesome support and product.

Marco
Posts: 2347
Joined: 27 Jun 2011 15:20

Re: Problem with XYplorer's single-instance setting

Post by Marco »

I know I'm not solving the problem but maybe I'm providing useful debug info for Don:

This behaviour doesn't seem influenced by calling XY with different priviliges. In fact, with the single-instance option, I can't launch both one regular and one elevated instance at the same time. This under W8.1 x64.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

klownboy
Posts: 4141
Joined: 28 Feb 2012 19:27

Re: Problem with XYplorer's single-instance setting

Post by klownboy »

jupe wrote:Just a theory I'm throwing out there, the environment vars could be different because he seems to be loading it through a text editor so it may inherit the environment variables from Sublime/EMACs.
You may be right about that jupe. We found out that this is definitley the case when starting XYplorer via AHK.
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

bossebengt
Posts: 16
Joined: 11 Feb 2018 18:36

Re: Problem with XYplorer's single-instance setting

Post by bossebengt »

klownboy wrote:
jupe wrote:Just a theory I'm throwing out there, the environment vars could be different because he seems to be loading it through a text editor so it may inherit the environment variables from Sublime/EMACs.
You may be right about that jupe. We found out that this is definitley the case when starting XYplorer via AHK.
But then again, I start Emacs from the same place, so Emacs should inherit its environment from cmd.exe anyhow.

I still have the issue. I don't want to spend too much time thinking about it - I'm super busy these days. As a software developer, the following things come to mind:

1. Is a mutex used to ensure single instances? (I would guess so since mutexes are kernel objects and running xy elevated doesn't get around single instance mode, according to some poster above)
2. What env vars are used in xy to manage instances? I guess I could post the env vars from the two different xy instances if that's of any help (I checked it myself and the only real differences seem to be a few %conemu...% vars, but if you think the env vars can affect the behavior, I'll post them)
3. It seems that xy starts a new instance if it can't grab a hold of the previous instance, NO MATTER THE SINGLE INSTANCE SETTING

Get back if I can do anything to help.

Oh and PS:

Your support is absolutely awesome! :biggrin: :appl:

admin
Site Admin
Posts: 60603
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Problem with XYplorer's single-instance setting

Post by admin »

FYI, all I do here is to check the (VB6) built-in App.Previnstance property right when an instance is started. It has its limitations (google it), but this thread is about the first time that it didn't do the job good enough for a user.

Indeed, using CreateMutex would be the way to go towards a more robust solution. I have currently other priorities, but this can be done later.

Post Reply