Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.3] - 2026-02-21

### Security
- fixed one line installers security issues.

Copilot AI Feb 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changelog entry is grammatically incorrect and inconsistent with the style of the rest of the file. Consider: "Fixed one-line installer security issues." (capitalization + hyphenation, and no trailing period if following the existing bullet style).

Suggested change
- fixed one line installers security issues.
- Fixed one-line installer security issues.

Copilot uses AI. Check for mistakes.

## [0.1.2] - 2026-02-21

### Added
Expand Down
65 changes: 62 additions & 3 deletions install.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,63 @@
@echo off
setlocal
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0install.ps1" %*
exit /b %errorlevel%
::
:: pichu installer bootstrap for Windows (CMD).
:: Delegates to install.ps1, either from a local copy or downloaded from GitHub.
::
:: Configure via environment variables before running this script:
:: PICHU_ALIAS, PICHU_NO_MODIFY_PATH, PICHU_INSTALL_DIR, PICHU_VERSION
:: Or invoke install.ps1 directly from PowerShell to pass parameters.
::
setlocal EnableExtensions DisableDelayedExpansion

:: ── UTF-8 code page ─────────────────────────────────────────────────────────
chcp 65001 > nul

:: ── Prefer a local copy of install.ps1 ──────────────────────────────────────
set "LOCAL_SCRIPT=%~dp0install.ps1"
if exist "%LOCAL_SCRIPT%" (
powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass ^
-File "%LOCAL_SCRIPT%"
exit /b %errorlevel%
Comment on lines +17 to +20

Copilot AI Feb 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The local install.ps1 invocation does not forward %*, so CMD arguments are dropped (regression vs previous version). Append %* after the -File invocation so users can pass through PowerShell parameters.

Copilot uses AI. Check for mistakes.
)

:: ── Download to a temporary file ──────────────────────────────────────────────
for /f "usebackq delims=" %%T in (
`powershell.exe -NoProfile -NonInteractive -Command "[System.IO.Path]::GetTempFileName()"`
) do set "TEMP_BASE=%%T"

if not defined TEMP_BASE (
echo error: Failed to allocate a temporary file. >&2
exit /b 1
)

del /f /q "%TEMP_BASE%" >nul 2>&1
set "REMOTE_SCRIPT=%TEMP_BASE%.ps1"

:: ── Download ─────────────────────────────────────────────────────────────────
curl.exe --proto "=https" --tlsv1.2 -fsSL --max-filesize 1048576 ^
"https://raw.githubusercontent.com/yeabwang/pichu/main/install.ps1" ^
-o "%REMOTE_SCRIPT%"

if errorlevel 1 (
echo error: Failed to download install.ps1. >&2
del /f /q "%REMOTE_SCRIPT%" > nul 2>&1
exit /b 1
)

:: ── Verify downloaded file is non-empty ────────────────────────────────────────
for %%A in ("%REMOTE_SCRIPT%") do if %%~zA EQU 0 (
echo error: Downloaded install.ps1 is empty. >&2
del /f /q "%REMOTE_SCRIPT%" > nul 2>&1
exit /b 1
)

:: ── Execute ───────────────────────────────────────────────────────────────────
powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass ^
-File "%REMOTE_SCRIPT%"
Comment on lines +55 to +56

Copilot AI Feb 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The downloaded install.ps1 invocation does not forward %*, so CMD arguments are dropped. Append %* after the -File invocation to preserve passed arguments.

Copilot uses AI. Check for mistakes.

set "PS_EXIT=%errorlevel%"

:: ── Cleanup ───────────────────────────────────────────────────────────────────
del /f /q "%REMOTE_SCRIPT%" > nul 2>&1

exit /b %PS_EXIT%
Loading
Loading