Skip to content

Commit

Permalink
Updates install and uninstall scripts for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
SaahilNotSahil committed Aug 31, 2023
1 parent 68329b1 commit 35a10ee
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
# IITJ Autoproxy (v0.1.0)
# IITJ Autoproxy (v0.1.1)

A CLI tool to automatically login to IIT Jodhpur's network firewall.

#### (Currently only supports Linux)
#### (Currently only supports Windows and Linux)

### Installation

#### Windows:

- Download the latest release from [here](https://github.com/XanderWatson/iitj-autoproxy/releases).
- Unzip the file and open a powershell instance with administrator privileges in the unzipped directory:
- Run the following script to install autoproxy:

```
.\install.ps1
```

This will install the autoproxy CLI and daemon in "C:\Program Files\IITJ Autoproxy\" and also add it to the PATH environmment variable.

#### Debian-based Linux Distributions:
- Run the following commands to install the package:

Expand Down
7 changes: 6 additions & 1 deletion uninstall.ps1 → autoproxy-uninstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdenti
# Define directories
$installDir = "C:\Program Files\IITJ Autoproxy"
$configInstallDir = "C:\ProgramData\IITJ Autoproxy"
$homeDir = $env:USERPROFILE

# Remove binaries
if (Test-Path $installDir) {
Expand All @@ -21,9 +22,13 @@ if (Test-Path $configInstallDir) {
Remove-Item -Path $configInstallDir -Force
}

if (Test-Path $homeDir) {
Remove-Item -Path "$homeDir\.autoproxy.*" -Force
}

# Remove from PATH environment variable
$envPath = [Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine)
$newEnvPath = ($envPath.Split(';') | Where-Object { $_ -ne $installDir }) -join ';'
[Environment]::SetEnvironmentVariable("Path", $newEnvPath, [EnvironmentVariableTarget]::Machine)

Write-Host "Uninstallation completed successfully!"
Write-Host "Uninstallation of IITJ Autoproxy completed successfully!"
4 changes: 2 additions & 2 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if (-Not (Test-Path $configInstallDir)) {

# Copy binaries
Copy-Item -Path "$binDir\*" -Destination $installDir -Force
Copy-Item -Path "$configDir\uninstall.ps1" -Destination $installDir -Force
Copy-Item -Path "$configDir\autoproxy-uninstall.ps1" -Destination $installDir -Force

# Copy example config, README, and LICENSE to config folder
Copy-Item -Path "$configDir\autoproxy.config" -Destination $configInstallDir -Force
Expand All @@ -35,4 +35,4 @@ if (-Not ($envPath -like "*$installDir*")) {
[Environment]::SetEnvironmentVariable("Path", $envPath + ";$installDir", [EnvironmentVariableTarget]::Machine)
}

Write-Host "Installation completed successfully!"
Write-Host "Installation of IITJ Autoproxy completed successfully!"

0 comments on commit 35a10ee

Please sign in to comment.