Skip to content

Instantly share code, notes, and snippets.

@maphew
Last active October 16, 2023 04:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maphew/fe6e5c2ccbf48fc82d84b4230e476899 to your computer and use it in GitHub Desktop.
Save maphew/fe6e5c2ccbf48fc82d84b4230e476899 to your computer and use it in GitHub Desktop.
**Install Leo on Windows Recipe**. Choose among the .cmd for installing from code download, using git, or pypi release. The last one, `Install-Leo`, has all 3 in one file, so don't run as is.
:: Install Leo on windows recipe by matt wilkie
:: Requires App Installer from Microsoft Store be installed first
:: opinionated personal preferences, adjust to suit
::
winget install wget
winget install gsudo
md c:\bin
wget https://raw.githubusercontent.com/chocolatey/choco/blob/master/src/chocolatey.resources/redirects/RefreshEnv.cmd -O c:\bin\RefreshEnv.cmd
sudo setx /M path %path%;c:\bin
winget install --id Python.Launcher --exact --force
winget install python.python.3.12 --location c:\apps\python
refreshenv
py -0
where python
sudo setx /M PIPX_BIN_DIR C:\bin
sudo setx /M PIPX_HOME C:\apps\pipx
c:\apps\python\python.exe -m pip install pipx
c:\apps\python\python.exe -m pipx ensurepath
refreshenv
:: install latest development from source code download
winget install 7zip
pushd %userprofile%\Downloads
wget https://github.com/leo-editor/leo-editor/archive/devel.zip
7z x devel.zip -o C:\apps
pipx install --editable C:\apps\leo-editor-devel
pipx inject leo websockets
leo-messages --version
:: run Leo to create profile and related, and then exit
Leo
:: Register Leo with Windows
leo-m --script=C:\apps\pipx\venvs\leo\Lib\site-packages\leo\scripts\add-desktop-links.leox
leo-m --script=C:\apps\pipx\venvs\leo\Lib\site-packages\leo\scripts\win\register-leo.leox
:: Install Leo on windows recipe by matt wilkie
:: Requires App Installer from Microsoft Store be installed first
:: opinionated personal preferences, adjust to suit
::
winget install wget
winget install gsudo
md c:\bin
wget https://raw.githubusercontent.com/chocolatey/choco/blob/master/src/chocolatey.resources/redirects/RefreshEnv.cmd -O c:\bin\RefreshEnv.cmd
sudo setx /M path %path%;c:\bin
winget install --id Python.Launcher --exact --force
:: python v3.11 required for non-dev Leo until next Leo release
:: https://github.com/leo-editor/leo-editor/issues/3615
winget install python.python.3.11 --location c:\apps\python
refreshenv
py -0
where python
sudo setx /M PIPX_BIN_DIR C:\bin
sudo setx /M PIPX_HOME C:\apps\pipx
c:\apps\python\python.exe -m pip install pipx
c:\apps\python\python.exe -m pipx ensurepath
refreshenv
:: Install latest stable release from pypi.org
pipx install leo
pipx inject leo websockets
leo-messages --version
:: run Leo to create profile and related, and then exit
Leo
:: Register Leo with Windows
leo-m --script=C:\apps\pipx\venvs\leo\Lib\site-packages\leo\scripts\add-desktop-links.leox
leo-m --script=C:\apps\pipx\venvs\leo\Lib\site-packages\leo\scripts\win\register-leo.leox
:: Install Leo on windows recipe by matt wilkie
:: Requires App Installer from Microsoft Store be installed first
:: opinionated personal preferences, adjust to suit
::
winget install wget
winget install gsudo
md c:\bin
wget https://raw.githubusercontent.com/chocolatey/choco/blob/master/src/chocolatey.resources/redirects/RefreshEnv.cmd -O c:\bin\RefreshEnv.cmd
sudo setx /M path %path%;c:\bin
winget install --id Python.Launcher --exact --force
winget install python.python.3.12 --location c:\apps\python
refreshenv
py -0
where python
sudo setx /M PIPX_BIN_DIR C:\bin
sudo setx /M PIPX_HOME C:\apps\pipx
c:\apps\python\python.exe -m pip install pipx
c:\apps\python\python.exe -m pipx ensurepath
refreshenv
:: Or install latest development from GitHub with git
pushd %userprofile%\code
git clone --depth=50 --no-single-branch https://github.com/leo-editor/leo-editor
pipx install --editable ./leo-editor
pipx inject leo websockets
leo-messages --version
:: run Leo to create profile and related, and then exit
Leo
:: Register Leo with Windows
leo-m --script=C:\apps\pipx\venvs\leo\Lib\site-packages\leo\scripts\add-desktop-links.leox
leo-m --script=C:\apps\pipx\venvs\leo\Lib\site-packages\leo\scripts\win\register-leo.leox
:: Install Leo on windows recipe by matt wilkie
:: Requires App Installer from Microsoft Store be installed first
:: opinionated personal preferences, adjust to suit
::
winget install wget
winget install gsudo
md c:\bin
wget https://raw.githubusercontent.com/chocolatey/choco/blob/master/src/chocolatey.resources/redirects/RefreshEnv.cmd -O c:\bin\RefreshEnv.cmd
sudo setx /M path %path%;c:\bin
winget install --id Python.Launcher --exact --force
winget install python.python.3.12 --location c:\apps\python
refreshenv
py -0
where python
sudo setx /M PIPX_BIN_DIR C:\bin
sudo setx /M PIPX_HOME C:\apps\pipx
c:\apps\python\python.exe -m pip install pipx
c:\apps\python\python.exe -m pipx ensurepath
refreshenv
:::: Choose (delete/comment out ones not wanted):
:: Install latest stable release from pypi.org
pipx install leo
Or:
:: Or install latest development from GitHub with git
pushd %userprofile%\code
git clone --depth=50 --no-single-branch https://github.com/leo-editor/leo-editor
pipx install --editable ./leo-editor
Or:
:: Or install latest development from source code download
winget install 7zip
pushd %userprofile%\Downloads
wget https://github.com/leo-editor/leo-editor/archive/devel.zip
7z x devel.zip -o C:\apps
pipx install --editable C:\apps\leo-editor-devel
:::: Resume
pipx inject leo websockets
leo-messages --version
:: run Leo to create profile and related, and then exit
Leo
:: Register Leo with Windows
leo-m --script=C:\apps\pipx\venvs\leo\Lib\site-packages\leo\scripts\add-desktop-links.leox
leo-m --script=C:\apps\pipx\venvs\leo\Lib\site-packages\leo\scripts\win\register-leo.leox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment