Skip to content

Commit

Permalink
fix: add install.ps1 to daily-release (#612)
Browse files Browse the repository at this point in the history
* fix: add install.ps1 to daily-release

* fix: run ps1 as admin
  • Loading branch information
aby913 authored Nov 8, 2024
1 parent 7c34180 commit 56b5ed9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release-daily.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ jobs:
run: |
cp .dist/install-wizard/install.sh build/installer
cp build/installer/install.sh build/installer/publicInstaller.sh
cp .dist/install-wizard/install.ps1 build/installer
- name: Release public files
uses: softprops/action-gh-release@v1
Expand All @@ -136,6 +137,7 @@ jobs:
install-wizard-v${{ steps.vars.outputs.tag_version }}.tar.gz
build/installer/publicInstaller.sh
build/installer/install.sh
build/installer/install.ps1
build/installer/publicAddnode.sh
build/installer/version.hint
build/installer/publicRestoreInstaller.sh
Expand Down
18 changes: 7 additions & 11 deletions build/installer/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,16 @@ $currentPath = Get-Location
$architecture = $env:PROCESSOR_ARCHITECTURE
$version = "#__VERSION__"

function Test-IsAdmin {
$currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
$currentUser.IsInRole("Administrators")
}

if (-Not (Test-IsAdmin)) {
Write-Host "Not running as Administrator"
exit 1
function Test-Wait {
while ($true) {
Start-Sleep -Seconds 1
}
}

$process = Get-Process -Name olares-cli -ErrorAction SilentlyContinue
if ($process) {
Write-Host "olares-cli.exe is running, exit."
exit 1
Write-Host "olares-cli.exe is running, Press Ctrl+C to exit."
Test-Wait
}

$arch = "amd64"
Expand Down Expand Up @@ -48,4 +44,4 @@ wsl --unregister Ubuntu *> $null
Start-Sleep -Seconds 3
$arguments = @("terminus", "install", "--version", $version)
Write-Host ("Preparing to start the installation of Olares {0}. Depending on your network conditions, this process may take several minutes." -f $version)
Start-Process -FilePath $cliPath -ArgumentList $arguments -Wait
Start-Process -FilePath $cliPath -ArgumentList $arguments -Wait -Verb RunAs

0 comments on commit 56b5ed9

Please sign in to comment.