Page 2 of 2
Re: Problem with XYplorer's single-instance setting
Posted: 12 Feb 2018 11:20
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.
Re: Problem with XYplorer's single-instance setting
Posted: 12 Feb 2018 13:36
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
Re: Problem with XYplorer's single-instance setting
Posted: 12 Feb 2018 13:47
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.
Re: Problem with XYplorer's single-instance setting
Posted: 12 Feb 2018 13:49
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.
Re: Problem with XYplorer's single-instance setting
Posted: 12 Feb 2018 20:21
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.
Re: Problem with XYplorer's single-instance setting
Posted: 13 Feb 2018 01:40
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.
Re: Problem with XYplorer's single-instance setting
Posted: 13 Feb 2018 06:03
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!

Re: Problem with XYplorer's single-instance setting
Posted: 24 Feb 2018 11:05
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.