From 522b498e3ca36fb1c4f84eb60ccf6b1ee4d45d44 Mon Sep 17 00:00:00 2001 From: seuyh <71027218+seuyh@users.noreply.github.com> Date: Wed, 13 May 2026 23:43:16 +0700 Subject: [PATCH] fix --- StellarisDLCUnlocker.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/StellarisDLCUnlocker.ps1 b/StellarisDLCUnlocker.ps1 index 29cc72f..f5b8a8d 100644 --- a/StellarisDLCUnlocker.ps1 +++ b/StellarisDLCUnlocker.ps1 @@ -1,5 +1,5 @@ #Requires -Version 5.1 -Set-StrictMode -Version Latest +Set-StrictMode -Version 5.1 $ErrorActionPreference = 'Stop' [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 Add-Type -AssemblyName PresentationFramework, PresentationCore, WindowsBase, System.Windows.Forms @@ -87,7 +87,8 @@ function Set-LangBuiltin([string]$lang) { } function Find-SteamPath { foreach ($h in 'HKCU:\Software\Valve\Steam','HKLM:\SOFTWARE\Valve\Steam','HKLM:\SOFTWARE\WOW6432Node\Valve\Steam') { - $v = (Get-ItemProperty $h -ErrorAction SilentlyContinue)?.SteamPath + $prop = Get-ItemProperty $h -ErrorAction SilentlyContinue + $v = if ($null -ne $prop) { $prop.SteamPath } else { $null } if ($v -and (Test-Path $v)) { return $v } } foreach ($d in "$env:ProgramFiles(x86)\Steam","$env:ProgramFiles\Steam") { if (Test-Path $d) { return $d } } @@ -766,4 +767,4 @@ $installBtn.Add_Click({ }) [void]$window.ShowDialog() -$drainTimer.Stop() \ No newline at end of file +$drainTimer.Stop()