File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ param (
2+ [string ]$KeyPath = " $HOME \.tauri\devstack.key" ,
3+ [string ]$PubKeyPath = " $HOME \.tauri\devstack.key.pub" ,
4+ [string ]$Password ,
5+ [string ]$Endpoint = " https://github.com/holdon1996/dev-stack/releases/latest/download/latest.json"
6+ )
7+
8+ if (-not (Test-Path - LiteralPath $KeyPath )) {
9+ throw " Private key not found: $KeyPath "
10+ }
11+
12+ if (-not (Test-Path - LiteralPath $PubKeyPath )) {
13+ throw " Public key not found: $PubKeyPath "
14+ }
15+
16+ if ([string ]::IsNullOrWhiteSpace($Password )) {
17+ $secure = Read-Host " Enter updater key password" - AsSecureString
18+ $bstr = [Runtime.InteropServices.Marshal ]::SecureStringToBSTR($secure )
19+ try {
20+ $Password = [Runtime.InteropServices.Marshal ]::PtrToStringBSTR($bstr )
21+ } finally {
22+ [Runtime.InteropServices.Marshal ]::ZeroFreeBSTR($bstr )
23+ }
24+ }
25+
26+ $env: TAURI_SIGNING_PRIVATE_KEY = $KeyPath
27+ $env: TAURI_SIGNING_PRIVATE_KEY_PASSWORD = $Password
28+ $env: TAURI_UPDATER_PUBKEY = Get-Content - LiteralPath $PubKeyPath - Raw
29+ $env: TAURI_UPDATER_ENDPOINT = $Endpoint
30+
31+ Write-Host " Updater build environment is ready for this PowerShell session." - ForegroundColor Green
32+ Write-Host " TAURI_SIGNING_PRIVATE_KEY=$env: TAURI_SIGNING_PRIVATE_KEY "
33+ Write-Host " TAURI_UPDATER_ENDPOINT=$env: TAURI_UPDATER_ENDPOINT "
Original file line number Diff line number Diff line change 5151 "shell" : {},
5252 "fs" : {},
5353 "updater" : {
54+ "pubkey" : " dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDIwMEI4NDcyNzY2OTMwQ0MKUldUTU1HbDJjb1FMSUNpSmsrZzdGL3hjSDVpaGgwSTFWS3VnclB4ZGR5YTdrYW1CTElWekpPSzQK" ,
55+ "endpoints" : [
56+ " https://github.com/holdon1996/dev-stack/releases/latest/download/latest.json"
57+ ],
5458 "windows" : {
5559 "installMode" : " passive"
5660 }
You can’t perform that action at this time.
0 commit comments