Saturday, July 5, 2025

Trying a refined Sandbox post

 

Testing Software Installation with Windows Sandbox

What This Guide Is About

This guide shows you how to safely test software installations using Windows Sandbox - a feature that creates a temporary, isolated copy of Windows on your computer. Think of it as a practice area where you can install programs without affecting your main system.

We'll be using a tool called Winget (Windows Package Manager) to automatically install multiple programs simultaneously, which is significantly faster than downloading and installing each program individually.

Important Notes Before Starting

Different versions of Windows behave differently with Sandbox. If something doesn't work as described, it might be due to your Windows version.

Windows 11 24H2 users: You'll need to add --source winget to the commands because the Microsoft Store isn't accessible in Sandbox. This means you can't install apps that are only available through the Store.

Step 1: Enable Windows Sandbox

  1. Press the Windows key
  2. Type "features"
  3. Click "Turn Windows features on or off"
  4. Check the box next to "Windows Sandbox"
  5. Restart your computer when prompted

Helpful tip: You can copy and paste text between Sandbox and your main computer, but you can't drag and drop files.

Step 2: Create the Necessary Folders

Open Command Prompt and create these folders on your main computer:

mkdir C:\Sandbox
mkdir C:\Sandbox\winget_install

The C:\Sandbox folder will be shared with your Sandbox environment, and winget_install will contain the installation files.

Step 3: Download Required Files

You'll need to download three files from the Microsoft Winget GitHub page:

* 1 & 2 are a single zip file. Open the 64 folder and extract the two files.

  1. Microsoft.VCLibs file (a dependency)
  2. Microsoft.UI.Xaml file (a dependency)
  3. Microsoft.DesktopAppInstaller file (the main Winget installer)

Place all three files in your C:\Sandbox\winget_install folder.

Step 4: Create Configuration Files

Basic Sandbox Configuration

Create a file called Sandbox.wsb with this content:

<Configuration>
  <MappedFolders>
    <MappedFolder>
      <HostFolder>C:\Sandbox</HostFolder>
      <ReadOnly>false</ReadOnly>
    </MappedFolder>
  </MappedFolders>
</Configuration>

This tells Sandbox to share your C:\Sandbox folder.

Advanced Configuration (Auto-Install)

For automatic installation when Sandbox starts, use this version instead:

<Configuration>
    <MappedFolders>
        <MappedFolder>
            <HostFolder>C:\Sandbox</HostFolder>
            <SandboxFolder>C:\Users\WDAGUtilityAccount\Desktop\Sandbox</SandboxFolder>
            <ReadOnly>false</ReadOnly>
        </MappedFolder>
    </MappedFolders>
    <LogonCommand>
        <Command>powershell.exe -ExecutionPolicy Bypass -NoExit -File "C:\Users\WDAGUtilityAccount\Desktop\Sandbox\winget_install\install.ps1"</Command>
    </LogonCommand>
</Configuration>

This automatically runs the installation script when Sandbox starts.

Step 5: Create Installation Scripts

install.cmd (Simple Launcher)

Create install.cmd in your C:\Sandbox\winget_install folder:

powershell.exe -ExecutionPolicy Bypass -File install.ps1

install.ps1 (Main Installation Script)

Create install.ps1 in your C:\Sandbox\winget_install folder:

# Install required dependencies
Add-AppxPackage "C:\Users\WDAGUtilityAccount\Desktop\Sandbox\winget_install\Microsoft.VCLibs.140.00.UWPDesktop_14.0.33728.0_x64.appx"
Add-AppxPackage "C:\Users\WDAGUtilityAccount\Desktop\Sandbox\winget_install\Microsoft.UI.Xaml.2.8_8.2310.30001.0_x64.appx"
Add-AppxPackage "C:\Users\WDAGUtilityAccount\Desktop\Sandbox\winget_install\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"

# Wait for winget to be ready
Start-Sleep -Seconds 10

# Remove Microsoft Store source to avoid errors
winget source remove msstore

# Install programs
winget install -e --id Notepad++.Notepad++ --accept-source-agreements --accept-package-agreements --force
winget install -e --id 7zip.7zip --accept-source-agreements --accept-package-agreements --force

What This Does

When you run the Sandbox with these configurations:

  1. Creates a safe testing environment - Nothing you do in Sandbox affects your main computer
  2. Automatically installs Winget - Sets up the package manager in the isolated environment
  3. Tests software installation - Installs Notepad++ and 7-Zip as examples
  4. Validates your setup - If programs install successfully in Sandbox, they should work on your real computer

