Customizing the Installer UI
Relevant source files
The following files were used as context for generating this wiki page:The PeP Exam App installer is built using Inno Setup 6, providing a robust and customizable installation experience for end-users. The build system is managed via a PowerShell script, which automates the process of publishing the .NET application and compiling the final installer executable. Customization primarily involves replacing graphical assets and modifying the Inno Setup script (PeP.ExamApp.iss) for branding and code signing.
This document outlines the process for building the installer, customizing its visual appearance, and configuring related features like code signing and the auto-update mechanism. The installer supports various features, including silent installation, desktop shortcuts, and clean uninstallation.
Installer Build System
The installer generation is handled by the build-installer.ps1 script, which orchestrates the .NET publish process and the Inno Setup compiler.
Sources: PeP.ExamApp/Installer/README.md, PeP.ExamApp/Installer/build-installer.ps1
Prerequisites
Before building the installer, the following software must be installed:
- Inno Setup 6: The core compiler for the installer script.
- .NET 8 SDK: Required to publish the PeP Exam App itself.
Sources: PeP.ExamApp/Installer/README.md:5-7
Build Process
The build process is initiated by running the build-installer.ps1 script with a specified version. The script performs several steps to produce the final installer executable and its checksum file.
The following diagram illustrates the workflow of the build-installer.ps1 script.
Build Commands
The installer can be built using various command-line options to control the process.
| Command | Description |
|---|---|
.\build-installer.ps1 -Version "1.2.3" | Builds the installer for version 1.2.3. |
.\build-installer.ps1 -Version "1.2.3" -SkipPublish | Skips the dotnet publish step and uses existing published files. |
.\build-installer.ps1 -Version "1.2.3" -SkipInstaller | Only publishes the application, skipping the Inno Setup compilation. |
.\build-installer.ps1 -Version "1.2.3" -Configuration Debug | Builds the application using the Debug configuration. |
Sources: PeP.ExamApp/Installer/README.md:14-25, PeP.ExamApp/Installer/build-installer.ps1:8-13
UI Customization
The visual appearance of the installer wizard can be customized by replacing specific image files located in the PeP.ExamApp/Installer/ directory.
Sources: PeP.ExamApp/Installer/README.md:46-49
Wizard Images
To change the branding of the installer, create and place the following bitmap files in the Installer folder.
| Filename | Dimensions (pixels) | Description |
|---|---|---|
WizardImage.bmp | 164x314 | The main image displayed on the left panel of the wizard. |
WizardSmallImage.bmp | 55x58 | The smaller image shown in the top-right corner of the wizard. |
Sources: PeP.ExamApp/Installer/README.md:47-49
Code Signing
For production releases, it is recommended to sign the installer executable to improve security and user trust. This is configured within the PeP.ExamApp.iss script.
To enable signing, uncomment the SignTool directive in the script and configure it with your code signing certificate details.
SignTool=signtool sign /tr http://timestamp.digicert.com /td sha256 /fd sha256 /a $f
Sources: PeP.ExamApp/Installer/README.md:51-55
Silent Installation
The installer supports silent installation, which is crucial for automated deployments and the in-app update process. The UpdateService uses the /SILENT /RESTARTAPPLICATIONS flags to install updates seamlessly.
Sources: PeP.ExamApp/Installer/README.md:31-33, PeP.ExamApp/Services/UpdateService.cs:122-123
Silent Install Commands
The following commands can be used to run the installer without user interaction.
| Command | Description |
|---|---|
Setup.exe /SILENT | Runs the installer with a minimal progress window. |
Setup.exe /VERYSILENT | Runs the installer with no visible UI. |
Setup.exe /SILENT /DIR="C:\Path" | Installs the application to a custom directory silently. |
Setup.exe /SILENT /RESTARTAPPLICATIONS | Silently installs and automatically restarts the application if it's running. |
Sources: PeP.ExamApp/Installer/README.md:35-44
Auto-Update Mechanism
The PeP Exam App includes an auto-update feature that relies on the installer. The UpdateService checks a server endpoint for new versions, downloads the new installer, and runs it silently.
Sources: PeP.ExamApp/App.xaml.cs:25-41, PeP.ExamApp/Services/UpdateService.cs, PeP.ExamApp/Installer/README.md:57-76
Update Check Flow
The update process involves the client application, the PeP web server, and the downloaded installer.
This sequence diagram shows the auto-update process from application startup to installation.
Update Server Configuration
For the auto-update to function, a web server endpoint must be available to provide metadata about the latest version. The PeP web application includes this endpoint, which is configured via appsettings.json. The installer itself can be hosted on a service like Google Cloud Storage.
Sources: PeP.ExamApp/Installer/README.md:78-91, DEPLOY-GCLOUD.md:95-105
The API endpoint GET /api/examapp/update should return a JSON object with the following structure:
| Field | Type | Description |
|---|---|---|
version | string | The new version string (e.g., "1.1.0"). |
downloadUrl | string | The direct URL to the installer .exe file. |
releaseNotes | string | A summary of changes in the new version. |
releaseDate | string (date) | The release date of the update. |
isMandatory | boolean | If true, the user cannot skip the update. |
minimumVersion | string | The minimum required version to use the app. |
checksum | string | The SHA256 hash of the installer file for verification. |
Sources: PeP.ExamApp/Installer/README.md:62-71, PeP.ExamApp/Services/UpdateService.cs:9-17