Skip to content

Commit 3fa5d51

Browse files
authored
Merge pull request #24 from avikeid2007/avnish/migrateWinUI
Add traditional installer build, docs, and CI automation
2 parents eb5910a + 52201cf commit 3fa5d51

11 files changed

Lines changed: 2027 additions & 0 deletions
Lines changed: 237 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,237 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
branches: [ main, avnish/migrateWinUI ]
6+
tags:
7+
- 'v*'
8+
pull_request:
9+
branches: [ main ]
10+
workflow_dispatch:
11+
12+
env:
13+
DOTNET_VERSION: '8.0.x'
14+
PROJECT_PATH: 'PingTool.WinUI3/PingTool.WinUI3.csproj'
15+
SOLUTION_PATH: 'PingTool.WinUI3.sln'
16+
17+
jobs:
18+
build-msix-bundle:
19+
name: Build MSIX Bundle
20+
runs-on: windows-latest
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Setup .NET
29+
uses: actions/setup-dotnet@v4
30+
with:
31+
dotnet-version: ${{ env.DOTNET_VERSION }}
32+
33+
- name: Setup MSBuild
34+
uses: microsoft/setup-msbuild@v2
35+
36+
- name: Restore NuGet packages
37+
run: dotnet restore ${{ env.SOLUTION_PATH }}
38+
39+
- name: Build MSIX Bundle
40+
run: |
41+
powershell -ExecutionPolicy Bypass -File .\BuildMsixBundle.ps1
42+
43+
- name: Upload MSIX Bundle
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: msix-bundle
47+
path: PingTool.WinUI3/bin/Package/*.msixbundle
48+
retention-days: 30
49+
50+
- name: Upload MSIX Symbols
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: msix-symbols
54+
path: PingTool.WinUI3/bin/Package/**/*.msixsym
55+
retention-days: 30
56+
57+
build-installer:
58+
name: Build Traditional Installer
59+
runs-on: windows-latest
60+
61+
steps:
62+
- name: Checkout code
63+
uses: actions/checkout@v4
64+
with:
65+
fetch-depth: 0
66+
67+
- name: Setup .NET
68+
uses: actions/setup-dotnet@v4
69+
with:
70+
dotnet-version: ${{ env.DOTNET_VERSION }}
71+
72+
- name: Setup MSBuild
73+
uses: microsoft/setup-msbuild@v2
74+
75+
- name: Restore NuGet packages
76+
run: dotnet restore ${{ env.SOLUTION_PATH }}
77+
78+
- name: Build x64 Release
79+
run: |
80+
msbuild ${{ env.PROJECT_PATH }} `
81+
/p:Configuration=Release `
82+
/p:Platform=x64 `
83+
/p:WindowsPackageType=None `
84+
/p:AppxPackageSigningEnabled=false `
85+
/p:GenerateAppxPackageOnBuild=false `
86+
/t:Restore,Build
87+
88+
- name: Publish x64
89+
run: |
90+
dotnet publish ${{ env.PROJECT_PATH }} `
91+
-c Release `
92+
-r win-x64 `
93+
--self-contained true `
94+
/p:Platform=x64 `
95+
/p:WindowsPackageType=None `
96+
/p:PublishSingleFile=false `
97+
/p:PublishReadyToRun=true `
98+
/p:PublishTrimmed=false `
99+
-o Output/Publish/win-x64
100+
101+
- name: Setup Inno Setup
102+
run: |
103+
choco install innosetup -y
104+
105+
- name: Create Installer
106+
run: |
107+
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" InnoSetup.iss
108+
109+
- name: Upload Installer
110+
uses: actions/upload-artifact@v4
111+
with:
112+
name: installer
113+
path: Output/Installer/*.exe
114+
retention-days: 30
115+
116+
create-release:
117+
name: Create GitHub Release
118+
needs: [build-msix-bundle, build-installer]
119+
runs-on: windows-latest
120+
if: startsWith(github.ref, 'refs/tags/v')
121+
122+
permissions:
123+
contents: write
124+
125+
steps:
126+
- name: Checkout code
127+
uses: actions/checkout@v4
128+
129+
- name: Download MSIX Bundle
130+
uses: actions/download-artifact@v4
131+
with:
132+
name: msix-bundle
133+
path: release/msix
134+
135+
- name: Download Installer
136+
uses: actions/download-artifact@v4
137+
with:
138+
name: installer
139+
path: release/installer
140+
141+
- name: Get version from tag
142+
id: get_version
143+
run: |
144+
$version = "${{ github.ref_name }}".TrimStart('v')
145+
echo "VERSION=$version" >> $env:GITHUB_OUTPUT
146+
echo "Version: $version"
147+
148+
- name: Create Release Notes
149+
id: release_notes
150+
run: |
151+
$notes = @"
152+
## Ping Legacy ${{ steps.get_version.outputs.VERSION }}
153+
154+
### Download Options
155+
156+
**Microsoft Store (Recommended)**
157+
- Automatic updates
158+
- Sandboxed installation
159+
- [Get it from Microsoft Store](https://www.microsoft.com/store/apps/9NBLGGH4VQ4Q)
160+
161+
**Direct Download**
162+
- Traditional installer
163+
- Offline installation
164+
- Download the .exe file below
165+
166+
### Installation Methods
167+
168+
#### Method 1: Microsoft Store (Recommended)
169+
Get the app from the Microsoft Store for automatic updates and easy management.
170+
171+
#### Method 2: MSIX Bundle
172+
- For IT administrators or sideloading
173+
- Requires certificate installation
174+
- Download the .msixbundle file
175+
176+
#### Method 3: Traditional Installer
177+
- Standard Windows installer
178+
- Download the .exe file
179+
- Requires .NET 8 Desktop Runtime
180+
181+
### System Requirements
182+
- Windows 10 version 1809 (Build 17763) or later
183+
- Windows 11 (all versions)
184+
- .NET 8 Desktop Runtime (will be prompted to install if missing)
185+
186+
### What's New
187+
- See CHANGELOG.md for details
188+
189+
### Known Issues
190+
- See GitHub Issues for current known issues
191+
"@
192+
193+
$notes | Out-File -FilePath release_notes.md -Encoding utf8
194+
echo "NOTES_FILE=release_notes.md" >> $env:GITHUB_OUTPUT
195+
196+
- name: Create GitHub Release
197+
uses: softprops/action-gh-release@v1
198+
with:
199+
name: Ping Legacy ${{ steps.get_version.outputs.VERSION }}
200+
body_path: ${{ steps.release_notes.outputs.NOTES_FILE }}
201+
draft: false
202+
prerelease: false
203+
files: |
204+
release/msix/*.msixbundle
205+
release/installer/*.exe
206+
env:
207+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
208+
209+
test-installer:
210+
name: Test Installer
211+
needs: [build-installer]
212+
runs-on: windows-latest
213+
214+
steps:
215+
- name: Download Installer
216+
uses: actions/download-artifact@v4
217+
with:
218+
name: installer
219+
path: installer
220+
221+
- name: List installer files
222+
run: |
223+
Get-ChildItem -Path installer -Recurse
224+
225+
- name: Verify installer exists
226+
run: |
227+
$installer = Get-ChildItem -Path installer -Filter "*.exe" | Select-Object -First 1
228+
if ($installer) {
229+
Write-Host "? Installer found: $($installer.Name)"
230+
Write-Host " Size: $([math]::Round($installer.Length / 1MB, 2)) MB"
231+
} else {
232+
Write-Error "? No installer found!"
233+
exit 1
234+
}
235+
236+
# Note: Actual installation test would require a clean VM
237+
# This is a basic verification that the installer was built

BuildInstaller.ps1

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# PowerShell script to build traditional installer using .NET publish
2+
3+
Write-Host "Building Traditional Installer for Direct Download..." -ForegroundColor Green
4+
Write-Host "====================================================" -ForegroundColor Green
5+
6+
# Configuration
7+
$ProjectPath = "PingTool.WinUI3\PingTool.WinUI3.csproj"
8+
$Configuration = "Release"
9+
$Platform = "x64"
10+
$RuntimeIdentifier = "win-x64"
11+
$OutputDir = "Output\Publish"
12+
13+
# Clean previous builds
14+
Write-Host "`nCleaning previous builds..." -ForegroundColor Cyan
15+
Remove-Item -Path $OutputDir -Recurse -Force -ErrorAction SilentlyContinue
16+
17+
# Build the project first (without MSIX packaging)
18+
Write-Host "`nBuilding project for $Platform..." -ForegroundColor Cyan
19+
20+
msbuild $ProjectPath `
21+
/p:Configuration=$Configuration `
22+
/p:Platform=$Platform `
23+
/p:WindowsPackageType=None `
24+
/p:AppxPackageSigningEnabled=false `
25+
/p:GenerateAppxPackageOnBuild=false `
26+
/t:Restore,Build
27+
28+
if ($LASTEXITCODE -ne 0) {
29+
Write-Host "`nBuild failed!" -ForegroundColor Red
30+
exit 1
31+
}
32+
33+
# Publish the application (self-contained)
34+
Write-Host "`nPublishing self-contained application for $RuntimeIdentifier..." -ForegroundColor Cyan
35+
36+
dotnet publish $ProjectPath `
37+
-c $Configuration `
38+
-r $RuntimeIdentifier `
39+
--self-contained true `
40+
/p:Platform=$Platform `
41+
/p:WindowsPackageType=None `
42+
/p:PublishSingleFile=false `
43+
/p:PublishReadyToRun=true `
44+
/p:PublishTrimmed=false `
45+
-o "$OutputDir\$RuntimeIdentifier"
46+
47+
if ($LASTEXITCODE -ne 0) {
48+
Write-Host "`nPublish failed!" -ForegroundColor Red
49+
exit 1
50+
}
51+
52+
Write-Host "`n====================================================" -ForegroundColor Green
53+
Write-Host "Build completed successfully!" -ForegroundColor Green
54+
Write-Host "====================================================" -ForegroundColor Green
55+
Write-Host "`nPublished files location:" -ForegroundColor Cyan
56+
Write-Host " $OutputDir\$RuntimeIdentifier" -ForegroundColor Yellow
57+
58+
# Check if Inno Setup is installed
59+
$InnoSetupPath = "C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
60+
61+
if (Test-Path $InnoSetupPath) {
62+
Write-Host "`nInno Setup found. Creating installer..." -ForegroundColor Cyan
63+
64+
# Run Inno Setup compiler
65+
& $InnoSetupPath "InnoSetup.iss"
66+
67+
if ($LASTEXITCODE -eq 0) {
68+
Write-Host "`n====================================================" -ForegroundColor Green
69+
Write-Host "Installer created successfully!" -ForegroundColor Green
70+
Write-Host "====================================================" -ForegroundColor Green
71+
72+
$installerPath = "Output\Installer"
73+
if (Test-Path $installerPath) {
74+
Write-Host "`nInstaller files:" -ForegroundColor Cyan
75+
Get-ChildItem -Path $installerPath -Filter "*.exe" | ForEach-Object {
76+
$size = [math]::Round($_.Length / 1MB, 2)
77+
Write-Host " - $($_.Name) ($size MB)" -ForegroundColor Yellow
78+
Write-Host " Location: $($_.FullName)" -ForegroundColor DarkGray
79+
}
80+
}
81+
} else {
82+
Write-Host "`nInno Setup compilation failed!" -ForegroundColor Red
83+
}
84+
} else {
85+
Write-Host "`nInno Setup not found at: $InnoSetupPath" -ForegroundColor Yellow
86+
Write-Host "Download from: https://jrsoftware.org/isdl.php" -ForegroundColor Yellow
87+
Write-Host "`nYou can manually create the installer by:" -ForegroundColor Cyan
88+
Write-Host " 1. Install Inno Setup" -ForegroundColor White
89+
Write-Host " 2. Open InnoSetup.iss" -ForegroundColor White
90+
Write-Host " 3. Click Build > Compile" -ForegroundColor White
91+
}
92+
93+
Write-Host "`nNext steps:" -ForegroundColor Cyan
94+
Write-Host " - Test the installer on a clean machine" -ForegroundColor White
95+
Write-Host " - Upload to GitHub Releases" -ForegroundColor White
96+
Write-Host " - Update website with download link" -ForegroundColor White

0 commit comments

Comments
 (0)