Skip to content

Commit

Permalink
modify: install.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
MapoMagpie committed Feb 10, 2024
1 parent a42b5cb commit e2ba8a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
/.idea
/rimedi*
rimedm
rimedm.exe

dist/
22 changes: 7 additions & 15 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if ([Environment]::Is64BitProcess) {
$arch = "i386"
}

$BinDir = "$Home\bin"
$BinDir = "$Home\Appdata\Local\Programs\rimedm"
$downloadedTagGz = "$BinDir\${exeName}.zip"
$downloadedExe = "$BinDir\${exeName}.exe"
$Target = "Windows_$arch"
Expand Down Expand Up @@ -58,26 +58,18 @@ function Check-Command {
catch [System.Management.Automation.CommandNotFoundException]
{
$found = $false
}
anakan
}

$found
}

if (Check-Command -Command tar) {
Invoke-Expression "tar -xvzf $downloadedTagGz -C $BinDir"
} else {
function Expand-Tar($tarFile, $dest) {

if (-not (Get-Command Expand-7Zip -ErrorAction Ignore)) {
Install-Package -Scope CurrentUser -Force 7Zip4PowerShell > $null
}

Expand-7Zip $tarFile $dest
}

Expand-Tar $downloadedTagGz $BinDir
function Unzip($zipFile, $dest) {
Expand-Archive -Force -Path $zipFile -DestinationPath $dest
}

Unzip $downloadedTagGz $BinDir

Remove-Item $downloadedTagGz

$User = [EnvironmentVariableTarget]::User
Expand Down

0 comments on commit e2ba8a9

Please sign in to comment.