From 7f4ec40a9153cb23a472fb0be59fce1e5b36fe80 Mon Sep 17 00:00:00 2001 From: Chris Payne Date: Tue, 8 Jul 2025 19:45:02 -0400 Subject: [PATCH] Fix path issue --- main.ps1 | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/main.ps1 b/main.ps1 index 711de23..f054bf9 100644 --- a/main.ps1 +++ b/main.ps1 @@ -25,6 +25,13 @@ $xamlUrl = "https://git.svstools.com/cpayne/InstaClientPS/raw/branch/main/layout try { $xamlContent = Invoke-WebRequest -Uri $xamlUrl -UseBasicParsing -ErrorAction Stop [xml]$xaml = $xamlContent.Content + $reader = (New-Object System.Xml.XmlNodeReader $xaml) + $window = [Windows.Markup.XamlReader]::Load($reader) + if (-not $window) { + Write-Host "[ERROR] Failed to load XAML window." + exit 1 +} +Write-Host "[INFO] WPF window loaded." Write-Host "[INFO] XAML loaded from remote URL." } catch { Write-Host ("[ERROR] Failed to load XAML from {0}: {1}" -f $xamlUrl, $_.Exception.Message) @@ -51,16 +58,6 @@ Add-Type -AssemblyName PresentationCore Add-Type -AssemblyName WindowsBase Add-Type -AssemblyName System.Xaml -# Load WPF XAML UI -[xml]$xaml = Get-Content "$PSScriptRoot\InstaProvision.xaml" -$reader = (New-Object System.Xml.XmlNodeReader $xaml) -$window = [Windows.Markup.XamlReader]::Load($reader) -if (-not $window) { - Write-Host "[ERROR] Failed to load XAML window." - exit 1 -} -Write-Host "[INFO] WPF window loaded." - # Map named UI controls $CompanyNameBox = $window.FindName("CompanyNameBox") $PhoneBox = $window.FindName("PhoneBox")