Skip to content
This repository has been archived by the owner on Mar 1, 2020. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: erik434/PiaManager
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0
Choose a base ref
...
head repository: erik434/PiaManager
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jan 28, 2018

  1. Added support for newer versions of PIA where the ruby files are put …

    …under src\bin instead of just src.
    erik434 committed Jan 28, 2018
    Copy the full SHA
    20c058f View commit details

Commits on Feb 27, 2020

  1. Copy the full SHA
    e1366eb View commit details
Showing with 18 additions and 4 deletions.
  1. +15 −3 PIA_manager/Program.cs
  2. +3 −1 README.md
18 changes: 15 additions & 3 deletions PIA_manager/Program.cs
Original file line number Diff line number Diff line change
@@ -107,10 +107,22 @@ private static void FindPiaFiles()
Console.WriteLine($"Ruby files directory: {rubyFilesDir}");

rubyExecutable = Path.Combine(rubyFilesDir, "bin", "rubyw.exe");
rubySourceFile = Path.Combine(rubyFilesDir, "src", "pia_manager.rb");

if (!File.Exists(rubyExecutable)) throw new FileNotFoundException("Could not find ruby executable", rubyExecutable);
if (!File.Exists(rubySourceFile)) throw new FileNotFoundException("Could not find pia_manager ruby file", rubySourceFile);

var rubySourceFileOld = Path.Combine(rubyFilesDir, "src", "pia_manager.rb");
var rubySourceFileNew = Path.Combine(rubyFilesDir, "src", "bin", "pia_manager.rb");
if (File.Exists(rubySourceFileOld))
{
rubySourceFile = rubySourceFileOld;
}
else if (File.Exists(rubySourceFileNew))
{
rubySourceFile = rubySourceFileNew;
}
else
{
throw new FileNotFoundException("Could not find pia_manager ruby file", rubySourceFile);
}
}

static bool DirContainsPiaFiles(string searchDir)
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## Note: this program is no longer necessary with the modern PIA app, but I'm leaving this project up in case it's still useful to someone.

# Purpose
Every time the PIA VPN starts, it deploys some Ruby files to a random temp directory and then launches those. The random path prevents it from being whitelisted by firewalls. This program helps to run PIA from a fixed location so it can be whitelisted in firewalls.

@@ -11,4 +13,4 @@ Every time the PIA VPN starts, it deploys some Ruby files to a random temp direc
# Usage
Calling this program with no arguments will have it first kill any existing PIA processes and then start up PIA using the fixed `pia_ruby_files` location. If you had PIA set to automatically start with Windows before, that should continue to work - it will call `pia_manager.exe` with no arguments and PIA should start up as usual, but from this fixed path.

If you call `pia_manager.exe` with the `--stop` argument, it will just kill any existing PIA processes. This may be useful for automation applications to give you a way to start/stop PIA at will.
If you call `pia_manager.exe` with the `--stop` argument, it will just kill any existing PIA processes. This may be useful for automation applications to give you a way to start/stop PIA at will.