diff --git a/.gitignore b/.gitignore index 5d52bd8..800131f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ /.idea /rimedi* rimedm +rimedm.exe dist/ diff --git a/install.ps1 b/install.ps1 index 16ef00b..0a17f2d 100644 --- a/install.ps1 +++ b/install.ps1 @@ -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" @@ -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