mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
parent
348cacc860
commit
971f4dfd87
|
@ -8,29 +8,23 @@ Param
|
||||||
$Version
|
$Version
|
||||||
)
|
)
|
||||||
|
|
||||||
$sign = $false
|
# Get signing certificate
|
||||||
$pfxPath = Join-Path -Path $env:RUNNER_TEMP -ChildPath "cert.pfx"
|
$pfxPath = Join-Path -Path $env:RUNNER_TEMP -ChildPath "cert.pfx"
|
||||||
$signtool = 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.22000.0/x86/signtool.exe'
|
$signtool = 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.22000.0/x86/signtool.exe'
|
||||||
if ($env:CERTIFICATE -ne "") {
|
# create a base64 encoded value of your certificate using
|
||||||
# create a base64 encoded value of your certificate using
|
# [convert]::ToBase64String((Get-Content -path "certificate.pfx" -AsByteStream))
|
||||||
# [convert]::ToBase64String((Get-Content -path "certificate.pfx" -AsByteStream))
|
# requires Windows Dev Kit 10.0.22000.0
|
||||||
# requires Windows Dev Kit 10.0.22000.0
|
$encodedBytes = [System.Convert]::FromBase64String($env:CERTIFICATE)
|
||||||
$encodedBytes = [System.Convert]::FromBase64String($env:CERTIFICATE)
|
Set-Content -Path $pfxPath -Value $encodedBytes -AsByteStream
|
||||||
Set-Content -Path $pfxPath -Value $encodedBytes -AsByteStream
|
|
||||||
$sign = $true
|
|
||||||
}
|
|
||||||
|
|
||||||
New-Item -Path "." -Name "bin" -ItemType Directory
|
New-Item -Path "." -Name "bin" -ItemType Directory
|
||||||
Copy-Item -Path "../../themes" -Destination "./bin" -Recurse
|
Copy-Item -Path "../../themes" -Destination "./bin" -Recurse
|
||||||
|
|
||||||
# download the file
|
# download the executable
|
||||||
$file = "posh-windows-$Architecture.exe"
|
$file = "posh-windows-$Architecture.exe"
|
||||||
$name = "oh-my-posh.exe"
|
$name = "oh-my-posh.exe"
|
||||||
$download = "https://github.com/jandedobbeleer/oh-my-posh/releases/download/v$Version/$($file)"
|
$download = "https://github.com/jandedobbeleer/oh-my-posh/releases/download/v$Version/$($file)"
|
||||||
Invoke-WebRequest $download -Out "./bin/$($name)"
|
Invoke-WebRequest $download -Out "./bin/$($name)"
|
||||||
if ($sign) {
|
|
||||||
& $signtool sign /f $pfxPath /p $env:CERTIFICATE_PASSWORD /fd SHA256 /t http://timestamp.digicert.com "./bin/$($name)"
|
|
||||||
}
|
|
||||||
|
|
||||||
# license
|
# license
|
||||||
Invoke-WebRequest "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/v$Version/COPYING" -Out "./bin/COPYING.txt"
|
Invoke-WebRequest "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/v$Version/COPYING" -Out "./bin/COPYING.txt"
|
||||||
|
@ -38,13 +32,10 @@ $content = Get-Content '.\oh-my-posh.iss' -Raw
|
||||||
$content = $content.Replace('<VERSION>', $Version)
|
$content = $content.Replace('<VERSION>', $Version)
|
||||||
$ISSName = ".oh-my-posh-$Architecture-$Version.iss"
|
$ISSName = ".oh-my-posh-$Architecture-$Version.iss"
|
||||||
$content | Out-File -Encoding 'UTF8' $ISSName
|
$content | Out-File -Encoding 'UTF8' $ISSName
|
||||||
|
|
||||||
# package content
|
# package content
|
||||||
$installer = "install-$Architecture"
|
$installer = "install-$Architecture"
|
||||||
ISCC.exe /F$installer $ISSName
|
ISCC.exe /F$installer "/Ssigntool=$signtool sign /f $pfxPath /p $env:CERTIFICATE_PASSWORD /fd SHA256 /t http://timestamp.digicert.com `$f" $ISSName
|
||||||
if ($sign) {
|
|
||||||
& $signtool sign /f $pfxPath /p $env:CERTIFICATE_PASSWORD /fd SHA256 /t http://timestamp.digicert.com "Output/$installer.exe"
|
|
||||||
Remove-Item -Path $pfxPath
|
|
||||||
}
|
|
||||||
# get hash
|
# get hash
|
||||||
$zipHash = Get-FileHash "Output/$installer.exe" -Algorithm SHA256
|
$zipHash = Get-FileHash "Output/$installer.exe" -Algorithm SHA256
|
||||||
$zipHash.Hash | Out-File -Encoding 'UTF8' "Output/$installer.exe.sha256"
|
$zipHash.Hash | Out-File -Encoding 'UTF8' "Output/$installer.exe.sha256"
|
||||||
|
|
|
@ -11,9 +11,11 @@ OutputBaseFilename=install
|
||||||
PrivilegesRequired=lowest
|
PrivilegesRequired=lowest
|
||||||
PrivilegesRequiredOverridesAllowed=dialog
|
PrivilegesRequiredOverridesAllowed=dialog
|
||||||
ChangesEnvironment=yes
|
ChangesEnvironment=yes
|
||||||
|
SignTool=signtool
|
||||||
|
SignedUninstaller=yes
|
||||||
|
|
||||||
[Files]
|
[Files]
|
||||||
Source: "bin\oh-my-posh.exe"; DestDir: "{app}\bin"
|
Source: "bin\oh-my-posh.exe"; DestDir: "{app}\bin"; Flags: sign
|
||||||
Source: "bin\themes\*"; DestDir: "{app}\themes"
|
Source: "bin\themes\*"; DestDir: "{app}\themes"
|
||||||
|
|
||||||
[Registry]
|
[Registry]
|
||||||
|
|
Loading…
Reference in a new issue