# ------------
# Load Config
# ----------------
# Get the parent folder of the currently running script
$ProjectRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)

# Check if "scripts\config" exists
$ScriptConfigPath1up = Join-Path $ProjectRoot "scripts\config"
$ScriptConfigPath2up = Join-Path $ProjectRoot "config"

if (Test-Path $ScriptConfigPath1up) {
    # If Scripts\Config exists
    $ConfigFile = Join-Path $ScriptConfigPath1up "config.ps1"
} elseif (Test-Path $ScriptConfigPath2up) {
    # If \Config exists
    $ConfigFile = Join-Path $ScriptConfigPath2up "config.ps1"
} else {
    throw "Could not find Config.ps1!"
}

# Dot-source the config
. $ConfigFile

$ConfigPath = Split-Path -Parent $ConfigFile
$Script  = Split-Path $PSCommandPath -Leaf

# Disable QuickEdit for this session
. "$ConfigPath\DisableConsoleQuickEdit.ps1"
Set-QuickEdit -DisableQuickEdit
cls

# --------------------
# Display Main Banner
# ------------------------
Write-Host ""
Write-Host "============================================================" -ForegroundColor DarkGray
Write-Host " RMTechCentral Automation Scripts (v$($ReleaseInfo.Version))" -ForegroundColor Cyan

switch ($Global:ReleaseInfo.Channel) {
    'Internal' {
        Write-Host " Internal Use Only" -ForegroundColor Yellow
    }
    'Public' {
        Write-Host " Public Release" -ForegroundColor Green
    }
    default {
        Write-Host " Release Channel: $($Global:ReleaseInfo.Channel)" -ForegroundColor DarkYellow
    }
}

Write-Host "============================================================" -ForegroundColor DarkGray
Write-Host " Author:  $($RMTechMeta.Author)" -ForegroundColor Gray
Write-Host " Website: $($RMTechMeta.Website)" -ForegroundColor Gray
Write-Host " Purpose: $($RMTechMeta.Purpose)" -ForegroundColor Gray
Write-Host "============================================================" -ForegroundColor DarkGray
Write-Host ""

# Small delay so user can read
Start-Sleep -Seconds 2
Write-Host "Loaded config from: $ConfigFile" -ForegroundColor Green
Write-Host ""
Write-Host ""

# Small delay so user can read
Start-Sleep -Seconds 3
# Display Pending Operation
Write-Host "===========================================" -ForegroundColor DarkGray
Write-Host " Operation: Display paths for all variables" -ForegroundColor DarkGreen
Write-Host "===========================================" -ForegroundColor DarkGray
Write-Host ""

# Small delay so user can read
Start-Sleep -Seconds 3

# -----------
# Run Script
# ---------------
Write-Host ""

Write-Host "ConfigPath" -ForegroundColor Cyan
Write-Host "----------"
Write-Host Config Directory:"---------------->" $ConfigPath
Write-Host ""

Write-Host "Paths.AppxBundlesRoot" -ForegroundColor Cyan
Write-Host "---------------------"
Write-Host AppX Bundles:"-------------------->" $Paths.AppxBundlesRoot
Write-Host ""

Write-Host "Paths.WIMSourceRoot" -ForegroundColor Cyan
Write-Host "-------------------"
Write-Host Install.wim Source:"-------------->" $Paths.WIMSourceRoot
Write-Host ""

Write-Host "Paths.WIMMountRoot" -ForegroundColor Cyan
Write-Host "------------------"
Write-Host Install.wim Mount:"--------------->" $Paths.WIMMountRoot
Write-Host ""

Write-Host "Paths.WIMPersistent" -ForegroundColor Cyan
Write-Host "-----------------"
Write-Host WIM Persistent:"------------------>" $Paths.WIMPersistent
Write-Host ""

Write-Host "Paths.WIMSkeleton" -ForegroundColor Cyan
Write-Host "-----------------"
Write-Host WIM Skeleton:"-------------------->" $Paths.WIMSkeleton
Write-Host ""

Write-Host "Paths.GoldISOSource" -ForegroundColor Cyan
Write-Host "-------------------"
Write-Host Gold ISO Source:"----------------->" $Paths.GoldISOSource
Write-Host ""

Write-Host "Paths.ISOExtracted" -ForegroundColor Cyan
Write-Host ISO Source:"---------------------->" $Paths.ISOSources
Write-Host ""

Write-Host "Paths.ISOExtracted" -ForegroundColor Cyan
Write-Host "------------------"
Write-Host ISO Extracted:"------------------->" $Paths.ISOExtracted
Write-Host ""

Write-Host "Paths.ISOCompiled" -ForegroundColor Cyan
Write-Host "-----------------"
Write-Host ISO Compiled:"-------------------->" $Paths.ISOCompiled
Write-Host ""

Write-Host "Paths.ISOPersistent" -ForegroundColor Cyan
Write-Host "-----------------"
Write-Host ISO Persistent:"------------------>" $Paths.ISOPersistent
Write-Host ""

Write-Host "Paths.ISOSkeleton" -ForegroundColor Cyan
Write-Host "-----------------"
Write-Host ISO Skeleton:"-------------------->" $Paths.ISOSkeleton
Write-Host ""

Write-Host "WIM.SourceInstallWIM" -ForegroundColor Cyan
Write-Host "--------------------"
Write-Host Install.wim Copy-source:"--------->" $WIM.SourceInstallWIM
Write-Host ""

Write-Host "WIM.DestInstallWIM" -ForegroundColor Cyan
Write-Host "------------------"
Write-Host Install.wim Copy-destination:"---->" $WIM.DestInstallWIM
Write-Host ""

Write-Host "Paths.OscdimgRoot" -ForegroundColor Cyan
Write-Host "-----------------"
Write-Host Oscdimg:"------------------------->" $Paths.OscdimgRoot
Write-Host ""

Write-Host "ISO.OutputISO" -ForegroundColor Cyan
Write-Host "-------------"
Write-Host ISO Output Name:"----------------->" $ISO.OutputISO
Write-Host ""

Write-Host "ISO.BootEtfs" -ForegroundColor Cyan
Write-Host "------------"
Write-Host BootEtfs:"------------------------>" $ISO.BootEtfs
Write-Host ""

Write-Host "ISO.BootEfi" -ForegroundColor Cyan
Write-Host "-----------"
Write-Host BootEfi"-------------------------->" $ISO.BootEfi

Write-Host ""
Write-Host ""

pause