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:
parent
c42b3dc817
commit
db9930f3b6
@ -23,12 +23,17 @@ jobs:
|
||||
- name: Build Release
|
||||
run: dotnet build --configuration Release --no-restore
|
||||
|
||||
- name: Publish
|
||||
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
|
||||
- name: Update version in ISS
|
||||
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
|
||||
shell: powershell
|
||||
@ -36,6 +41,7 @@ jobs:
|
||||
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
run: |
|
||||
$tag = "${{ gitea.ref_name }}"
|
||||
$version = $tag.TrimStart("v")
|
||||
$repo = "misc/ControlMyMonitorManagement"
|
||||
$baseUrl = "https://git.marketally.com/api/v1"
|
||||
|
||||
@ -51,7 +57,7 @@ jobs:
|
||||
$body = @{
|
||||
tag_name = $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
|
||||
|
||||
$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"
|
||||
}
|
||||
|
||||
# Upload asset using curl (more reliable for file uploads)
|
||||
$filePath = "./MonitorControl-$tag.zip"
|
||||
$fileName = "MonitorControl-$tag.zip"
|
||||
# Upload installer
|
||||
$filePath = "DellMonitorControl/installer/MonitorControl-Setup-$version.exe"
|
||||
$fileName = "MonitorControl-Setup-$version.exe"
|
||||
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"
|
||||
|
||||
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/
|
||||
|
||||
# Windows special files
|
||||
nul
|
||||
# Inno Setup output
|
||||
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
|
||||
Loading…
Reference in New Issue
Block a user