- scripts/install-windows.ps1: exe в %LOCALAPPDATA%\Programs\Qulyp + ярлык (-Desktop, -Uninstall) - scripts/install-linux.sh: ~/.local/bin + .desktop + SVG-иконка (--uninstall) - build.rs вшивает иконку и описание в exe через winresource - Растр иконки вынесен в src/icon_pixels.rs (общий для окна и build.rs) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
49 lines
2.4 KiB
PowerShell
49 lines
2.4 KiB
PowerShell
# Установка Qulyp для текущего пользователя (права администратора не нужны):
|
|
# exe -> %LOCALAPPDATA%\Programs\Qulyp\qulyp.exe
|
|
# ярлык в меню «Пуск» -> находится поиском Windows по слову «Qulyp»
|
|
#
|
|
# powershell -ExecutionPolicy Bypass -File scripts\install-windows.ps1 # установить / обновить
|
|
# powershell -ExecutionPolicy Bypass -File scripts\install-windows.ps1 -Desktop # + ярлык на рабочем столе
|
|
# powershell -ExecutionPolicy Bypass -File scripts\install-windows.ps1 -Uninstall # удалить программу (хранилища не трогаются)
|
|
param([switch]$Desktop, [switch]$Uninstall)
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
$root = Split-Path $PSScriptRoot -Parent
|
|
$dest = Join-Path $env:LOCALAPPDATA 'Programs\Qulyp'
|
|
$startLnk = Join-Path ([Environment]::GetFolderPath('Programs')) 'Qulyp.lnk'
|
|
$deskLnk = Join-Path ([Environment]::GetFolderPath('Desktop')) 'Qulyp.lnk'
|
|
|
|
if ($Uninstall) {
|
|
Get-Process qulyp -ErrorAction SilentlyContinue | Where-Object { $_.Path -like "$dest*" } | Stop-Process -Force
|
|
foreach ($p in @($startLnk, $deskLnk)) { if (Test-Path $p) { Remove-Item $p -Force } }
|
|
if (Test-Path $dest) { Remove-Item $dest -Recurse -Force }
|
|
Write-Host 'Qulyp удалён. Файлы хранилищ (.qulyp) и настройки не тронуты.'
|
|
exit 0
|
|
}
|
|
|
|
Write-Host 'Сборка release…'
|
|
cargo build --release --manifest-path (Join-Path $root 'Cargo.toml')
|
|
if ($LASTEXITCODE -ne 0) { throw 'Сборка не удалась' }
|
|
|
|
$running = Get-Process qulyp -ErrorAction SilentlyContinue | Where-Object { $_.Path -like "$dest*" }
|
|
if ($running) { throw 'Закройте Qulyp перед обновлением' }
|
|
|
|
New-Item -ItemType Directory -Force $dest | Out-Null
|
|
$exe = Join-Path $dest 'qulyp.exe'
|
|
Copy-Item (Join-Path $root 'target\release\qulyp.exe') $exe -Force
|
|
|
|
$shell = New-Object -ComObject WScript.Shell
|
|
$links = @($startLnk)
|
|
if ($Desktop) { $links += $deskLnk }
|
|
foreach ($path in $links) {
|
|
$lnk = $shell.CreateShortcut($path)
|
|
$lnk.TargetPath = $exe
|
|
$lnk.WorkingDirectory = $dest
|
|
$lnk.IconLocation = "$exe,0"
|
|
$lnk.Description = 'Qulyp — менеджер паролей'
|
|
$lnk.Save()
|
|
}
|
|
|
|
Write-Host "Готово: $exe"
|
|
Write-Host 'Найти программу: Пуск -> поиск «Qulyp».'
|