Testing desktop applications

How to test installation, updates and data migration

A user cannot reach a desktop application’s features if installation or updating fails. A green installer status does not establish that settings, services and data were preserved. The test should verify the complete transition to a usable new version.

Separate clean installation, updating an existing application and data migration into distinct checks. They may run within one user procedure, but a failure needs to identify which part caused it.

Build a matrix of supported paths

First define the target release and supported source versions. Some allow direct upgrades, while others require an intermediate step. An unsupported jump should produce the agreed rejection and leave the original state usable.

Add environment conditions: supported Windows version and architecture, per-user or machine-wide installation, permissions, language, data location and dependencies. Identify online activation or component downloads separately where the process uses them. Select combinations by support and risk rather than trying to cover every historical configuration.

Path Initial state Important outcome
Clean installation Supported system without the application Correct components, services and first launch
Routine update Latest supported version with reference data New version, preserved settings and usable data
Older supported path Specified version, with any intermediate step Correct migration sequence completed
Rejected path Unsupported version or missing permission Clear rejection without data damage
Uninstall and reinstall Installed application with data Agreed removal or retention of components

Every test must start from a known state

Restore a virtual-machine snapshot or prepare a dedicated environment. Installing an old version on a computer that retains newer libraries or configuration is insufficient. That machine may hide a missing dependency.

The snapshot should match the specified system and version. Populate reference data reproducibly and record expected values. Use a clean state for installation and a genuinely installed supported version for updating. A file with a renamed version number does not substitute for it.

Use synthetic or approved anonymised data. A migration test should not operate on the only copy of a production database. Address licences, activation and dependency access beforehand so their failures do not obscure the installation result.

Separate unattended operation from the user wizard

A command-line interface suits repeated package checks. Microsoft documents msiexec options for unattended installation, restart control and logging. These concern Windows Installer, not every setup.exe. Use the wrapper installer’s own documented parameters where applicable.

Unattended operation does not verify wizard wording, directory selection or understandable errors. Keep separate UI scenarios for the user journey. Use Windows UI Automation for supported controls. Verify control availability and elevated-window behaviour on the actual runner. Fixed coordinates may stop matching controls after resolution or layout changes, as explained in Why desktop tests should not rely on coordinates and images.

Exit codes and restarts are only part of the result

Wait for the relevant installation processes to finish, rather than just the first window closing. Capture the exit code and log. With Windows Installer, for example, 0 means success, 3010 means success requiring a restart and 1641 means a restart has already been initiated. Microsoft lists these code meanings. Non-zero codes cannot all be treated as the same failure.

If the test controls a restart, save its run identifier and last confirmed step beforehand. After the machine returns, verify completion, application version, components and service state. Suppressing a restart does not remove its necessity. Check the application even when no restart is requested.

For a running older version or locked file, verify the agreed behaviour: a request to close, deferred replacement or rejection. The test should not arbitrarily terminate a user’s unfinished work unless that is part of the supported procedure.

Counting rows is insufficient for migration

Record counts can remain unchanged when values or relationships are lost. Prepare small reference data sets with different states: an empty optional field, a historical record, diacritics, longer text and a relationship between objects. Define the expected transformation from the product’s migration rules.

Model example: the older version contains customer C-104 and two orders referencing that customer. After migration, verify the customer’s identity, both relationships, agreed values and opening an order in the application. Three existing rows alone do not confirm correct migration.

Check the schema version, preserved settings and work with both new and migrated records. If migration intentionally changes a format or adds a default value, the test should expect that change. A byte-identical file may not be the correct result.

Installer rollback does not restore all data

Distinguish recovery from a failed installation, supported application downgrade and restoration from backup. Each has its own prerequisites. Windows Installer provides rollback by default, but it can be disabled and custom actions require correctly designed recovery. Do not assume this automatically reverses an external database migration.

In an isolated environment, test controlled failures appropriate to the installer’s design, such as an unavailable dependency or insufficient disk space. Verify the resulting state and whether installation can resume or safely start again. Treat a backup as usable only after a verified restoration and data check.

An older application may not understand the new schema. If downgrade is unsupported, expect a clear rejection and documented recovery procedure. Restoring binaries alone does not restore the earlier data format.

Uninstalling, diagnostics and recurring runs

Agree what uninstalling should remove and retain. User data must not be deleted merely to make the next installation clean. Check services, automatic startup, application registration and reinstallation according to the product contract.

On failure, retain source and target versions, package identity, system, upgrade path, exit code, log and failed data check. Remove sensitive values before sharing the report. The record should distinguish package, migration, activation and test-environment failures.

Run selected paths on dedicated runners when the installer changes, overnight or before release. Isolate concurrent runs. One successful path does not cover the supported matrix, so label results with the verified combinations.

Next step

Choose one supported upgrade path and two or three representative data sets. Automate preparation, installation, any restart and checks of specific values and a working user journey. Expand the matrix once results are repeatable and failures provide useful diagnostics.

Related topics

You might also be interested in

Desktop doesn't have to mean manual testing

Stable, repeatable automated testing for Windows and Electron desktop applications.