-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c22651
commit 1e68f45
Showing
4 changed files
with
98 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ jobs: | |
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
|
@@ -51,31 +51,54 @@ jobs: | |
Configuration: ${{ matrix.configuration }} | ||
|
||
# Decode the base 64 encoded pfx and save the Signing_Certificate | ||
- name: Decode the pfx And Password | ||
- name: Decode the pfx and Password | ||
run: | | ||
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.BASE64_ENCODED_PFX }}") | ||
$certificatePath = "${{ github.workspace }}\src\AniMoe.App\AniMoe.App_TemporaryKey.pfx" | ||
[IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte) | ||
# Create the app package by building and packaging the project | ||
- name: Create the app package | ||
run: msbuild $env:Solution_Name /p:PackageCertificatePassword=$env:Password /p:Configuration=$env:Configuration /p:Platform=$env:Platform /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=AniMoe.App_TemporaryKey.pfx /p:AppxPackageDir="$env:Appx_Package_Dir" /p:GenerateAppxPackageOnBuild=true | ||
run: msbuild $env:Solution_Name /p:Configuration=$env:Configuration /p:Platform=$env:Platform | ||
/p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle | ||
/p:AppxPackageTestDir="$env:Appx_Package_Dir" /p:GenerateAppxPackageOnBuild=true | ||
env: | ||
Appx_Bundle: Never | ||
Appx_Package_Build_Mode: SideloadOnly | ||
Appx_Package_Dir: Packages\ | ||
Configuration: ${{ matrix.configuration }} | ||
Platform: ${{ matrix.platform }} | ||
Password: ${{ secrets.CERT_PASSWORD }} | ||
|
||
# Rename the MSIX bundle for convinience | ||
- name: Rename MSIX App | ||
run: mv ${{ github.workspace }}\\src\AniMoe.App\Packages\**.msix ${{ github.workspace }}\\src\AniMoe.App\Packages\AniMoe.App.msix | ||
|
||
# Sign the MSIX using a self signed certificate | ||
- name: Sign MSIX App | ||
shell: cmd | ||
run: | | ||
"C:/Program Files (x86)/Windows Kits/10/bin/10.0.22621.0//x86/signtool.exe" sign /fd sha256 /f ${{ github.workspace }}\src\AniMoe.App\AniMoe.App_TemporaryKey.pfx /p ${{ secrets.CERT_PASSWORD }} ${{ github.workspace }}\\src\AniMoe.App\Packages\AniMoe.App.msix | ||
- name: Create INNO Installer Binary | ||
uses: Minionguyjpro/[email protected] | ||
with: | ||
path: ${{ github.workspace }}\\animoe-installer.iss | ||
|
||
- name: Sign the Installer | ||
shell: cmd | ||
run: | | ||
"C:/Program Files (x86)/Windows Kits/10/bin/10.0.22621.0//x86/signtool.exe" sign /fd sha256 /f ${{ github.workspace }}\src\AniMoe.App\AniMoe.App_TemporaryKey.pfx /p ${{ secrets.CERT_PASSWORD }} ${{ github.workspace }}\setup.exe | ||
# Remove the pfx | ||
- name: Remove the pfx | ||
run: Remove-Item -path ${{ github.workspace }}\\src\AniMoe.App\AniMoe.App_TemporaryKey.pfx | ||
|
||
run: Remove-Item -path ${{ github.workspace }}\\src\AniMoe.App\AniMoe.App_TemporaryKey.pfx | ||
|
||
# Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact | ||
- name: Upload MSIX package | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: WinUI3 MSIX Package | ||
path: ${{ github.workspace }}\\src\AniMoe.App\Packages | ||
path: | | ||
${{ github.workspace }}\\src\AniMoe.App\Packages\AniMoe.App.msix | ||
${{ github.workspace }}\setup.exe | ||
${{ github.workspace }}\AniMoe_Certificate.cer |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
[Setup] | ||
PrivilegesRequired=admin | ||
AppPublisher=Cosmic Predator | ||
AppPublisherURL=https://github.com/CosmicPredator/AniMoe | ||
AppName=AniMoe | ||
AppVersion=1.0 | ||
DefaultDirName={tmp}\AniMoe | ||
DefaultGroupName=AniMoe | ||
Uninstallable=no | ||
DisableDirPage=yes | ||
|
||
[Files] | ||
Source: "{tmp}\cert.cer"; DestDir:{app}; Flags: external; | ||
Source: "{tmp}\bundle.msix"; DestDir:{app}; Flags: external; | ||
|
||
[Run] | ||
Filename: "certutil.exe"; Parameters: "-addstore ""Root"" {tmp}\cert.cer"; Flags: runhidden; \ | ||
StatusMsg: "Adding trusted root publisher..." | ||
|
||
Filename: "powershell.exe"; Parameters: "Add-AppPackage -path {tmp}\bundle.msix"; Flags: runhidden; \ | ||
StatusMsg: "Installing AniMoe..." | ||
|
||
|
||
[Code] | ||
var | ||
DownloadPage: TDownloadWizardPage; | ||
function OnDownloadProgress(const Url, FileName: String; const Progress, ProgressMax: Int64): Boolean; | ||
begin | ||
if Progress = ProgressMax then | ||
Log(Format('Successfully downloaded file to {tmp}: %s', [FileName])); | ||
Result := True; | ||
end; | ||
procedure InitializeWizard; | ||
begin | ||
DownloadPage := CreateDownloadPage(SetupMessage(msgWizardPreparing), SetupMessage(msgPreparingDesc), @OnDownloadProgress); | ||
end; | ||
function NextButtonClick(CurPageID: Integer): Boolean; | ||
begin | ||
if CurPageID = wpReady then begin | ||
DownloadPage.Clear; | ||
// Use AddEx to specify a username and password | ||
DownloadPage.Add('https://github.com/CosmicPredator/AniMoe/releases/latest/download/AniMoe_Certificate.cer', 'cert.cer', ''); | ||
DownloadPage.Add('https://github.com/CosmicPredator/AniMoe/releases/latest/download/AniMoe.App.msix', 'bundle.msix', ''); | ||
DownloadPage.Show; | ||
try | ||
try | ||
DownloadPage.Download; // This downloads the files to {tmp} | ||
Result := True; | ||
except | ||
if DownloadPage.AbortedByUser then | ||
Log('Aborted by user.') | ||
else | ||
SuppressibleMsgBox(AddPeriod(GetExceptionMessage), mbCriticalError, MB_OK, IDOK); | ||
Result := False; | ||
end; | ||
finally | ||
DownloadPage.Hide; | ||
end; | ||
end else | ||
Result := True; | ||
end; |