Skip to content

Commit

Permalink
Fixed update check and added NuGet auto-install.
Browse files Browse the repository at this point in the history
  • Loading branch information
Apocrypher00 committed Jan 20, 2025
1 parent f35c3e6 commit 1015218
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
20 changes: 16 additions & 4 deletions KillPopper.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Future versions may ignore "Player Downed", but I haven't figured out how to differentiate them yet.
.VERSION
1.2.0
1.2.1
.AUTHOR
Apocrypher00
Expand All @@ -39,8 +39,8 @@ Write-Host "Gallery folder is '$GalleryPath'"
$SplashPath = "C:\Program Files (x86)\Steam\steamapps\common\Hunt Showdown\EasyAntiCheat\SplashScreen.png"
Write-Host "Splash screen is at '$SplashPath'"

$CurrentVersion = "1.2.0"
$RepoURL = "https://github.com/Apocrypher00/KillPopper/blob/master"
$CurrentVersion = "1.2.1"
$RepoURL = "https://raw.githubusercontent.com/Apocrypher00/KillPopper/master"
# $ScriptURL = "$RepoURL/KillPopper.ps1"
$VersionFileURL = "$RepoURL/version.txt"

Expand Down Expand Up @@ -89,6 +89,18 @@ try {
Wait-Exit "Failed to start transcript!"
}

# Check if NuGet is installed
if (-not (Get-PackageProvider -Name "NuGet" -ListAvailable -ErrorAction SilentlyContinue)) {
Write-Warning "NuGet not installed. Installing..."
try {
Install-PackageProvider -Name "NuGet" -Scope CurrentUser -Force
} catch {
Wait-Exit "Failed to install NuGet!" $_
}
} else {
Write-Host "NuGet is already installed."
}

# Check if the BurntToast module is installed
if (-not (Get-InstalledModule -Name "BurntToast" -ErrorAction SilentlyContinue)) {
Write-Warning "BurntToast not installed. Installing..."
Expand Down Expand Up @@ -130,7 +142,7 @@ try {
$LatestVersion = Invoke-WebRequest -Uri $VersionFileURL -UseBasicParsing | Select-Object -ExpandProperty Content
$LatestVersion = $LatestVersion.Trim()

if ($CurrentVersion -ne $LatestVersion) {
if ($LatestVersion -gt $CurrentVersion) {
Write-Warning "New version available: $LatestVersion!"
# Write-Host "Updating script..."

Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ This is especially helpful when other players die to your traps on the other sid
## Requirements
GeForce Experience (for v1.1+), or NVIDIA App (for v1.2+)
PowerShell 5+ (PowerShell 5 is pre-installed on Windows)
BurntToast PowerShell module (should be installed the first time the script runs)
BurntToast PowerShell Module (should be installed the first time the script runs)
NuGet PowerShell Package Provider (should be installed the first time the script runs)

## Getting Started
Download the latest release and unzip the files to a new folder, then just double click the shortcut with the green arrow before playing.
The script will run in the background and monitor for new clips.
The script will tell you if any errors occurr by displaying them in the console and by logging everything to the logs folder.

Note that if the script has trouble installing BurntToast, you may have to run it as admin the first time.
Make sure that notifications are enabled and you don't have "Do Not Disturb" turned on while in-game.
The current version of KillPopper doesn't distinguish between kill clips and down clips, so you will have to disable "Player downed" highlights if you don't want notifications to appear when you die.
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.0
1.2.1

0 comments on commit 1015218

Please sign in to comment.