Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions .github/workflows/release.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
on:
release:
types: [ published ]
pull_request:

jobs:
release:
build:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Setup .NET
uses: actions/setup-dotnet@v4
Expand All @@ -16,11 +19,19 @@ jobs:

- name: Build
run: |
$ver = '${{ github.event.release.tag_name }}'.TrimStart('v')
$ErrorActionPreference = 'Stop'

if ('${{ github.event_name }}' -eq 'release') {
$ver = '${{ github.event.release.tag_name }}'.TrimStart('v')
} else {
$ver = '0.0.0'
}

dotnet.exe publish AutoAudioSwitcher -o publish -p:Version="$ver"
Compress-Archive -Path publish\* -DestinationPath "AutoAudioSwitcher-$ver.zip"
& 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' .\Setup\Setup.iss

- name: Upload release artifact
if: github.event_name == 'release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ github.event.release.tag_name }} (Get-Item *.zip)
run: gh release upload ${{ github.event.release.tag_name }} Setup\Output\AutoAudioSwitcher-Setup.exe
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Setup/Output/

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "Setup/InnoDependencyInstaller"]
path = Setup/InnoDependencyInstaller
url = https://github.com/DomGries/InnoDependencyInstaller.git
2 changes: 1 addition & 1 deletion AutoAudioSwitcher/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static ServiceProvider ConfigureServices()
[STAThread]
static void Main()
{
using Mutex singleInstance = new(true, "392d8dc8-9bdc-4844-a7c8-dbf3e08bb2bc", out bool createdNew);
using Mutex singleInstance = new(true, "f09f929b-e98f-a1e9-9fb3-e383aae383b3" /* This is my favorite GUID */, out bool createdNew);
if (!createdNew)
{
return;
Expand Down
1 change: 1 addition & 0 deletions Setup/InnoDependencyInstaller
59 changes: 59 additions & 0 deletions Setup/Setup.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
; Inno docs: https://jrsoftware.org/ishelp/
; Preprocessor docs: https://jrsoftware.org/ispphelp/
#pragma verboselevel 9

#define public Dependency_Path_NetCoreCheck "InnoDependencyInstaller\dependencies\"
#include "InnoDependencyInstaller\CodeDependencies.iss"

; Extract version from exe
#define Exe "..\publish\AutoAudioSwitcher.exe"
#ifnexist Exe
#pragma error Exe + " does not exist"
#endif
#define FileVersion GetStringFileInfo(Exe, "FileVersion")
#define ProductVersion GetStringFileInfo(Exe, "ProductVersion")
#define Version Copy(ProductVersion, 1, Pos("+", ProductVersion) - 1)
#pragma message "Version is " + Version

[Setup]
AppCopyright=Copyright (c) Max Kagamine
AppId={{F09F929B-E98F-A1E9-9FB3-E383AAE383B3}
AppName=Auto Audio Switcher
AppPublisher=Max Kagamine
AppPublisherURL=https://github.com/maxkagamine/AutoAudioSwitcher
AppSupportURL=https://github.com/maxkagamine/AutoAudioSwitcher/issues
AppUpdatesURL=https://github.com/maxkagamine/AutoAudioSwitcher/releases
AppVerName=Auto Audio Switcher {#Version}
AppVersion={#Version}
ArchitecturesInstallIn64BitMode=x64compatible
DefaultDirName={userpf}\Auto Audio Switcher
DisableDirPage=yes
DisableProgramGroupPage=yes
LicenseFile=..\LICENSE.txt
OutputBaseFilename=AutoAudioSwitcher-Setup
PrivilegesRequired=lowest
ShowLanguageDialog=auto
SolidCompression=yes
VersionInfoProductTextVersion={#ProductVersion}
VersionInfoVersion={#FileVersion}
WizardStyle=classic

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"

[Files]
Source: "..\publish\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

[Icons]
Name: "{userstartup}\Auto Audio Switcher"; Filename: "{app}\AutoAudioSwitcher.exe"

[Run]
Filename: "{app}\AutoAudioSwitcher.exe"; Flags: nowait postinstall

[Code]
function InitializeSetup: Boolean;
begin
Dependency_AddDotNet90Desktop;
Result := True;
end;