Add warning if running MS Store installer from outside sandbox

pull/2/head
ThioJoe 2025-08-05 11:11:48 -07:00
parent f258cea768
commit c7bf484659
No known key found for this signature in database
GPG Key ID: 2E328FE64CC3898C
1 changed files with 9 additions and 1 deletions

View File

@ -4,7 +4,7 @@
# Author: ThioJoe
# Repo Url: https://github.com/ThioJoe/Windows-Sandbox-Tools
# Last Updated: August 4, 2025
# Last Updated: August 5, 2025
param(
# Optional switch to output the generated XML files to the working directory
@ -25,6 +25,14 @@ $currentBranch = "ge_release" # "rs_prerelease" for insider, "ni_release" f
# flightRing should be "Internal" if flightingBranchName is "MSIT"
# MAYBE need flightRing as "External" if setting flightingBranchName anything besides empty or MSIT?
# ------ Check that we're running in the Windows Sandbox ------
# This script is intended to be run from within the Windows Sandbox. Warn the user if not. We'll do a rudamentary check for if the current user is named "WDAGUtilityAccount"
if ($env:USERNAME -ne "WDAGUtilityAccount") {
Write-Warning "`nThis script is intended to be run from WITHIN the Windows Sandbox.`nRunning it outside the Sandbox will just install the MS Store to the current system."
Write-host "`nPress Enter to continue installing to the current system anyway, or just close this window to exit." -ForegroundColor Yellow
Read-Host
}
# --- Define Working Directory ---
# Get the path to the user's personal Downloads folder in a reliable way
$userDownloadsFolder = (New-Object -ComObject Shell.Application).Namespace('shell:Downloads').Self.Path