mirror of
https://github.com/dikeckaan/mu300-linux.git
synced 2026-12-05 16:03:51 +00:00
Fixes #3. Tested on Windows 11 with Windows PowerShell 5.1 and the Microsoft Store's Python 3.12.10: * Python was never found: the wrapper function is called Python, command lookup is case-insensitive and functions win, so Get-Command python inside it returned the function itself (no .Source, no .Path) and the loop stopped there. It now asks for applications only (-CommandType Application). * With ErrorActionPreference Stop, Windows PowerShell 5.1 turns every stderr line of a redirected native command into a terminating error: adb's "daemon not running", "no devices" and push progress each aborted the script where it should have gone on or printed its own message. Such calls go through Quiet { } now, which runs them with Continue and drops stderr. * adb get-state with no device prints nothing, and -notmatch on that empty result is falsy, so "no device" read as "device present" and the script went on to a misleading "su does not work". AdbState returns a string. * powershell -File left $PSScriptRoot empty in the param() default and Join-Path failed on the first line. The work directory is worked out in the body now. * install.cmd / uninstall.cmd start the scripts from cmd.exe or a double-click without touching the execution policy, and pass the arguments and the exit code through. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
5 lines
212 B
Batchfile
5 lines
212 B
Batchfile
@echo off
|
|
rem Run install.ps1 from cmd.exe or by double-click, without changing the PowerShell execution policy.
|
|
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0install.ps1" %*
|
|
exit /b %ERRORLEVEL%
|