Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo off
- set OWNPATH=%~dp0
- set PLATFORM=mswin
- if defined ProgramFiles(x86) set PLATFORM=win64
- if "%PROCESSOR_ARCHITECTURE%"=="AMD64" set PLATFORM=win64
- if exist "%OWNPATH%tex\texmf-mswin\bin\context.exe" set PLATFORM=mswin
- if exist "%OWNPATH%tex\texmf-win64\bin\context.exe" set PLATFORM=win64
- echo %PATH% | findstr "texmf-%PLATFORM%" > nul
- rem Only update the PATH if not previously updated
- if ERRORLEVEL 1 (
- set Key="HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
- set "CurrPath="
- for /F "USEBACKQ tokens=2*" %%A in (`reg query %%Key%% /v PATH`) do (
- if not "%%~B" == "" (
- rem Preserve the existing PATH
- echo %%B > currpath.txt
- rem Update the current session
- set PATH=%PATH%;%OWNPATH%tex\texmf-%PLATFORM%\bin
- rem Change the PATH environment variable
- setx PATH "%%B;%OWNPATH%tex\texmf-%PLATFORM%\bin" /M
- )
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement