m.miloch.dev ← PSADT v4 — Your First PackageCourse
Lesson 1 of 625 minFree course

What enterprise software packaging is

Why organisations wrap vendor installers in packages, what silent installation and reproducibility mean in practice, where a package sits in the application lifecycle, and where PSADT fits between the installer and the deployment tool.

In this lesson
  • Explain the difference between an installer, a package and a deployment
  • Describe what a silent, reproducible installation requires
  • Name the phases of the application lifecycle and where packaging sits in it
  • Place PSADT correctly next to Configuration Manager and Intune
  • Run and log a silent MSI installation by hand on a test VM

A vendor ships an installer. An organisation needs that installer to run on hundreds or thousands of devices, at a time it chooses, without anyone clicking through a wizard, and with a record of what happened on each device. Enterprise software packaging is the work that closes the gap between the two. This lesson defines the terms the rest of the course relies on and ends with a first silent installation on the test VM.

Installer, package, deployment

Three terms are often used interchangeably. They describe different things.

TermWhat it isExample
InstallerThe setup file the vendor ships7z2606-x64.msi
PackageThe installer plus everything needed to install, configure, uninstall and log it the same way every timeA PSADT folder with the MSI in Files\ and a wrapper script
DeploymentThe act of delivering a package to a set of devices on a scheduleA Configuration Manager deployment to a pilot collection, an Intune assignment to a group

A package is therefore the unit of work of a packager. It is built once, tested once per change, and then handed to a deployment tool that runs it many times.

Why packaging exists

Without a shared standard, every administrator solves the same problems in a different way: one writes a batch file, another a PowerShell script, a third installs by hand and fixes the rest with Group Policy. Six months later nobody can say which version was installed with which options on which device, or whether the installation finished at all.

A standard package format addresses this in a few concrete ways:

  • Consistency. Every package has the same structure and the same logging, regardless of who built it.
  • Control. The packager decides what happens before, during and after the installation: which components are installed, whether auto-update is disabled, whether a running application is closed first.
  • Traceability. The package writes a log file on the device: PSADT functions log their actions automatically, and custom script steps are logged with Write-ADTLogEntry. When something fails, the cause can be read rather than guessed.
  • Maintainability. A colleague can open a package built by someone else and find the same sections in the same places.

Not every installer needs a framework. A plain MSI that installs without any extra steps can be deployed with a single msiexec command line. A framework such as PSADT pays off when a package has to do more than that: close processes, inform a user, set registry values, clean up after the vendor, or run several steps in a fixed order.

Silent installation

A deployment tool runs installers without a person in front of the screen. A device-wide installation runs in system context (Install for system in Configuration Manager, install behavior System in Intune), that is, as the local SYSTEM account, often while nobody is signed in. An installer that waits for someone to click Next waits until the deployment tool's time limit runs out; Intune, for example, fails the installation after the Installation time required (60 minutes by default). Microsoft states plainly that applications deployed through Intune "must install silently". A package therefore starts from an installer that can run silently: with no user interface, or with no interface that requires input.

For Windows Installer packages (.msi), the command-line options are standardised and documented on Microsoft Learn in the msiexec reference and the Windows Installer command-line options. The options are not case-sensitive, so /L*V and /l*v are the same.

SwitchMeaning
/i <package>Normal installation
/x <package or product code>Uninstall
/qnNo user interface
/norestartNever restart the device after the installation; equivalent to the property REBOOT=ReallySuppress
/L*V <file>Log all information plus verbose output; only the extra debugging flag x is left out

Two details are easy to miss:

  • /qn alone may restart the device. For /quiet, the standard form of /qn, Microsoft notes that without a restart option the installer "restarts the computer whenever necessary without displaying any prompt or warning". /norestart belongs on every silent command line.
  • The log folder must exist. msiexec does not create the folder for the log file. If it is missing, msiexec fails with exit code 1622, "There was an error opening installation log file".

msiexec reports its result as an exit code. Windows Installer defines three codes as success: 0 (completed), 3010 (a restart is required to complete the installation) and 1641 (the installer has started a restart). Every other code is a failure; the Windows Installer error codes page lists them. Lesson 5 explains the codes a packager meets most often.

EXE installers have no common standard. Every installer framework uses its own switches, and some installers cannot run silently at all. That topic is covered in the advanced course; this course stays with MSI.

Reproducibility

A package is reproducible when the same package, run on two identical devices, produces the same result, and when the result can be explained from the package alone. Three habits make this possible:

  1. A clean test system. A test VM with a checkpoint taken on a clean, updated state. Before each test, the VM is reverted. On a used workstation it is never certain whether an installation succeeded because the package is correct or because a runtime was already present.
  2. A fixed source. The installer file is stored with the package, not downloaded at install time, and its file hash is recorded. If the download source publishes a checksum, it is compared before packaging; if not, the recorded hash at least proves later which file was tested.
  3. Written notes. A short text file per package version: where the installer came from, which switches were used, what was tested, and what was decided. The next person who touches the package depends on it.

The exercises in this course use two machines. The packaging machine PKG01 holds the PSADT module, the tools, the source files and the notes; packages are built there. The test VM CL01 is used only for tests, and every test starts from a checkpoint. Checkpoints are named after the lesson: psadt-L<n>-start before the exercise of lesson n, psadt-L<n>-end after it. When a lesson's start checkpoint does not exist yet, it is created from the end checkpoint of the previous lesson.

The application lifecycle

Packaging is one phase in a longer lifecycle. A technically correct package is still a problem if no licence was checked beforehand or if it goes to every device at once without a pilot. There is no single binding standard for the phases; organisations name and cut them differently. A common model looks like this:

PhaseFocus
RequestWho needs the software, and approval
EvaluationLicences, compatibility, security, existing alternatives
PackagingHow the software is installed, configured, detected and removed
TestingInstallation, uninstallation and function on a clean system
PilotBehaviour on a small group of real devices and users
RolloutStaged delivery to the rest of the estate
MonitoringSuccess rate, error codes, help desk feedback
MaintenanceNew versions, security updates, supersedence
RetirementPlanned removal and documentation

This course covers packaging and local testing in detail and the handover to the deployment tool in overview. Pilot, rollout and monitoring belong to the deployment tool and are mentioned only where they influence the package.

Where PSADT fits

The PSAppDeployToolkit (PSADT) is an open-source PowerShell framework that, in the words of its introduction, is "typically used to wrap an existing vendor-supplied installer package". It is not a deployment tool and does not compete with Configuration Manager or Intune:

  • PSADT describes the package: how the software is installed, configured, logged and removed.
  • Configuration Manager and Intune deliver the package: when and where it runs, and how the result is reported.

What PSADT does not do: it does not deliver content to devices, schedule installations, choose target devices, evaluate the deployment tool's detection rules or report results to a management console. Those remain the deployment tool's job. PSADT also does not make an installer silent that has no silent mode; it can only call the installer's own options.

A PSADT package is a folder. It contains the vendor installer, a wrapper script with fixed sections for each phase, a copy of the PSADT module, configuration and text files, and a small launcher executable. The deployment tool calls the launcher with a command line such as Invoke-AppDeployToolkit.exe -DeploymentType Install -DeployMode Silent. Lesson 2 walks through the folder in detail.

From CMD to PowerShell to PSADT

The same task, installing an MSI and keeping a log, looks different in each generation of tooling. The comparison shows what a framework adds.

CMD / batch:

bat
REM Silent MSI installation with a verbose log, no automatic restart
REM msiexec does not create the log folder, so create it first
if not exist "C:\Logs" mkdir "C:\Logs"
msiexec /i "7z2606-x64.msi" /qn /norestart /L*V "C:\Logs\7zip_install.log"

These lines are enough for a simple MSI. They do not check whether the application is running, do not interpret the exit code, and every package author chooses a different log location.

PowerShell without a framework:

powershell
# Saved as a script next to the MSI: close a running instance, install silently, evaluate the exit code
Get-Process -Name '7zFM' -ErrorAction SilentlyContinue | Stop-Process -Force

New-Item -Path 'C:\Logs' -ItemType Directory -Force | Out-Null
$msiArgs = '/i "{0}" /qn /norestart /L*V "{1}"' -f "$PSScriptRoot\7z2606-x64.msi", 'C:\Logs\7zip_install.log'
$result = Start-Process -FilePath 'msiexec.exe' -ArgumentList $msiArgs -Wait -PassThru

if ($result.ExitCode -notin 0, 1641, 3010) {
    Write-Error "MSI installation failed with exit code $($result.ExitCode)"
    exit $result.ExitCode
}

Start-Process returns immediately by default. -Wait makes it wait until msiexec and its child processes have finished, and -PassThru returns the process object whose ExitCode is checked. This is more complete, but every package repeats the same logic in its own way, and closing a process without warning the user is not acceptable on a device someone is working on.

PSADT 4.1:

powershell
# Inside the Install phase of Invoke-AppDeployToolkit.ps1
Show-ADTInstallationWelcome -CloseProcesses @{ Name = '7zFM'; Description = '7-Zip File Manager' } -CloseProcessesCountdown 600
Start-ADTMsiProcess -Action Install -FilePath '7z2606-x64.msi'

Show-ADTInstallationWelcome checks whether the 7-Zip File Manager is running. If it is, the dialog asks the user to close it and closes it automatically when the countdown of 600 seconds ends. When the deployment runs in Silent or NonInteractive mode, or when no user is signed in, the same call closes the process without a dialog.

Start-ADTMsiProcess looks for the MSI in the package's Files\ folder when only a file name is given. It builds the msiexec command line from the defaults in Config\config.psd1: REBOOT=ReallySuppress /QN, which is the property form of /norestart plus /qn, and the logging options /L*V. It writes the MSI log to the same folder as the PSADT log and compares the exit code with the success and reboot codes of the package. The PSADT snippet does not run on its own; it belongs inside the wrapper script that lesson 2 introduces. In the template, the list of processes to close comes from AppProcessesToClose (lesson 4).

Note
The PSADT functions in this course all carry the ADT prefix, for example Start-ADTMsiProcess. Older scripts use PSADT 3.x names such as Execute-MSI. In 4.1, those names exist only as wrappers for the v3 compatibility mode, which runs an unchanged Deploy-Application.ps1; they are not used here.

Common mistakes

SymptomCauseFix
msiexec returns 1619, "This installation package couldn't be opened"Wrong path or file name of the MSICheck the path with Test-Path and correct the command line
msiexec returns 1622, "There was an error opening installation log file"The log folder does not exist; msiexec does not create itCreate the folder (here C:\Lab\Logs\) before the installation
msiexec returns 1618, "Another installation is already in progress"Windows Update or another installer is runningWait until the other installation has finished and repeat the command
msiexec returns 1603, "A fatal error occurred during installation"An action inside the MSI failedRead the MSI log from the first Return value 3 upwards (lesson 5)
The device restarts without warning after a silent installation/qn without a restart option: the installer "restarts the computer whenever necessary"Add /norestart to every silent command line

Try it

This exercise proves that the 7-Zip MSI installs silently by itself. A packager runs this test before writing any wrapper code: if the raw installer does not behave under /qn, no wrapper will fix it. Microsoft states the same prerequisite for Intune: Win32 apps "must be able to install without user interaction", and installers are checked for silent support before they are packaged (Prepare Win32 app content).

  1. On the Hyper-V host, apply the checkpoint psadt-L1-start of CL01 and start the VM if it is off: Restore-VMCheckpoint -Name psadt-L1-start -VMName CL01 -Confirm:$false. After a production checkpoint, the default type in Hyper-V, is applied, the VM is off. If CL01 has no checkpoint yet, take it now on the freshly installed and updated VM: Checkpoint-VM -Name CL01 -SnapshotName psadt-L1-start. Other hypervisors: the equivalent snapshot. Lesson 3 covers checkpoints in detail. Sign in to CL01 with an administrator account. Expected: CL01 runs in the clean, updated state. Check: Get-VMCheckpoint -VMName CL01 on the host lists psadt-L1-start.

  2. On PKG01, download the current 64-bit MSI from 7-zip.org to the folder C:\Lab\Source. On 2026-11-30 this is 7-Zip 26.06, file 7z2606-x64.msi. If a newer version is listed, use it and adjust the file name in all commands. The download page lists the EXE installer first; this course uses the MSI because Windows Installer provides what deployment tools build on: a product code, standard silent and logging switches, and documented return codes. The MSI link on 7-zip.org points to the GitHub release of the project, and GitHub shows a SHA-256 digest next to each release asset. Note that value for step 4. Expected: the MSI is on PKG01 and the GitHub digest is noted. Check: Test-Path -Path 'C:\Lab\Source\7z2606-x64.msi' returns True.

  3. Copy the MSI to C:\Lab\Source\ on CL01 and create the folder C:\Lab\Logs\. Expected: both paths exist on CL01. Check: Test-Path -Path 'C:\Lab\Source\7z2606-x64.msi', 'C:\Lab\Logs' returns True twice.

  4. On CL01, open Windows PowerShell as administrator and record the file hash. Compare it with the digest from the GitHub release page; Get-FileHash prints the hash in upper case, GitHub in lower case, and the comparison ignores case:

    powershell
    # Record the SHA-256 hash of the installer for the package notes
    Get-FileHash -Path 'C:\Lab\Source\7z2606-x64.msi' -Algorithm SHA256 |
        Format-List -Property Algorithm, Hash, Path

    Expected: the hash matches the GitHub digest. Check: (Get-FileHash -Path 'C:\Lab\Source\7z2606-x64.msi' -Algorithm SHA256).Hash -eq '<digest from GitHub>' returns True; the -eq operator compares strings without regard to case.

  5. Run the silent installation and capture the exit code. C:\Lab\Logs\ must exist from step 3, because msiexec does not create the log folder:

    powershell
    # Raw silent MSI installation with a verbose log
    $msiArgs = '/i "C:\Lab\Source\7z2606-x64.msi" /qn /norestart /L*V "C:\Lab\Logs\7zip-raw-install.log"'
    $result = Start-Process -FilePath 'msiexec.exe' -ArgumentList $msiArgs -Wait -PassThru
    "msiexec exit code: $($result.ExitCode)"

    Expected: msiexec exit code: 0. Any other code points to a cause listed under Common mistakes.

  6. Confirm the installation from the uninstall registry:

    powershell
    # List 7-Zip entries in the machine-wide uninstall registry (64-bit and 32-bit views)
    Get-ChildItem -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall',
                        'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall' |
        Get-ItemProperty |
        Where-Object { $_.DisplayName -like '7-Zip*' } |
        Select-Object -Property PSChildName, DisplayName, DisplayVersion, Publisher

    Expected: one entry for 7-Zip whose PSChildName is a GUID in braces: the MSI product code.

  7. Search the MSI log for failed actions:

    powershell
    # A failed action is logged as "Return value 3" (English-language Windows)
    Select-String -Path 'C:\Lab\Logs\7zip-raw-install.log' -Pattern 'Return value 3'

    Expected: no output. The string Return value 3 is written in the language of the operating system; on a localised Windows installation, the search needs the translated text.

  8. On PKG01, write C:\Lab\Notes.md with four lines: source URL, file name, SHA-256 hash, exit code of the raw installation. The notes do not belong on CL01, because the next step reverts it and everything written there is lost. Expected: the notes hold the four values. Check: Get-Content -Path 'C:\Lab\Notes.md' on PKG01.

  9. On the host, revert CL01 to psadt-L1-start, then take the checkpoint psadt-L1-end: Checkpoint-VM -Name CL01 -SnapshotName psadt-L1-end. Other hypervisors: the equivalent snapshot. Expected: CL01 is clean again; lesson 2 starts from this state. Check: Get-VMCheckpoint -VMName CL01 lists psadt-L1-start and psadt-L1-end.

