Building and Signing Prism Validator on Windows
This guide explains how to build the Prism Validator Windows application from source and sign it for distribution to IT departments.
Prerequisites
Python 3.8 or higher installed on your system
Download from: https://www.python.org/downloads/
Make sure to check “Add Python to PATH” during installation
Git (if cloning the repository)
Download from: https://git-scm.com/download/win
Code Signing for IT Departments
IT departments often require signed executables. Here’s how to sign your Windows build for free (for open source projects):
Option 1: SignPath.io (Recommended - FREE for Open Source)
SignPath provides free code signing for open source projects and integrates with GitHub Actions.
Setup Steps:
Apply for Free OSS Signing:
Go to: https://about.signpath.io/product/open-source
Fill out application with your GitHub repo URL
Approval usually takes 1-2 business days
You’ll receive an organization ID and API token
Add Secrets to GitHub:
Repository Settings → Secrets and variables → Actions → New repository secret
Add:
SIGNPATH_API_TOKEN: Your API token from SignPathSIGNPATH_ORGANIZATION_ID: Your organization ID from SignPath
The Workflow Automatically Signs:
Already configured in
.github/workflows/build.ymlSigning happens automatically when you create a release tag
Only signs if secrets are present (gracefully skips if not)
Create a Release:
git tag -a v1.0.0 -m "Release v1.0.0" git push origin v1.0.0
The signed executable will be in the GitHub release artifacts.
What Gets Signed:
✅
PrismValidator.exe- Main executable✅ Certificate chain validates to trusted root
✅ SmartScreen won’t block (after reputation builds)
✅ IT departments can verify signature
Option 2: Self-Signed Certificate (FREE but LIMITED)
Pros: Completely free, can do locally Cons: Windows SmartScreen will still warn, IT departments may not accept
Only use if SignPath doesn’t work for your needs.
Create Self-Signed Certificate:
# Run PowerShell as Administrator
$cert = New-SelfSignedCertificate `
-Type Custom `
-Subject "CN=PRISM Validator, O=MRI Lab Graz, C=AT" `
-KeyUsage DigitalSignature `
-FriendlyName "PRISM Validator Code Signing" `
-CertStoreLocation "Cert:\CurrentUser\My" `
-TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.3", "2.5.29.19={text}")
# Export certificate
$password = ConvertTo-SecureString -String "YourPassword" -Force -AsPlainText
Export-PfxCertificate `
-Cert "Cert:\CurrentUser\My\$($cert.Thumbprint)" `
-FilePath "PrismValidator-CodeSigning.pfx" `
-Password $password
Sign the Executable:
# After building with PyInstaller
signtool sign /f "PrismValidator-CodeSigning.pfx" /p "YourPassword" /t http://timestamp.digicert.com "dist\PrismValidator\PrismValidator.exe"
Note: You’ll need to distribute the certificate to IT departments who will need to manually trust it.
Option 3: Submit to Microsoft for SmartScreen Reputation
Even with a valid signature, Windows SmartScreen may warn until your app builds reputation:
Sign with SignPath (or paid certificate)
Submit to Microsoft:
Go to: https://www.microsoft.com/en-us/wdsi/filesubmission
Upload your signed executable
Request reputation review
Build Reputation:
Downloads from many users over time
SmartScreen warnings decrease automatically
Verifying the Signature
After signing, verify it works:
# Check signature
Get-AuthenticodeSignature "dist\PrismValidator\PrismValidator.exe"
# Should show:
# Status: Valid
# SignerCertificate: [Your certificate]
In Windows Explorer:
Right-click the
.exefileProperties → Digital Signatures tab
Should show valid signature
Quick Start (Building)
Option 1: Using PowerShell (Recommended)
Setup the environment: Open PowerShell in the project directory and run:
.\setup.ps1 -Build
Build the application:
.\scripts\build\build_windows.ps1
Option 2: Using Command Prompt
Open Command Prompt in the project directory and run:
build_windows.bat
Option 3: Manual Build
If the automated scripts don’t work, follow these steps:
Create virtual environment:
python -m venv .venv
Activate virtual environment:
.venv\Scripts\activate.bat
Install dependencies:
python -m pip install --upgrade pip pip install -r requirements.txt pip install -r requirements-build.txt
Create survey_library folder (optional but recommended):
mkdir survey_libraryBuild the application:
python scripts\build\build_app.py
Output
After a successful build, you’ll find the application in:
dist\PrismValidator\PrismValidator.exe
You can:
Run it directly:
dist\PrismValidator\PrismValidator.exeDouble-click
PrismValidator.exein Windows ExplorerCopy the entire
dist\PrismValidator\folder to another location
Troubleshooting
“Python not found”
Make sure Python is installed and added to your PATH
Try using
pyinstead ofpython:py -3 -m venv .venv
“Failed to create virtual environment”
Make sure you have write permissions in the project directory
Try running PowerShell or Command Prompt as Administrator
“PyInstaller build fails”
Make sure all dependencies are installed:
pip install -r requirements-build.txtCheck if antivirus software is blocking PyInstaller
Try running with
--debugflag:python scripts\\build\\build_app.py --debug
Missing icon
The build script will automatically use the PNG logo from
static/img/MRI_Lab_Logo.pngIf the file is missing, the build will continue without an icon
survey_library warnings
The
survey_libraryfolder is optionalIf you see a warning, the build will continue normally
The folder is only needed if you use the survey management features
Building for Distribution
The built application in dist\PrismValidator\ includes:
PrismValidator.exe- Main executable_internal\- Required libraries and data filesAll templates, static files, and schemas
To distribute:
Compress the entire
dist\PrismValidator\folder to a ZIP fileShare the ZIP file with end users
Users can extract and run
PrismValidator.exewithout installing Python
Platform-Specific Notes
The Windows build uses a folder-based distribution (
--onedir)All dependencies are packaged in the
_internalfolderThe application runs without a console window (
--windowed)Icon support requires a PNG or ICO file (automatically handled)
Next Steps
After building:
Test the application:
cd dist\PrismValidator && .\PrismValidator.exeThe web interface will start on
http://localhost:5001Check the logs if the application doesn’t start