-
-
Notifications
You must be signed in to change notification settings - Fork 198
112 lines (90 loc) · 3.96 KB
/
test-installer-build.yml
File metadata and controls
112 lines (90 loc) · 3.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Test Installer Build (No Sign)
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- dev
paths:
- "Installer/**"
pull_request:
paths:
- "Installer/**"
jobs:
build-installer-no-sign:
runs-on: windows-2025
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install Inno Setup
run: winget install --id=JRSoftware.InnoSetup --exact --source winget --scope machine --accept-package-agreements --accept-source-agreements
shell: pwsh
- name: Setup .NET 9.0
uses: actions/setup-dotnet@v5
with:
dotnet-version: "9.0.x"
cache: true
cache-dependency-path: Directory.Packages.props
- name: Build SoundSwitch Application
run: |
echo "Cleaning build directories"
if exist bin rmdir /q /s bin
if exist obj rmdir /q /s obj
if exist Release rmdir /q /s Release
if exist Final rmdir /q /s Final
mkdir Final
echo "Building SoundSwitch CLI and Main Application"
dotnet publish -c Release SoundSwitch.CLI\SoundSwitch.CLI.csproj -o Final
dotnet publish -c Release SoundSwitch\SoundSwitch.csproj -o Final
shell: cmd
- name: Prepare Installer Assets
run: |
echo "Generate dummy Changelog"
echo ^<html^>^<body^>^<h1^>Dummy Changelog, markdown-html is required^</h1^>^</body^>^</html^> > Final\Changelog.html
echo "Generate dummy README"
echo ^<html^>^<body^>^<h1^>Dummy README, markdown-html is required^</h1^>^</body^>^</html^> > Final\Readme.html
echo "Copy soundSwitched image"
xcopy /y img\soundSwitched.png Final >nul 2>nul
echo "Copy CLI README"
xcopy /y SoundSwitch.CLI\README.md Final >nul 2>nul
echo "Copy LICENSE"
xcopy /y LICENSE.txt Final >nul 2>nul
xcopy /y Terms.txt Final >nul 2>nul
shell: cmd
- name: Remove Signing from Installer Script
run: |
echo "Removing signing configurations from setup.iss"
REM Remove SignTool lines
powershell -Command "(Get-Content 'Installer\setup.iss') -replace '^SignTool=.*$', '' | Set-Content 'Installer\setup.iss'"
REM Remove SignedUninstaller
powershell -Command "(Get-Content 'Installer\setup.iss') -replace '^SignedUninstaller=.*$', '' | Set-Content 'Installer\setup.iss'"
REM Remove signonce flags from Files section
powershell -Command "(Get-Content 'Installer\setup.iss') -replace ' signonce', '' | Set-Content 'Installer\setup.iss'"
echo "Signing configurations removed"
shell: cmd
- name: Build Installer
run: .\\Installer\\Make-Installer.bat Nightly
shell: cmd
- name: Run Installer in Silent Mode (Machine Scope)
run: |
echo "Finding installer executable..."
for /f "delims=" %%i in ('dir /b Final\Installer\*.exe') do set INSTALLER_NAME=%%i
if not defined INSTALLER_NAME (
echo "ERROR: No installer found in Final\Installer\"
exit /b 1
)
echo "Found installer: %INSTALLER_NAME%"
echo "Running installer in full silent mode for machine scope..."
Final\Installer\%INSTALLER_NAME% /VERYSILENT /ALLUSERS /NORESTART /SUPPRESSMSGBOXES /LOG="Final\Installer\install.log"
echo "Installation completed. Exit code: %ERRORLEVEL%"
if %ERRORLEVEL% neq 0 (
echo "Installation failed with exit code %ERRORLEVEL%"
if exist "Final\Installer\install.log" (
echo "Installation log:"
type "Final\Installer\install.log"
)
exit /b %ERRORLEVEL%
)
echo "Installation successful!"
shell: cmd