diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml
deleted file mode 100644
index 9e29dce..0000000
--- a/.github/workflows/dotnet.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-name: .NET
-
-on: workflow_dispatch
-
-jobs:
- publish:
-
- runs-on: windows-latest
-
- steps:
- - uses: actions/checkout@v3
- - name: Setup .NET
- uses: actions/setup-dotnet@v2
- with:
- dotnet-version: 6.0.x
- - name: publish
- run: dotnet publish App/BrowseRouter.csproj /p:PublishProfile=App/Properties/PublishProfiles/FolderProfile.pubxml
- - name: Archive production artifacts
- uses: actions/upload-artifact@v3
- with:
- name: published-binary
- path: |
- App/publish
- !App/publish/**/*.pdb
- - name: Test
- run: dotnet test --no-build --verbosity normal
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..239a9bd
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,49 @@
+name: Run Tests
+
+permissions:
+ contents: read
+ issues: read
+ checks: write
+ pull-requests: write
+
+on:
+ workflow_dispatch:
+ pull_request:
+ types: ['opened', 'reopened', 'synchronize', 'ready_for_review']
+
+ paths:
+ - '**'
+
+env:
+ DOTNET_SDK_VERSION: 8.0
+ SOLUTION_PATH: "BrowseRouter.sln"
+
+jobs:
+
+ test:
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ # ./ is the repo root
+ working-directory: ./
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Setup dotnet
+ uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: ${{ env.DOTNET_SDK_VERSION }}
+
+ - name: Build
+ run: dotnet build --configuration Release
+
+ - name: Run dotnet test
+ run: dotnet test ${{ env.SOLUTION_PATH }} --configuration Release --results-directory test-results --logger "trx;LogFilePrefix=TestResults"
+
+ - name: Publish Test Results
+ uses: EnricoMi/publish-unit-test-result-action@v2
+ if: always()
+ with:
+ files: |
+ test-results/**/*.trx
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
new file mode 100644
index 0000000..be4ae53
--- /dev/null
+++ b/.github/workflows/windows.yml
@@ -0,0 +1,60 @@
+name: Build for Windows
+on:
+ workflow_dispatch:
+ pull_request:
+ types: ['opened', 'reopened', 'synchronize', 'ready_for_review']
+ paths:
+ - '**'
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ Build:
+ name: Build on self-hosted
+ runs-on: m2mini-win11
+ permissions:
+ contents: write
+ defaults:
+ run:
+ # ./ is the repo root
+ working-directory: ./
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: '8.0.x'
+
+ - name: Get version
+ run: |
+ $version = ./Get-ProjectVersion.ps1 -ProjectPath BrowseRouter
+ echo "VERSION=$version" >> $env:GITHUB_ENV
+
+ - name: Get PR URL
+ run: |
+ $pr = ${{ github.event.pull_request.number }}
+ $url = "https://github.com/nref/BrowseRouter/pull/$pr"
+ echo "PR_URL=$url" >> $env:GITHUB_ENV
+
+ - name: Get PR Title and Description
+ run: |
+ $title=$(gh pr view $env:PR_URL --json title -q .title)
+ $description=$(gh pr view $env:PR_URL --json body -q .body)
+ echo $description > pr_description.md
+ echo "PR_TITLE=$title" >> $env:GITHUB_ENV
+ echo "PR_DESCRIPTION_FILE=pr_description.md" >> $env:GITHUB_ENV
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Build and sign
+ run: pwsh ./make.ps1
+
+ - uses: ncipollo/release-action@v1
+ with:
+ artifacts: "./Releases/**/*.zip"
+ draft: true
+ allowUpdates: true
+ tag: ${{ env.VERSION }}
+ name: ${{ env.VERSION }} - ${{ env.PR_TITLE }}
+ bodyFile: ${{ env.PR_DESCRIPTION_FILE }}
diff --git a/.gitignore b/.gitignore
index 920d914..cb311c3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,5 +3,6 @@
bin
obj
publish
+Releases
**/*.user
**/*.crt
diff --git a/App/logo.ico b/App/logo.ico
deleted file mode 100644
index b987d5d..0000000
Binary files a/App/logo.ico and /dev/null differ
diff --git a/App/logo.png b/App/logo.png
deleted file mode 100644
index e8502ac..0000000
Binary files a/App/logo.png and /dev/null differ
diff --git a/App/publish.ps1 b/App/publish.ps1
deleted file mode 100644
index 9e9769a..0000000
--- a/App/publish.ps1
+++ /dev/null
@@ -1,21 +0,0 @@
-$certTmpPath = "cert.tmp.crt"
-$certKey = $env:ENDURABYTE_WINDOWS_CODE_SIGN_KEY
-$signTool = "C:\Program Files (x86)\Windows Kits\10\App Certification Kit\signtool.exe"
-
-dotnet publish /p:PublishProfile=arm64 --configuration Release
-dotnet publish /p:PublishProfile=x64 --configuration Release
-
-& ./Decode-FromBase64.ps1 $env:ENDURABYTE_WINDOWS_CODE_SIGN_CERTIFICATE $certTmpPath
-$certTmpPath = "$PSScriptRoot/$certTmpPath"
-echo "Created $certTmpPath..."
-
-. $signtool sign /f "$certTmpPath" /fd SHA256 /td SHA256 /tr http://timestamp.digicert.com /csp "SafeNet Smart Card Key Storage Provider" /k $certKey /v "./publish/win-x64/BrowseRouter.exe"
-
-. $signtool sign /f "$certTmpPath" /fd SHA256 /td SHA256 /tr http://timestamp.digicert.com /csp "SafeNet Smart Card Key Storage Provider" /k $certKey /v "./publish/win-arm64/BrowseRouter.exe"
-
-rm $certTmpPath
-
-md ./publish/signed -ea 0
-cp ./publish/win-arm64/BrowseRouter.exe ./publish/signed/BrowseRouter.arm64.exe
-cp ./publish/win-x64/BrowseRouter.exe ./publish/signed/BrowseRouter.x64.exe
-cp ./publish/win-x64/config.ini ./publish/signed
diff --git a/BrowseRouter.sln b/BrowseRouter.sln
index 4bdf7dd..428b41d 100644
--- a/BrowseRouter.sln
+++ b/BrowseRouter.sln
@@ -3,32 +3,50 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32819.101
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BrowseRouter", "App\BrowseRouter.csproj", "{39E2D988-557D-40D2-9D0B-AAC097FE98C5}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{42958659-9C5D-4FD0-97A3-D65DEE66523C}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
- .github\workflows\dotnet.yml = .github\workflows\dotnet.yml
+ Decode-FromBase64.ps1 = Decode-FromBase64.ps1
+ Directory.Build.props = Directory.Build.props
+ Get-ProjectVersion.ps1 = Get-ProjectVersion.ps1
+ make.ps1 = make.ps1
+ Publish-And-Sign.ps1 = Publish-And-Sign.ps1
README.md = README.md
+ .github\workflows\test.yml = .github\workflows\test.yml
+ .github\workflows\windows.yml = .github\workflows\windows.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BrowserRouter.Tests", "Tests\BrowserRouter.Tests\BrowserRouter.Tests.csproj", "{90964780-A852-4B1E-9D61-93CA1FB6E27E}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unregister", "Unregister\Unregister.csproj", "{28058E4A-C2EF-4044-888B-7038CAF5BFD7}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Register", "Register\Register.csproj", "{9387B6CF-1705-4A6F-8723-B729F167829D}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BrowseRouter", "BrowseRouter\BrowseRouter.csproj", "{59BE57B7-9A45-432C-9ACB-99B05B9834EB}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {39E2D988-557D-40D2-9D0B-AAC097FE98C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {39E2D988-557D-40D2-9D0B-AAC097FE98C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {39E2D988-557D-40D2-9D0B-AAC097FE98C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {39E2D988-557D-40D2-9D0B-AAC097FE98C5}.Release|Any CPU.Build.0 = Release|Any CPU
{90964780-A852-4B1E-9D61-93CA1FB6E27E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{90964780-A852-4B1E-9D61-93CA1FB6E27E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90964780-A852-4B1E-9D61-93CA1FB6E27E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90964780-A852-4B1E-9D61-93CA1FB6E27E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {28058E4A-C2EF-4044-888B-7038CAF5BFD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {28058E4A-C2EF-4044-888B-7038CAF5BFD7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {28058E4A-C2EF-4044-888B-7038CAF5BFD7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {28058E4A-C2EF-4044-888B-7038CAF5BFD7}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9387B6CF-1705-4A6F-8723-B729F167829D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9387B6CF-1705-4A6F-8723-B729F167829D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9387B6CF-1705-4A6F-8723-B729F167829D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9387B6CF-1705-4A6F-8723-B729F167829D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {59BE57B7-9A45-432C-9ACB-99B05B9834EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {59BE57B7-9A45-432C-9ACB-99B05B9834EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {59BE57B7-9A45-432C-9ACB-99B05B9834EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {59BE57B7-9A45-432C-9ACB-99B05B9834EB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/App/App.cs b/BrowseRouter/App.cs
similarity index 100%
rename from App/App.cs
rename to BrowseRouter/App.cs
diff --git a/App/BrowseRouter.csproj b/BrowseRouter/BrowseRouter.csproj
similarity index 61%
rename from App/BrowseRouter.csproj
rename to BrowseRouter/BrowseRouter.csproj
index 0793df4..d3db42b 100644
--- a/App/BrowseRouter.csproj
+++ b/BrowseRouter/BrowseRouter.csproj
@@ -1,24 +1,13 @@
- enable
WinExe
net8.0-windows
- enable
- 4
logo.ico
- 0.10.0
true
-
- true
app.manifest
-
-
- embedded
-
-
diff --git a/App/Browser.cs b/BrowseRouter/Browser.cs
similarity index 100%
rename from App/Browser.cs
rename to BrowseRouter/Browser.cs
diff --git a/App/BrowserService.cs b/BrowseRouter/BrowserService.cs
similarity index 100%
rename from App/BrowserService.cs
rename to BrowseRouter/BrowserService.cs
diff --git a/App/ConfigService.cs b/BrowseRouter/ConfigService.cs
similarity index 100%
rename from App/ConfigService.cs
rename to BrowseRouter/ConfigService.cs
diff --git a/App/Env.cs b/BrowseRouter/Env.cs
similarity index 100%
rename from App/Env.cs
rename to BrowseRouter/Env.cs
diff --git a/App/Executable.cs b/BrowseRouter/Executable.cs
similarity index 100%
rename from App/Executable.cs
rename to BrowseRouter/Executable.cs
diff --git a/App/Interop/Win32/NotifyIconData.cs b/BrowseRouter/Interop/Win32/NotifyIconData.cs
similarity index 100%
rename from App/Interop/Win32/NotifyIconData.cs
rename to BrowseRouter/Interop/Win32/NotifyIconData.cs
diff --git a/App/Interop/Win32/Shell32.cs b/BrowseRouter/Interop/Win32/Shell32.cs
similarity index 100%
rename from App/Interop/Win32/Shell32.cs
rename to BrowseRouter/Interop/Win32/Shell32.cs
diff --git a/App/Interop/Win32/User32.cs b/BrowseRouter/Interop/Win32/User32.cs
similarity index 100%
rename from App/Interop/Win32/User32.cs
rename to BrowseRouter/Interop/Win32/User32.cs
diff --git a/App/Log.cs b/BrowseRouter/Log.cs
similarity index 100%
rename from App/Log.cs
rename to BrowseRouter/Log.cs
diff --git a/App/LogPreference.cs b/BrowseRouter/LogPreference.cs
similarity index 100%
rename from App/LogPreference.cs
rename to BrowseRouter/LogPreference.cs
diff --git a/App/NotifyPreference.cs b/BrowseRouter/NotifyPreference.cs
similarity index 100%
rename from App/NotifyPreference.cs
rename to BrowseRouter/NotifyPreference.cs
diff --git a/App/NotifyService.cs b/BrowseRouter/NotifyService.cs
similarity index 100%
rename from App/NotifyService.cs
rename to BrowseRouter/NotifyService.cs
diff --git a/App/Program.cs b/BrowseRouter/Program.cs
similarity index 100%
rename from App/Program.cs
rename to BrowseRouter/Program.cs
diff --git a/App/Properties/PublishProfiles/arm64.pubxml b/BrowseRouter/Properties/PublishProfiles/win-arm64.pubxml
similarity index 100%
rename from App/Properties/PublishProfiles/arm64.pubxml
rename to BrowseRouter/Properties/PublishProfiles/win-arm64.pubxml
diff --git a/App/Properties/PublishProfiles/x64.pubxml b/BrowseRouter/Properties/PublishProfiles/win-x64.pubxml
similarity index 100%
rename from App/Properties/PublishProfiles/x64.pubxml
rename to BrowseRouter/Properties/PublishProfiles/win-x64.pubxml
diff --git a/App/Properties/launchSettings.json b/BrowseRouter/Properties/launchSettings.json
similarity index 100%
rename from App/Properties/launchSettings.json
rename to BrowseRouter/Properties/launchSettings.json
diff --git a/App/RegistryService.cs b/BrowseRouter/RegistryService.cs
similarity index 100%
rename from App/RegistryService.cs
rename to BrowseRouter/RegistryService.cs
diff --git a/App/UriFactory.cs b/BrowseRouter/UriFactory.cs
similarity index 100%
rename from App/UriFactory.cs
rename to BrowseRouter/UriFactory.cs
diff --git a/App/UrlPreference.cs b/BrowseRouter/UrlPreference.cs
similarity index 100%
rename from App/UrlPreference.cs
rename to BrowseRouter/UrlPreference.cs
diff --git a/App/UrlPreferenceExtensions.cs b/BrowseRouter/UrlPreferenceExtensions.cs
similarity index 100%
rename from App/UrlPreferenceExtensions.cs
rename to BrowseRouter/UrlPreferenceExtensions.cs
diff --git a/App/app.manifest b/BrowseRouter/app.manifest
similarity index 100%
rename from App/app.manifest
rename to BrowseRouter/app.manifest
diff --git a/App/config.ini b/BrowseRouter/config.ini
similarity index 100%
rename from App/config.ini
rename to BrowseRouter/config.ini
diff --git a/BrowseRouter/logo.ico b/BrowseRouter/logo.ico
new file mode 100644
index 0000000..eb90ca3
Binary files /dev/null and b/BrowseRouter/logo.ico differ
diff --git a/BrowseRouter/logo.png b/BrowseRouter/logo.png
new file mode 100644
index 0000000..ebbc5a6
Binary files /dev/null and b/BrowseRouter/logo.png differ
diff --git a/App/Decode-FromBase64.ps1 b/Decode-FromBase64.ps1
similarity index 100%
rename from App/Decode-FromBase64.ps1
rename to Decode-FromBase64.ps1
diff --git a/Directory.Build.props b/Directory.Build.props
new file mode 100644
index 0000000..b3828b5
--- /dev/null
+++ b/Directory.Build.props
@@ -0,0 +1,24 @@
+
+
+ 4
+
+
+ enable
+ enable
+ latest
+ 0.11.0
+ BrowseRouter
+ EnduraByte LLC 2024
+
+ true
+
+
+
+
+ embedded
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Get-ProjectVersion.ps1 b/Get-ProjectVersion.ps1
new file mode 100644
index 0000000..1a7646e
--- /dev/null
+++ b/Get-ProjectVersion.ps1
@@ -0,0 +1,8 @@
+param (
+ [string]$ProjectPath
+)
+
+$output = dotnet msbuild $ProjectPath -target:GetVersion -nologo -q
+$version = $output.Trim()
+
+return $version
diff --git a/Publish-And-Sign.ps1 b/Publish-And-Sign.ps1
new file mode 100644
index 0000000..b1a7b5e
--- /dev/null
+++ b/Publish-And-Sign.ps1
@@ -0,0 +1,15 @@
+param (
+ [string]$ExeName,
+ [string]$CertPath
+)
+
+$certKey = $env:ENDURABYTE_WINDOWS_CODE_SIGN_KEY
+$signTool = "C:\Program Files (x86)\Windows Kits\10\App Certification Kit\signtool.exe"
+$rids = @("win-x64", "win-arm64")
+
+# dotnet does not support publishing multiple RIDs in parallel
+foreach ($rid in $rids) {
+ dotnet publish /p:PublishProfile=$rid --configuration Release
+ . $signTool sign /f "$CertPath" /fd SHA256 /td SHA256 /tr http://timestamp.digicert.com `
+ /csp "SafeNet Smart Card Key Storage Provider" /k $certKey /v "./publish/$rid/$ExeName"
+}
\ No newline at end of file
diff --git a/Register/Program.cs b/Register/Program.cs
new file mode 100644
index 0000000..f5db0b2
--- /dev/null
+++ b/Register/Program.cs
@@ -0,0 +1,9 @@
+using System.Diagnostics;
+
+Process.Start(new ProcessStartInfo
+{
+ FileName = "BrowseRouter",
+ Arguments = "", // No args means register
+ UseShellExecute = true
+});
+
diff --git a/Register/Properties/PublishProfiles/win-arm64.pubxml b/Register/Properties/PublishProfiles/win-arm64.pubxml
new file mode 100644
index 0000000..be2534d
--- /dev/null
+++ b/Register/Properties/PublishProfiles/win-arm64.pubxml
@@ -0,0 +1,17 @@
+
+
+
+
+ Release
+ Any CPU
+ publish\win-arm64
+ FileSystem
+ net8.0-windows
+ win-arm64
+ true
+ true
+ true
+
+
\ No newline at end of file
diff --git a/Register/Properties/PublishProfiles/win-x64.pubxml b/Register/Properties/PublishProfiles/win-x64.pubxml
new file mode 100644
index 0000000..b21742c
--- /dev/null
+++ b/Register/Properties/PublishProfiles/win-x64.pubxml
@@ -0,0 +1,17 @@
+
+
+
+
+ Release
+ x64
+ publish\win-x64
+ FileSystem
+ net8.0-windows
+ win-x64
+ true
+ true
+ true
+
+
\ No newline at end of file
diff --git a/Register/Register.csproj b/Register/Register.csproj
new file mode 100644
index 0000000..09e5464
--- /dev/null
+++ b/Register/Register.csproj
@@ -0,0 +1,10 @@
+
+
+
+ WinExe
+ net8.0
+ true
+ logo.ico
+
+
+
diff --git a/Register/logo.ico b/Register/logo.ico
new file mode 100644
index 0000000..5b34a4a
Binary files /dev/null and b/Register/logo.ico differ
diff --git a/Tests/BrowserRouter.Tests/BrowserRouter.Tests.csproj b/Tests/BrowserRouter.Tests/BrowserRouter.Tests.csproj
index 6345843..58d12cb 100644
--- a/Tests/BrowserRouter.Tests/BrowserRouter.Tests.csproj
+++ b/Tests/BrowserRouter.Tests/BrowserRouter.Tests.csproj
@@ -16,7 +16,7 @@
-
+
diff --git a/Unregister/Program.cs b/Unregister/Program.cs
new file mode 100644
index 0000000..ffe11d6
--- /dev/null
+++ b/Unregister/Program.cs
@@ -0,0 +1,9 @@
+using System.Diagnostics;
+
+Process.Start(new ProcessStartInfo
+{
+ FileName = "BrowseRouter",
+ Arguments = "--unregister",
+ UseShellExecute = true
+});
+
diff --git a/Unregister/Properties/PublishProfiles/win-arm64.pubxml b/Unregister/Properties/PublishProfiles/win-arm64.pubxml
new file mode 100644
index 0000000..be2534d
--- /dev/null
+++ b/Unregister/Properties/PublishProfiles/win-arm64.pubxml
@@ -0,0 +1,17 @@
+
+
+
+
+ Release
+ Any CPU
+ publish\win-arm64
+ FileSystem
+ net8.0-windows
+ win-arm64
+ true
+ true
+ true
+
+
\ No newline at end of file
diff --git a/Unregister/Properties/PublishProfiles/win-x64.pubxml b/Unregister/Properties/PublishProfiles/win-x64.pubxml
new file mode 100644
index 0000000..b21742c
--- /dev/null
+++ b/Unregister/Properties/PublishProfiles/win-x64.pubxml
@@ -0,0 +1,17 @@
+
+
+
+
+ Release
+ x64
+ publish\win-x64
+ FileSystem
+ net8.0-windows
+ win-x64
+ true
+ true
+ true
+
+
\ No newline at end of file
diff --git a/Unregister/Unregister.csproj b/Unregister/Unregister.csproj
new file mode 100644
index 0000000..09e5464
--- /dev/null
+++ b/Unregister/Unregister.csproj
@@ -0,0 +1,10 @@
+
+
+
+ WinExe
+ net8.0
+ true
+ logo.ico
+
+
+
diff --git a/Unregister/logo.ico b/Unregister/logo.ico
new file mode 100644
index 0000000..4bc012e
Binary files /dev/null and b/Unregister/logo.ico differ
diff --git a/make.ps1 b/make.ps1
new file mode 100644
index 0000000..ed20d7c
--- /dev/null
+++ b/make.ps1
@@ -0,0 +1,55 @@
+$jobs = @()
+$apps = @("BrowseRouter", "Unregister", "Register")
+$rids = @("win-x64", "win-arm64")
+
+$version = & ./Get-ProjectVersion.ps1 BrowseRouter
+
+$certTmpPath = "cert.tmp.crt"
+
+& ./Decode-FromBase64.ps1 $env:ENDURABYTE_WINDOWS_CODE_SIGN_CERTIFICATE $certTmpPath
+$certTmpPath = "$PSScriptRoot/$certTmpPath"
+
+foreach ($app in $apps) {
+ echo "Packing $app..."
+ $job = Start-ThreadJob {
+ # Create thread-local copies of these variables
+ $certTmpPath = $using:certTmpPath
+ $app = $using:app
+
+ & {
+ pushd $app
+ & ../Publish-And-Sign.ps1 "$app.exe" $certTmpPath
+ popd
+
+ if ($LASTEXITCODE -ne 0) {
+ exit $LASTEXITCODE
+ }
+
+ # Redirect all output (including stdout and stderr) to the main thread
+ # so it appears in the console and in CI build logs
+ } *>&1 | ForEach-Object { "[$app] $_" } | Out-Host
+
+ } -StreamingHost $Host
+
+ # Add the job to the list
+ $jobs += $job
+}
+
+# Wait for all jobs to complete
+Wait-Job -Job $jobs
+
+rm $certTmpPath
+
+# Create release zip files
+foreach ($rid in $rids) {
+ $outDir = "./Releases/$version/$rid"
+ md $outDir -ea 0
+ cp ./BrowseRouter/logo.ico $outDir
+ cp ./BrowseRouter/publish/$rid/BrowseRouter.exe $outDir
+ cp ./BrowseRouter/publish/$rid/config.ini $outDir
+ cp ./Unregister/publish/$rid/Unregister.exe $outDir
+ cp ./Register/publish/$rid/Register.exe $outDir
+
+ $zipPath = "$outDir/BrowseRouter-$rid.zip"
+ Compress-Archive -Path "$outDir/*" -DestinationPath $zipPath -Force
+}