diff --git a/README.md b/README.md index a53c58c..d702fdc 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/uninstall.ps1 b/autoproxy-uninstall.ps1 similarity index 86% rename from uninstall.ps1 rename to autoproxy-uninstall.ps1 index c80f3ba..3d0f048 100644 --- a/uninstall.ps1 +++ b/autoproxy-uninstall.ps1 @@ -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) { @@ -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!" diff --git a/install.ps1 b/install.ps1 index bf479ed..ddfc440 100644 --- a/install.ps1 +++ b/install.ps1 @@ -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 @@ -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!"