Add Inno Setup installer
- Add MonitorControl.iss script - Installer adds to Start Menu - Optional: desktop shortcut and startup with Windows - Update workflow to build installer 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -23,12 +23,17 @@ jobs:
|
|||||||
- name: Build Release
|
- name: Build Release
|
||||||
run: dotnet build --configuration Release --no-restore
|
run: dotnet build --configuration Release --no-restore
|
||||||
|
|
||||||
- name: Publish
|
- name: Update version in ISS
|
||||||
run: dotnet publish DellMonitorControl/DellMonitorControl.csproj -c Release -o ./publish --self-contained false
|
|
||||||
|
|
||||||
- name: Create ZIP archive
|
|
||||||
run: Compress-Archive -Path ./publish/* -DestinationPath ./MonitorControl-${{ gitea.ref_name }}.zip
|
|
||||||
shell: powershell
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
$version = "${{ gitea.ref_name }}".TrimStart("v")
|
||||||
|
$issPath = "DellMonitorControl/MonitorControl.iss"
|
||||||
|
(Get-Content $issPath) -replace '#define MyAppVersion ".*"', "#define MyAppVersion `"$version`"" | Set-Content $issPath
|
||||||
|
|
||||||
|
- name: Build Installer
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" DellMonitorControl\MonitorControl.iss
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
shell: powershell
|
shell: powershell
|
||||||
@@ -36,6 +41,7 @@ jobs:
|
|||||||
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
$tag = "${{ gitea.ref_name }}"
|
$tag = "${{ gitea.ref_name }}"
|
||||||
|
$version = $tag.TrimStart("v")
|
||||||
$repo = "misc/ControlMyMonitorManagement"
|
$repo = "misc/ControlMyMonitorManagement"
|
||||||
$baseUrl = "https://git.marketally.com/api/v1"
|
$baseUrl = "https://git.marketally.com/api/v1"
|
||||||
|
|
||||||
@@ -51,7 +57,7 @@ jobs:
|
|||||||
$body = @{
|
$body = @{
|
||||||
tag_name = $tag
|
tag_name = $tag
|
||||||
name = "Monitor Control $tag"
|
name = "Monitor Control $tag"
|
||||||
body = "## Monitor Control $tag`n`n### Installation`n1. Download the ZIP file`n2. Extract to a folder`n3. Run DellMonitorControl.exe`n`n### Requirements`n- Windows 10/11`n- .NET 9.0 Runtime"
|
body = "## Monitor Control $tag`n`n### Installation`nDownload and run the installer.`n`n### Features`n- System tray monitor control`n- Brightness/Contrast adjustment`n- Input source switching`n- Quick-switch toolbar`n`n### Requirements`n- Windows 10/11`n- .NET 9.0 Runtime"
|
||||||
} | ConvertTo-Json
|
} | ConvertTo-Json
|
||||||
|
|
||||||
$release = Invoke-RestMethod -Uri "$baseUrl/repos/$repo/releases" -Method Post -Headers @{"Authorization"="token $env:GITEA_TOKEN"; "Content-Type"="application/json"} -Body $body
|
$release = Invoke-RestMethod -Uri "$baseUrl/repos/$repo/releases" -Method Post -Headers @{"Authorization"="token $env:GITEA_TOKEN"; "Content-Type"="application/json"} -Body $body
|
||||||
@@ -59,11 +65,11 @@ jobs:
|
|||||||
Write-Host "Release created with ID: $releaseId"
|
Write-Host "Release created with ID: $releaseId"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Upload asset using curl (more reliable for file uploads)
|
# Upload installer
|
||||||
$filePath = "./MonitorControl-$tag.zip"
|
$filePath = "DellMonitorControl/installer/MonitorControl-Setup-$version.exe"
|
||||||
$fileName = "MonitorControl-$tag.zip"
|
$fileName = "MonitorControl-Setup-$version.exe"
|
||||||
Write-Host "Uploading $fileName..."
|
Write-Host "Uploading $fileName..."
|
||||||
|
|
||||||
curl.exe -X POST -H "Authorization: token $env:GITEA_TOKEN" -F "attachment=@$filePath" "$baseUrl/repos/$repo/releases/$releaseId/assets?name=$fileName"
|
curl.exe -X POST -H "Authorization: token $env:GITEA_TOKEN" -F "attachment=@$filePath" "$baseUrl/repos/$repo/releases/$releaseId/assets?name=$fileName"
|
||||||
|
|
||||||
Write-Host "Asset uploaded successfully"
|
Write-Host "Installer uploaded successfully"
|
||||||
|
|||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -365,5 +365,5 @@ FodyWeavers.xsd
|
|||||||
# Claude Code
|
# Claude Code
|
||||||
.claude/
|
.claude/
|
||||||
|
|
||||||
# Windows special files
|
# Inno Setup output
|
||||||
nul
|
DellMonitorControl/installer/
|
||||||
|
|||||||
39
DellMonitorControl/MonitorControl.iss
Normal file
39
DellMonitorControl/MonitorControl.iss
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
#define MyAppName "Monitor Control"
|
||||||
|
#define MyAppVersion "1.0.0"
|
||||||
|
#define MyAppPublisher "Dang"
|
||||||
|
#define MyAppExeName "DellMonitorControl.exe"
|
||||||
|
|
||||||
|
[Setup]
|
||||||
|
AppId={{8F3E4A2B-1C5D-4E6F-9A8B-7C2D1E3F4A5B}
|
||||||
|
AppName={#MyAppName}
|
||||||
|
AppVersion={#MyAppVersion}
|
||||||
|
AppPublisher={#MyAppPublisher}
|
||||||
|
DefaultDirName={autopf}\{#MyAppName}
|
||||||
|
DefaultGroupName={#MyAppName}
|
||||||
|
AllowNoIcons=yes
|
||||||
|
OutputDir=installer
|
||||||
|
OutputBaseFilename=MonitorControl-Setup-{#MyAppVersion}
|
||||||
|
Compression=lzma
|
||||||
|
SolidCompression=yes
|
||||||
|
WizardStyle=modern
|
||||||
|
PrivilegesRequired=admin
|
||||||
|
UninstallDisplayIcon={app}\{#MyAppExeName}
|
||||||
|
|
||||||
|
[Languages]
|
||||||
|
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||||
|
|
||||||
|
[Tasks]
|
||||||
|
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
||||||
|
Name: "startupicon"; Description: "Start with Windows"; GroupDescription: "Startup:"
|
||||||
|
|
||||||
|
[Files]
|
||||||
|
Source: "bin\Release\net9.0-windows\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||||
|
|
||||||
|
[Icons]
|
||||||
|
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
|
||||||
|
Name: "{group}\Uninstall {#MyAppName}"; Filename: "{uninstallexe}"
|
||||||
|
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
|
||||||
|
Name: "{userstartup}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: startupicon
|
||||||
|
|
||||||
|
[Run]
|
||||||
|
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
||||||
Reference in New Issue
Block a user