[GH-ISSUE #206] Allow multiple instances under different users #180

Closed
opened 2026-02-26 11:57:05 +03:00 by kerem · 7 comments
Owner

Originally created by @alishchytovych on GitHub (Feb 21, 2022).
Original GitHub issue: https://github.com/1Remote/1Remote/issues/206

Originally assigned to: @VShawn on GitHub.

Hello,

I can't run the app under multiple users on the same server. Is it possible to make the check on the per user?

github.com/VShawn/PRemoteM@c1be080afb/PRemoteM/App.xaml.cs (L215)

Originally created by @alishchytovych on GitHub (Feb 21, 2022). Original GitHub issue: https://github.com/1Remote/1Remote/issues/206 Originally assigned to: @VShawn on GitHub. Hello, I can't run the app under multiple users on the same server. Is it possible to make the check on the per user? https://github.com/VShawn/PRemoteM/blob/c1be080afbe451c23b53a2d059be6cf79ea272e8/PRemoteM/App.xaml.cs#L215
kerem 2026-02-26 11:57:05 +03:00
Author
Owner

@alishchytovych commented on GitHub (Feb 21, 2022):

Maybe this approach works for you:

static class Program {
	public static Mutex Single;
	public static string AppId = "966b1f20-1a74-1234-af60-7072a1d55678";

	static void Main(string[] args) {
		if (Mutex.TryOpenExisting(Program.AppId, out Single))
			return;
		try {
			Single = new(false, Program.AppId);
			... run ...
		} finally {
			Single.Close();
		}
	}
}
<!-- gh-comment-id:1046616927 --> @alishchytovych commented on GitHub (Feb 21, 2022): Maybe this approach works for you: ``` static class Program { public static Mutex Single; public static string AppId = "966b1f20-1a74-1234-af60-7072a1d55678"; static void Main(string[] args) { if (Mutex.TryOpenExisting(Program.AppId, out Single)) return; try { Single = new(false, Program.AppId); ... run ... } finally { Single.Close(); } } } ```
Author
Owner

@VShawn commented on GitHub (Feb 22, 2022):

Ahhh. I didn't consider multi-user situation, you reminded me.
I will find out how to make it work latter.

<!-- gh-comment-id:1047701581 --> @VShawn commented on GitHub (Feb 22, 2022): Ahhh. I didn't consider multi-user situation, you reminded me. I will find out how to make it work latter.
Author
Owner

@VShawn commented on GitHub (Feb 22, 2022):

There is a problem here. In portable app, If the two users edit data at same time , the db of the APP may crash.

<!-- gh-comment-id:1047727090 --> @VShawn commented on GitHub (Feb 22, 2022): There is a problem here. In portable app, If the two users edit data at same time , the db of the APP may crash.
Author
Owner

@majkinetor commented on GitHub (Feb 22, 2022):

There could be a setting where to keep db - program dir or user dir. Even with portable app, this setting could by default target User directory. PRM could also accept db via cmd line while at it.

<!-- gh-comment-id:1047729645 --> @majkinetor commented on GitHub (Feb 22, 2022): There could be a setting where to keep db - program dir or user dir. Even with portable app, this setting could by default target User directory. PRM could also accept db via cmd line while at it.
Author
Owner

@VShawn commented on GitHub (Feb 23, 2022):

image

it works, I just leave that conflict risk alone : )

<!-- gh-comment-id:1048573648 --> @VShawn commented on GitHub (Feb 23, 2022): ![image](https://user-images.githubusercontent.com/10143738/155288222-162d2d29-204c-43e3-b6c5-e2256cb1fad7.png) it works, I just leave that conflict risk alone : )
Author
Owner

@VShawn commented on GitHub (Feb 23, 2022):

@alishchytovych you can try this beta version.
0.6.2beta.zip

<!-- gh-comment-id:1048604562 --> @VShawn commented on GitHub (Feb 23, 2022): @alishchytovych you can try this beta version. [0.6.2beta.zip](https://github.com/VShawn/PRemoteM/files/8123253/0.6.2beta.zip)
Author
Owner

@alishchytovych commented on GitHub (Feb 26, 2022):

It works, thank you

<!-- gh-comment-id:1051917211 --> @alishchytovych commented on GitHub (Feb 26, 2022): It works, thank you
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/1Remote#180
No description provided.