Why This Is Useful

  • Safety first - Test potentially problematic software without risk
  • Batch testing - Try installing multiple programs at once
  • Clean environment - Start fresh each time without leftover files
  • Time saving - Automate repetitive installation tasks

Getting Started

  1. Enable Windows Sandbox
  2. Create the folder structure
  3. Download the required files
  4. Create the configuration and script files
  5. Double-click your Sandbox.wsb file to start

Your Sandbox will open and automatically begin installing the test programs. If everything works, you should be able to continue testing and manipulating other software and scripts.


Here are a couple of scripts I use on new PC setups. They should test successfully on your new Sandbox.

my_install.cmd for further reference (Place this in C:\Sandbox)
I use it on all new system setups, Sandbox was only an experiment. 🤣
If it installs on Sandbox, it will install on hardware.
    Remove the : for non-Sandbox installs.

cd %userprofile%\Desktop
mkdir C:\Portable\Excluded
mkdir C:\Drivers\Benchmarks
mkdir C:\Desk
mkdir %userprofile%\Pictures\Wallpaper
mkdir %userprofile%\\Program Archives
:winget install -e --id=Microsoft.VCRedist.2015+.x64
winget install -e --id=Microsoft.VCRedist.2015+.x86
:winget install -e --id=Chocolatey.Chocolatey
winget install -e --id 7zip.7zip
:winget install -e --id=Notepad++.Notepad++
::UnigetUI
winget install -e --id=MartiCliment.UniGetUI
winget install -e --id=winaero.tweaker
::Wintoys
winget install -e  --accept-source-agreements --accept-package-agreements --id=9P8LTPGCBZXD
winget install -e --id=RevoUninstaller.RevoUninstaller
winget install -e --id=CodeJelly.Launchy
winget install -e --silent --id=IObit.IObitUnlocker
::TranslucentTB
winget install -e --accept-source-agreements --accept-package-agreements --id=9PF4KZ2VN4W9
winget install -e --silent --id=2BrightSparks.SyncBackFree

winget install -e --silent --id=AOMEI.Backupper.Standard
winget install -e --id=AutoHotkey.AutoHotkey
winget install -e --id=voidtools.Everything
:winget install -e --id=AdrienAllard.FileConverter
winget install -e --id=Brave.Brave
winget install -e --id=HexChat.HexChat
winget install -e --id=IrfanSkiljan.IrfanView
winget install -e --id=IrfanSkiljan.IrfanView.PlugIns
winget install -e --id=Microsoft.PowerToys
winget install -e --id=qBittorrent.qBittorrent
winget install -e --id=ShareX.ShareX
:winget install -e --id=Oracle.VirtualBox
winget install -e --id=VideoLAN.VLC

curl.exe -L https://eternallybored.org/misc/wget/1.21.4/64/wget.exe -o C:\Windows\System32\wget.exe
curl.exe -L https://www.ugmfree.it/Download/SyMenu/SyMenu.zip -o C:\Portable\symenu.zip
curl.exe -L https://www.carifred.com/uvk/UVKPortable.exe -o C:\Portable\UVK.exe
curl.exe -L https://www.sordum.org/files/download/defender-exclusion-tool/ExcTool.zip -o C:\Portable\Excluded\ExcTool.zip
curl.exe -L https://downloads.wisecleaner.com/soft/WDCFree_11.1.6.832.zip -o C:\Portable\WDCFree.zip
curl.exe -L https://windows-repair-toolbox.com/files/Windows_Repair_Toolbox.zip -o C:\Portable\Windows_Repair_Toolbox.zip

msg * "irm christitus.com/win | iex"
pause

Separate Extract_Delete.cmd
    No big deal. I just wanted to do it. Manual extract is fast and easy.
    Answer "A" to the first request and all will continue without interruption.

"C:\Program Files\7-Zip\7z.exe" e "C:\Portable\Excluded\ExcTool.zip" -o"C:\Portable\Excluded\ExcTool" && del C:\Portable\Excluded\ExcTool.zip"

"C:\Program Files\7-Zip\7z.exe" e "C:\Portable\Windows_Repair_Toolbox.zip" -o"C:\Portable\Windows_Repair_Toolbox" && del "C:\Portable\Windows_Repair_Toolbox.zip"

"C:\Program Files\7-Zip\7z.exe" e "C:\Portable\symenu.zip" -o"C:\Portable\Symenu" && del "C:\Portable\symenu.zip"

"C:\Program Files\7-Zip\7z.exe" e "C:\Portable\WDCFree.zip" -o"C:\Portable\WDCFree" && del "C:\Portable\WDCFree.zip"

Trying a refined Sandbox post

  Testing Software Installation with Windows Sandbox What This Guide Is About This guide shows you how to safely test software installati...