Check your understanding

  1. What is the difference between a package and a deployment?
Answer

A package is the installer plus everything needed to install, configure, log and uninstall it the same way every time. A deployment is the delivery of that package to a set of devices, on a schedule, by a tool such as Configuration Manager or Intune.

  1. Why is a test VM with a checkpoint preferred over a normal workstation for packaging tests?
Answer

On a used workstation, prerequisites or older versions may already be present, so a successful installation proves little. A VM reverted to a clean checkpoint before every test gives the same starting point each time, which makes results reproducible.

  1. Which msiexec switches produce a silent installation with a full verbose log and no automatic restart?
Answer

/qn for no user interface, /norestart to suppress the restart, and /L*V <logfile> for a log with all information including verbose output. The folder of the log file must already exist.

  1. An msiexec installation returns 3010. Did it succeed?
Answer

Yes. Windows Installer defines 0, 3010 and 1641 as success. 3010 means that a restart is required to complete the installation; with /norestart, the restart is left to the deployment tool or the user.

  1. Where does PSADT sit relative to Configuration Manager and Intune?
Answer

PSADT defines the package: how the software is installed, configured, logged and removed. Configuration Manager and Intune are the delivery tools that decide when and where the package runs and report the result. They complement each other; PSADT does not replace either.

  1. In the lifecycle model of this lesson, which phase comes directly before and directly after packaging, and which phases belong to the deployment tool rather than to the package?
Answer

Evaluation comes before packaging and testing after it. Pilot, rollout and monitoring belong to the deployment tool; the package influences them only through its behaviour, for example its exit codes and logs. The model is one common way to cut the lifecycle, not a binding standard.

Summary

  • An installer is the vendor's file, a package wraps it into a repeatable unit, and a deployment delivers that unit to devices.
  • Deployment tools run installers without user input, in system context as SYSTEM, so every package starts from an installer that runs silently.
  • A silent MSI command line needs /qn, /norestart and /L*V to an existing folder; 0, 3010 and 1641 are the success codes.
  • Reproducibility rests on a clean test VM, a fixed and hashed source file, and written package notes.
  • Packaging is one phase of the application lifecycle, between evaluation and testing.
  • PSADT builds the package; Configuration Manager and Intune deliver it.

Sources

Next: Lesson 2: The structure of a PSADT v4 package

Download the one-pager for this lesson (PDF, 106 KB) ↓