mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-15 22:01:23 -06:00
[GH-ISSUE #961] Plea to Developer: Portable barrier #772
Labels
No labels
HiDPI
bounty
bsd/freebsd
bsd/openbsd
bug
bug
build-infra
cantfix
critical
doc
duplicate
enhancement
fix-available
from git
from release
good first issue
help wanted
installer/package
invalid
linux
macOS
meta
needs testing
pull-request
query
question
regression
regression
v2.4.0
windows
wontfix
work-in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/barrier#772
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @NikoMuffin on GitHub (Nov 28, 2020).
Original GitHub issue: https://github.com/debauchee/barrier/issues/961
Hello,
I've noticed Barrier stores its settings in multiple folders. This is my #1 request for this beautiful & useful software.
Settings are stored in:
C:\Program Files\Barrier
C:\Users\user\AppData\Local\Barrier
C:\ProgramData\Barrier
Is it possible implement the -portable command argument so that I can run Barrier from another directory and all settings get stored in the program directory? Pretty please?
D:\Applications\Barrier
@ArmandoRl1 commented on GitHub (Dec 1, 2020):
This would be wonderful to have
@albertony commented on GitHub (Dec 4, 2020):
I agree, an easy to use, official portable mode would be nice! Combined with a zip distribution for copy-deploy.
If you can manage with just the command line editions (barriers.exe and barrierc.exe), I think it is possible already:
--profile-dir <path>.--profile-dir D:\Applications\Barrier.D:\Applications\Barrier\barriers.exe --profile-dir D:\Applications\Barrier --no-daemon --no-tray --enable-crypto%LocalAppdata%\Barrier.barrier.sgcand put it in the configured--profile-dir, it will be picked up automatically. Alternatively you can set a custom path to configuration file with argument--config.From what I can see, nothing will be written to outside of the configured profile-dir!
If you want a minimal, copy-install, command-line-only deploy, you only need the following files, which you can copy from an existing installation, or extract from .exe installer using innounp:
Due to dependency to OpenSSL, used for encryption (argument
--enable-crypto), you need these files in addition (originally thought these were not needed unless using--enable-crypto, but found out they are a "hard" dependency):Optionally, if you want to be able to generate certificate, you also need these (on the server):
You will need the Microsoft Visual C++ Redistributable for Visual Studio 2019 installed, although it is possible to copy-install
msvcp140.dll,vcruntime140.dllandvcruntime140_1.dllinto the application directory.If you want to use encryption, you can generate certificate and fingerprint in a SSL directory structure the same way as the GUI application does, like this:
Edit: I realize
--profile-diris undocumented. Not listed in--helpoutput, nor mentioned in wiki. That should be a small first step, I think.@NikoMuffin commented on GitHub (Dec 5, 2020):
@albertony thank you! I discovered this just yesterday and appreciate the summary.
I want to ask if the dev can make a "-portable" command argument that would do all this automatically. That would be wonderful.
@NikoMuffin commented on GitHub (Dec 5, 2020):
@albertony unfortunately neither command works and it's a triple whammy.
This is what I used:
D:\Applications\Barrier\barrier.exe --profile-dir "D:\Applications\Barrier\settings"
I got a folder created in:
C:\Users\Nightcrawler\AppData\Local\Barrier
C:\Users\Nightcrawler\AppData\Local\Barrier\SSL
C:\Users\Nightcrawler\AppData\Local\Barrier\SSL\Fingerprints
and nothing I do stops Barrier from creating registry entries:
HKEY_CURRENT_USER\Software\Debauchee\Barrier
HKEY_LOCAL_MACHINE\SOFTWARE\Barrier
@albertony commented on GitHub (Dec 5, 2020):
You are probably running the full GUI application? I haven't tried that myself, as I wanted to use it as a portable application from the start. Running the command line applications only, I don't get any of those folders or registry entries. But ok, if so, you have confirmed my suspicion that it does not work with that one.
Then, unfortunately, you will have to use the command line versions: barriers.exe (server) and barrierc.exe (client), and create a text file with configuration for the server as described here https://github.com/debauchee/barrier/wiki/Command-Line#server-configuration-file. If you want to try this and have more questions, just ask.
@setushah1 commented on GitHub (Apr 25, 2022):
I did this so far -
Downloaded BarrierSetup-2.4.0-release
Downloaded innounp
Extracted all files from BarrierSetup-2.4.0-release using innounp
Created a new folder D:\Temp\base and copied barriers.exe, barrierc.exe, ssleay32.dll, libeay32.dll to the base folder (though libeay32.dll was not necessary)
created barrier.sgc in the base folder
Configured barrier.sgc as -
section: screens
Thinkpad:
Dell:
end
section: links
Thinkpad:
right = Dell
Dell:
left = Thinkpad
end
section: aliases
PC13F21F:
Thinkpad
DESKTOP-IEBI2GF:
Dell
end
Issued this command -
barriers --profile-dir .\It creates this error -
[2022-04-25T21:33:21] ERROR: cannot read configuration ".\barrier.sgc": read error: line 12: unknown screen name "PC13F21F"
barriers: no configuration available
Executed
hostnameon command prompt. It gave the same name - PC13F21FTried searching about this error but couldn't find any reference in context for portable/command line execution.
@albertony commented on GitHub (Apr 25, 2022):
If you surround your configuration snippet with three ` (backticks) its easier to read (assuming you have some indentation in it), like this:
I'm not very familiar with aliases... maybe you can try without it, use the real names directly?
@setushah1 commented on GitHub (Apr 25, 2022):
Yes, the file is indented the way you have done.
As per your suggestion I have removed real names and recreated the file -
Then executed it with
barriers --profile-dir .\ --disable-crypto --debug DEBUG2On client side, I could install with installer. And executed the GUI and configured as Client. On client, when I use the name of the server - PC13F21F, the server doesnt recognize it. But if I use IP - 192.168.1.7 then the connection becomes successful. However, the mouse still doesn't move to the client.
@albertony commented on GitHub (Apr 26, 2022):
Try to make the server listen for IPv6 in addition to IPv4 by adding argument
--address "::".If that does not work, I'm not sure what is going on. Maybe try this:
@shinji257 commented on GitHub (Mar 9, 2023):
Similar to above I did the following. I have no admin rights on the target client system.
Copied in barrierc.exe, libssleay32.dll, libeay32.dll from another Windows install. Launched it with the following command (I'm not using SSL in my network)
barrierc --disable-crypto --exit-pause 10.0.0.160--exit-pause isn't really needed but I got it in a batch file. Just wanted it pause in case there was an issue. You do not need barrier.exe or barriers.exe if it is just going to be a client. You also do not need any of the QT libraries (they are for barrier.exe).
@nigerninja commented on GitHub (Jul 23, 2023):
Works like a charm. Thanks.
@pgyogesh commented on GitHub (Nov 4, 2023):
@shinji257 I tried this but getting below error:
The system cannot execute the specified program@igalech commented on GitHub (Nov 11, 2023):
I've followed this options in a Win11 machine where I don't have admin rights. After copying .pem and .cfg files and recreating the SSL directory barrierc.exe <I.P.ADDR.ESS> does work.
Now I'm facing an odd issue. This runs in a CMD (powershell or cmd) window in win11 in the foreground where you can see all the logging from barrierc. Certain apps that take foreground (e.g. notepad++) automatically disable barrier, while others don't (e.g. FF, Chrome, even notepad.exe, etc.) Not sure why.
@shinji257 can you post instructions for how to run this in a batch file/job and have the client running 'silently' in the background?
@shinji257 commented on GitHub (Nov 11, 2023):
@pgyogesh
If this is a work machine then your IT is likely implementing a policy to restrict which executables can be run.
@igalech
Sorry. I run it rather verbose so I don't know how I might run it 'silently'.
@igalech commented on GitHub (Nov 11, 2023):
@shinji257
Thanks.
By silenced I meant running it via conhost, powershell or similar, but without an actual console in the foregruond (like nohup or &). After some digging I've managed to put together a bat file and run barrierc at startup with your list of files and configuration instructions plus the certificates and it runs almost ok.
I thought that was the issue, but I was wrong. Most of the apps from W11 that runs barrierc are responsive to barriers that runs in a central ubuntu box. However, when some apps start in W11 they leave barrierc unresponsive despite still running fine - I can see barrierc in taskmanager and barriers is not complaining (log says entering screen of W11 box). I've made the process realtime and changed process to run in admin mode to no avail. Examples: Windows task manager, notepad++.