This 'framework' should be used to 'install' an application on a Windows system. 'Install' is in quotes because this framework was constructed to create installation packages for applications that don't have traditional MSI or EXE installers.
Creation of VS Code installation package: https://medium.com/@abuddenb/source-file-installation-framework-using-the-powershell-app-deployment-toolkit-19af4fde4b58
A slightly more involved example, which includes dependencies and shows a 'user' installation.
Creation of HandBrake installation package: https://medium.com/@abuddenb/psadt-install-framework-with-dependency-walkthrough-handbrake-99b78734e007
The framework performs a few basic tasks:
- Copies source folder/files to target location on Windows system
- Creates system-wide Desktop and Start Menu shortcuts that point to application executable
- Creates entry in Windows registry to make application 'visible' through Apps & Features
- Compiles uninstall-Application.exe, cited in the registry entry's Uninstallstring, that will wipe source files and shortcuts from system
This is the most basic usage of this system - no dependencies are required for VS Code, and the walkthrough shows a 'system' installation.
Creation of VS Code installation package: https://medium.com/@abuddenb/source-file-installation-framework-using-the-powershell-app-deployment-toolkit-19af4fde4b58
A slightly more involved example, which includes dependencies and shows a 'user' installation.
Creation of HandBrake installation package: https://medium.com/@abuddenb/psadt-install-framework-with-dependency-walkthrough-handbrake-99b78734e007
HandBrake requires Microsoft .NET Runtime 8.0, so the article listed above also covers how to respond to dependency-related prompts from the configuration script.
Execute the repository's configuration script to set up the directory structure and filenames for your deployment.
Powershell.exe -ExecutionPolicy Bypass ./replace.ps1
This system supports two types of installations: 'user' or 'system'. The difference between the two types is that in addition to copying application files to single location on target system, a 'user' installation will also copy the application files to current and future users' home directories.
The entire deployment can be configured through replace.ps1. The script creates a list of 'dependency objects' that it will check for and install before dealing with the main application files.
Each dependency object has the following properties:
- File: the exact filename of the dependency's installer.
- AppName: the Display Name of the dependency after it has been installed on a system.*
- Silent Switches: arguments to pass to installer so it executes silently.
*Replace.ps1 also offers a mechanism to query the Windows registry for the Display Name of a dependency. This comes in handy if the dependency is already installed on the system from which you are creating the deployment package.
The deployment script uses the PS2EXE Powershell module to compile an executable that removes application source files, shortcuts, and scheduled tasks from the system.
The executable is compiled and stored in: C:\WINDOWS\SysWow64\AppName\uninstall-AppName.exe