From 8bde2f3be37902fc58c80e84da02465185512aa9 Mon Sep 17 00:00:00 2001 From: psyirius Date: Wed, 21 Aug 2024 03:31:44 -0700 Subject: [PATCH] compat fixes --- scripts/launcher.ps1 | 4 +++- scripts/start.ps1 | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/launcher.ps1 b/scripts/launcher.ps1 index 477ecef8..6f7d7eaa 100644 --- a/scripts/launcher.ps1 +++ b/scripts/launcher.ps1 @@ -85,7 +85,9 @@ param( $url = if (-not $Preview) { # This must be pointing to the latest stable release (Chris-Hosted) - "https://christitus.com/win/stable" + # FIXME: change me to the below url and host me here + "https://christitus.com/win" + # "https://christitus.com/win/stable" } else { # This must be pointing to the latest pre-release or the release (GitHub releases) Get-Latest-PreRelease-Url diff --git a/scripts/start.ps1 b/scripts/start.ps1 index f2db5613..d1469141 100644 --- a/scripts/start.ps1 +++ b/scripts/start.ps1 @@ -16,8 +16,10 @@ param ( # Run as administrator if not already (only for script on disk, not in memory) if (-not ([Security.Principal.WindowsPrincipal]([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { + $MyScriptPath = $MyInvocation.PSCommandPath + # If script not on disk, show error message and quit - if (-not $MyInvocation.MyCommand.Source) { + if (-not $MyScriptPath) { Write-Host "===========================================" -Foregroundcolor Red Write-Host "-- Scripts must be run as Administrator ---" -Foregroundcolor Red Write-Host "-- Right-Click Start -> Terminal(Admin) ---" -Foregroundcolor Red @@ -37,7 +39,7 @@ param ( $PwshArgList = @( "-NoLogo", # Don't print PowerShell header in CLI "-NoProfile", # Don't load PowerShell profile - "-File", $MyInvocation.MyCommand.Source, # Script path + "-File", $MyScriptPath, # Script path $args | ForEach-Object { $_ } # Script arguments )