From ce77780ebcf548b0d823af7ae240364a56fa321a Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Fri, 20 Mar 2026 22:31:41 +0800 Subject: Remove legacy jv and jvv binaries and related files --- scripts/setup/windows/inst.ps1 | 19 ----------------- scripts/setup/windows/post_inst.ps1 | 19 +++++++++++++++++ scripts/setup/windows/post_uninst.ps1 | 39 +++++++++++++++++++++++++++++++++++ scripts/setup/windows/uninst.ps1 | 39 ----------------------------------- 4 files changed, 58 insertions(+), 58 deletions(-) delete mode 100644 scripts/setup/windows/inst.ps1 create mode 100644 scripts/setup/windows/post_inst.ps1 create mode 100644 scripts/setup/windows/post_uninst.ps1 delete mode 100644 scripts/setup/windows/uninst.ps1 (limited to 'scripts/setup/windows') diff --git a/scripts/setup/windows/inst.ps1 b/scripts/setup/windows/inst.ps1 deleted file mode 100644 index 4cb4772..0000000 --- a/scripts/setup/windows/inst.ps1 +++ /dev/null @@ -1,19 +0,0 @@ -# Execute uninstall script, attempt to remove leftover PROFILE entries -. ".\uninst.ps1" - -# Calculate directories -$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path -$parentDir = Split-Path -Parent $scriptDir - -# Write configuration to PROFILE -Add-Content -Path $PROFILE -Value "# JustEnoughVCS - Begin #" -Add-Content -Path $PROFILE -Value ". `"$parentDir\jv_cli.ps1`"" -Add-Content -Path $PROFILE -Value "# JustEnoughVCS - End #" - -# Check dependencies, if OpenSSL is not found, show a prompt -try { - $null = Get-Command openssl -ErrorAction Stop -} catch { - $wshell = New-Object -ComObject Wscript.Shell - $wshell.Popup("OpenSSL was not found on your computer. JustEnoughVCS key generation depends on OpenSSL.", 0, "JustEnoughVCS Installation", 0x0 + 0x30) -} diff --git a/scripts/setup/windows/post_inst.ps1 b/scripts/setup/windows/post_inst.ps1 new file mode 100644 index 0000000..4cb4772 --- /dev/null +++ b/scripts/setup/windows/post_inst.ps1 @@ -0,0 +1,19 @@ +# Execute uninstall script, attempt to remove leftover PROFILE entries +. ".\uninst.ps1" + +# Calculate directories +$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path +$parentDir = Split-Path -Parent $scriptDir + +# Write configuration to PROFILE +Add-Content -Path $PROFILE -Value "# JustEnoughVCS - Begin #" +Add-Content -Path $PROFILE -Value ". `"$parentDir\jv_cli.ps1`"" +Add-Content -Path $PROFILE -Value "# JustEnoughVCS - End #" + +# Check dependencies, if OpenSSL is not found, show a prompt +try { + $null = Get-Command openssl -ErrorAction Stop +} catch { + $wshell = New-Object -ComObject Wscript.Shell + $wshell.Popup("OpenSSL was not found on your computer. JustEnoughVCS key generation depends on OpenSSL.", 0, "JustEnoughVCS Installation", 0x0 + 0x30) +} diff --git a/scripts/setup/windows/post_uninst.ps1 b/scripts/setup/windows/post_uninst.ps1 new file mode 100644 index 0000000..d5c898d --- /dev/null +++ b/scripts/setup/windows/post_uninst.ps1 @@ -0,0 +1,39 @@ +$profileContent = Get-Content $PROFILE -ErrorAction SilentlyContinue +if ($profileContent) { + $startMarker = "# JustEnoughVCS - Begin #" + $endMarker = "# JustEnoughVCS - End #" + $newContent = @() + $insideBlock = $false + $foundStart = $false + + foreach ($line in $profileContent) { + if ($line.Trim() -eq $startMarker) { + $insideBlock = $true + $foundStart = $true + continue + } + if ($line.Trim() -eq $endMarker) { + $insideBlock = $false + continue + } + if (-not $insideBlock) { + $newContent += $line + } + } + + if ($foundStart -and $insideBlock) { + $newContent = @() + $insideBlock = $false + foreach ($line in $profileContent) { + if ($line.Trim() -eq $startMarker) { + $insideBlock = $true + continue + } + if (-not $insideBlock) { + $newContent += $line + } + } + } + + $newContent | Set-Content $PROFILE +} diff --git a/scripts/setup/windows/uninst.ps1 b/scripts/setup/windows/uninst.ps1 deleted file mode 100644 index d5c898d..0000000 --- a/scripts/setup/windows/uninst.ps1 +++ /dev/null @@ -1,39 +0,0 @@ -$profileContent = Get-Content $PROFILE -ErrorAction SilentlyContinue -if ($profileContent) { - $startMarker = "# JustEnoughVCS - Begin #" - $endMarker = "# JustEnoughVCS - End #" - $newContent = @() - $insideBlock = $false - $foundStart = $false - - foreach ($line in $profileContent) { - if ($line.Trim() -eq $startMarker) { - $insideBlock = $true - $foundStart = $true - continue - } - if ($line.Trim() -eq $endMarker) { - $insideBlock = $false - continue - } - if (-not $insideBlock) { - $newContent += $line - } - } - - if ($foundStart -and $insideBlock) { - $newContent = @() - $insideBlock = $false - foreach ($line in $profileContent) { - if ($line.Trim() -eq $startMarker) { - $insideBlock = $true - continue - } - if (-not $insideBlock) { - $newContent += $line - } - } - } - - $newContent | Set-Content $PROFILE -} -- cgit