Add cmd installer entrypoint for Windows
ci / test (push) Canceled after 0s
ci / fuzz-smoke (push) Canceled after 0s
ci / macos-client (macos-aarch64, macos-14) (push) Canceled after 0s
ci / macos-client (macos-x86_64, macos-13) (push) Canceled after 0s
ci / windows-client (push) Canceled after 0s
ci / package-release (linux-x86_64, ubuntu-latest, , , ) (push) Canceled after 0s
ci / package-release (macos-aarch64, macos-14, , , ) (push) Canceled after 0s
ci / package-release (macos-x86_64, macos-13, , , ) (push) Canceled after 0s
ci / package-release (windows-aarch64, windows-latest, aarch64, windows, aarch64-pc-windows-msvc) (push) Canceled after 0s
ci / package-release (windows-x86_64, windows-latest, , , ) (push) Canceled after 0s
ci / remote-bench (push) Canceled after 0s
ci / publish-gitea-release (push) Canceled after 0s
ci / test (push) Canceled after 0s
ci / fuzz-smoke (push) Canceled after 0s
ci / macos-client (macos-aarch64, macos-14) (push) Canceled after 0s
ci / macos-client (macos-x86_64, macos-13) (push) Canceled after 0s
ci / windows-client (push) Canceled after 0s
ci / package-release (linux-x86_64, ubuntu-latest, , , ) (push) Canceled after 0s
ci / package-release (macos-aarch64, macos-14, , , ) (push) Canceled after 0s
ci / package-release (macos-x86_64, macos-13, , , ) (push) Canceled after 0s
ci / package-release (windows-aarch64, windows-latest, aarch64, windows, aarch64-pc-windows-msvc) (push) Canceled after 0s
ci / package-release (windows-x86_64, windows-latest, , , ) (push) Canceled after 0s
ci / remote-bench (push) Canceled after 0s
ci / publish-gitea-release (push) Canceled after 0s
This commit is contained in:
@@ -37,6 +37,12 @@ Windows client:
|
||||
irm https://git.palav.dev/Palav/dosh/raw/branch/main/install.ps1 | iex
|
||||
```
|
||||
|
||||
Windows client from `cmd.exe`:
|
||||
|
||||
```bat
|
||||
curl -fsSL https://git.palav.dev/Palav/dosh/raw/branch/main/install.cmd -o "%TEMP%\dosh-install.cmd" && "%TEMP%\dosh-install.cmd"
|
||||
```
|
||||
|
||||
## Use
|
||||
|
||||
```sh
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
@echo off
|
||||
setlocal EnableExtensions
|
||||
|
||||
set "SCRIPT_URL=%DOSH_INSTALL_PS1%"
|
||||
if "%SCRIPT_URL%"=="" set "SCRIPT_URL=https://git.palav.dev/Palav/dosh/raw/branch/main/install.ps1"
|
||||
|
||||
set "PS="
|
||||
for %%P in (powershell.exe pwsh.exe powershell pwsh) do (
|
||||
if not defined PS (
|
||||
where %%P >nul 2>nul && set "PS=%%P"
|
||||
)
|
||||
)
|
||||
|
||||
if not defined PS (
|
||||
echo missing required command: powershell.exe or pwsh.exe 1>&2
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
set "TMP_PS=%TEMP%\dosh-install-%RANDOM%-%RANDOM%.ps1"
|
||||
set "DOSH_INSTALL_PS1_URL=%SCRIPT_URL%"
|
||||
set "DOSH_INSTALL_PS1_PATH=%TMP_PS%"
|
||||
|
||||
"%PS%" -NoProfile -ExecutionPolicy Bypass -Command "$ErrorActionPreference='Stop'; $ProgressPreference='SilentlyContinue'; Invoke-WebRequest -UseBasicParsing -Uri $env:DOSH_INSTALL_PS1_URL -OutFile $env:DOSH_INSTALL_PS1_PATH"
|
||||
if errorlevel 1 (
|
||||
del "%TMP_PS%" >nul 2>nul
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
"%PS%" -NoProfile -ExecutionPolicy Bypass -File "%TMP_PS%" %*
|
||||
set "RC=%ERRORLEVEL%"
|
||||
del "%TMP_PS%" >nul 2>nul
|
||||
exit /b %RC%
|
||||
@@ -235,6 +235,20 @@ fn windows_installer_bootstraps_git_for_source_fallback_like_unix() {
|
||||
assert!(!ps1.contains("Require-Command git"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn windows_cmd_installer_wraps_native_powershell_installer() {
|
||||
let cmd = include_str!("../install.cmd");
|
||||
let readme = include_str!("../README.md");
|
||||
assert!(cmd.contains("@echo off"));
|
||||
assert!(cmd.contains("https://git.palav.dev/Palav/dosh/raw/branch/main/install.ps1"));
|
||||
assert!(cmd.contains("for %%P in (powershell.exe pwsh.exe powershell pwsh) do"));
|
||||
assert!(cmd.contains("Invoke-WebRequest -UseBasicParsing"));
|
||||
assert!(cmd.contains("-ExecutionPolicy Bypass -File \"%TMP_PS%\" %*"));
|
||||
assert!(cmd.contains("exit /b %RC%"));
|
||||
assert!(readme.contains("Windows client from `cmd.exe`:"));
|
||||
assert!(readme.contains("install.cmd"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn windows_installer_honors_quiet_update_mode() {
|
||||
let ps1 = include_str!("../install.ps1");
|
||||
|
||||
Reference in New Issue
Block a user