Multiple Instances
Forum rules
When reporting a bug, please include the following information: your XYplorer version (e.g., v27.90.0047), your Windows version (e.g., Win 11), and your screen scaling percentage (e.g., 125%). We recommend adding your Windows version and screen scaling percentage to your profile or signature. This will make debugging much easier for us.
When reporting a bug, please include the following information: your XYplorer version (e.g., v27.90.0047), your Windows version (e.g., Win 11), and your screen scaling percentage (e.g., 125%). We recommend adding your Windows version and screen scaling percentage to your profile or signature. This will make debugging much easier for us.
Multiple Instances
No big deal and I doubt it would even be worth fixing, but for your info, "Startup & Exit | Allow multiple instances" does not seem to support multiple desktops. If this field is cleared I cannot start another instance on the same desktop, but can on another desktop.
Last edited by KenS on 09 Apr 2023 02:42, edited 1 time in total.
Re: Multiple Instances
So if a user makes a substantial number of changes to the settings, then exits (and saves) and does not notice there is another copy of XY running (and using the same settings) then when that copy closes (or even when Windows closes), all those changes made by the user are lost, without warning?
Would it be possible for the copy saving changes to broadcast a message to copies and if one is using the same settings, to either reload settings, or to issue a warning, either then or when that copy later closes?
Ken
-
admin
- Site Admin
- Posts: 64916
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Multiple Instances
substantial number of changes ... what kind of changes are these? You don't want to spread all changes across the instances (virtually everything in XY is stored and remembered across sessions). Then they all would end up identical twins. 
FAQ | XY News RSS | XY X
-
admin
- Site Admin
- Posts: 64916
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
-
klownboy
- Posts: 4397
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440
Re: Multiple Instances
Wouldn't you be better off starting the other instance(s) on other desktops with a different XYplorer.ini file (e.g., /ini=myini) especially if the instances were different in some specific ways? You should look at "Command Line Switches" in the Help file.
-
admin
- Site Admin
- Posts: 64916
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Multiple Instances
I will definitely consider this. Probably I'll go with the warning before saving, sth like "[filename] has been modified by another process. Should I overwrite it anyway?" ... I'm open to suggestions in logic, wording, and correct English.
Note that this has to been done for each data file (there are about a dozen), so there will be many warnings.
FAQ | XY News RSS | XY X
Re: Multiple Instances
Confused, I got the impression ("identical twins") that you didn't think this was a problem.admin wrote: ↑09 Apr 2023 15:57 I will definitely consider this. Probably I'll go with the warning before saving, sth like "[filename] has been modified by another process. Should I overwrite it anyway?" ... I'm open to suggestions in logic, wording, and correct English.
Note that this has to been done for each data file (there are about a dozen), so there will be many warnings.
Ok, I am obviously new here ... some thoughts ...
If XY instance makes changes and saves them, it notifies all other instances, informing what ini file it is using and a save has been done. Any other instance, if using the same ini file, prompts user:
(a) save now and overwrite
(b) exit without saving
(c) reload new settings
Need to be careful with (a) not to get into an infinite loop
Re: Multiple Instances
Yes, I have been thinking of running XY with different ini files, one for copying files from development to live, another for scanning backups, etc, but here I am thinking about two instances using the same settings.
Ken
-
klownboy
- Posts: 4397
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440
Re: Multiple Instances
You may have some situations where the use of XY's Edit: I had to run out, but the first else statement should kill a 2nd instance of XY if you are not currently in the 2nd instance (e.g., you are in the first instance and a 2nd instance exists). I don't know how or if this would work for multiple desktops though.
get("instance") may be of some help in scripting. This will determine if there are 2 instances of XY running and close the current instance if the current instance is the 2nd instance. For example:Code: Select all
if(runret("""cmd"" /c ""tasklist | find /I /C ""XYplorer.exe""""") >= 2) {
if(get("instance") == '2') {
exit "n"; end(1);}
else {
$PID = trim(gettoken(runret("""cmd"" /c ""for /F ""TOKENS=1,2,*"" %a in ('tasklist /nh /FI ""IMAGENAME eq XYplorer.exe""') do set MyPID=%b"""),-1, "=","t",2)," <crlf>", "LR");
run "cmd /c taskkill /PID $PID",,0,0; end(1);}
}
else {
if(exists(<curitem>) == '2') {bla, bla, bla...
Re: Multiple Instances
Thanks, will look at it ... I am not sure about multiple virtual desktops, at least the "real" ones, had a bit of a look and they seem more "isolated" then I had thought.
Ken
XYplorer Beta Club