Loading...

Test your installation in Windows Sandbox with just one click


In this post I will show you how to test easily and quickly your PS1, EXE, MSI, installer with just one click.

Context
You wrote a PS1 script that allows you to install an application like Github Desktop, Microsoft Deployment Toolkit with ADK or something else.
Before to deploy it in your company, for instance with Configuration Manager, you want to test it quickly.
For that you can test if of course on your computer.
You can also use the great feature Windows Sandbox.
This one allows you to run a virtualized environment of your OS.

What do I want ?
In this post i will test two applications:
- GitHub Desktop
- TeamViewer

For both applications I will test a silent install (from a PS1) and a basic one from installer (EXE and msi).

Test faster than your shadow
Some months ago I wrote a script that allows you to create some new context menus with a right-click on PS1, MSI, EXE and VBS files.
See my post here.

For instance if you do a right-click on a PS1, two new context menus are available:
- Run the PS1 in Sandbox
- Run the PS1 in Sandbox with parameters

See the overview:


Or with a MSI for instance:


Run the PS1 in Sandbox
When you select this option it will proceed as below:
1. Launch Windows Sandbox
2. Add the current drive in your Windows Sandbox with all content (files and directories)
3. Run the selected PS1 from the current folder

Run the PS1 in Sandbox with parameters
When you select this option it will proceed as below:
1. Open a GUI that allows you to add parameters to your PS1
2. Launch Windows Sandbox
3. Add the current drive in your Windows Sandbox with all content (files and directories)
4. Run the selected PS1 with parameters from the current folder

Run EXE or MSI
When you select this option it will proceed as below:
1. Do a right-click on the EXE or MSI file
2. Select for instance Run the MSI in Sandbox
3. A GUI will be launched
4. This allows you to add a silent switch to your installer
5. Click on the Close button or the + button if you added a switch
6. Windows Sandbox will be launched
7. Application installer will be launched with silent mode if a switch has been added

Tests in action

Install with silent install script
In the below example I will install GitHub Desktop.
I wrote a simple PS1 that installs silently the application.
1. Do a right-click on the PS1
2. Select Run the PS1 in Sandbox
2. Windows Sandbox will be launched
3. Installation sources folder is mapped to the desktop
4. Silent install script is launched in background
5. Application is installed

See below the process in action:


Install from sources 
In the below example, I install TeamViewer from the EXE.
1. Do a right-click on the PS1 file
2. Select Run the EXE in Sandbox
3. A GUI will be launched
4. Click on the Close button
3. Windows Sandbox will be launched
4. Application installer will be launched with no silent mode
5. Application asks you to continue the process

See below the process in action:


Install from sources silently
In the below example, I install TeamViewer silently from the EXE.
1. Do a right-click on the EXE file
2. Select Run the EXE in Sandbox
3. A GUI will be launched
4. Type silent installation switches to install the application silently
5. Here silent switch is /S
6. Windows Sandbox will be launched
7. Application installer will be installed silently

See below the process in action:

Windows_Sandbox 1938205720320653882

Publier un commentaire

Accueil item

Award

Mes articles en français

Author of Books

PowerShell GUI & WPF Group

PowerShell GUI & WPF Group

Join the FPSUGR

Join the FPSUGR

Stats