rt-thread env 从 CmdInit.cmd 中分离出来

This commit is contained in:
chinky 2024-02-14 15:32:15 +08:00 committed by Meco Man
parent 528b0e45ef
commit 7d3dba1c78
4 changed files with 216 additions and 90 deletions

BIN
logo.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<key name="Software"> <key name="Software">
<key name="ConEmu"> <key name="ConEmu">
<key name=".Vanilla" modified="2024-02-13 22:17:56" build="230724"> <key name=".Vanilla" modified="2024-02-14 12:44:03" build="230724">
<value name="StartType" type="hex" data="02"/> <value name="StartType" type="hex" data="02"/>
<value name="CmdLine" type="string" data=""/> <value name="CmdLine" type="string" data=""/>
<value name="StartTasksFile" type="string" data=""/> <value name="StartTasksFile" type="string" data=""/>
<value name="StartTasksName" type="string" data="{Shells::cmd}"/> <value name="StartTasksName" type="string" data="{rtt-env}"/>
<value name="StartFarFolders" type="hex" data="00"/> <value name="StartFarFolders" type="hex" data="00"/>
<value name="StartFarEditors" type="hex" data="00"/> <value name="StartFarEditors" type="hex" data="00"/>
<value name="ColorTable00" type="dword" data="00222827"/> <value name="ColorTable00" type="dword" data="00222827"/>
@ -264,11 +264,11 @@
<value name="Cascaded" type="hex" data="01"/> <value name="Cascaded" type="hex" data="01"/>
<value name="IntegralSize" type="hex" data="00"/> <value name="IntegralSize" type="hex" data="00"/>
<value name="WindowMode" type="dword" data="0000051f"/> <value name="WindowMode" type="dword" data="0000051f"/>
<value name="ConWnd X" type="long" data="469"/> <value name="ConWnd X" type="long" data="1083"/>
<value name="ConWnd Y" type="long" data="333"/> <value name="ConWnd Y" type="long" data="336"/>
<value name="LastMonitor" type="string" data="0,0,2560,1390"/> <value name="LastMonitor" type="string" data="0,0,2560,1390"/>
<value name="ConWnd Width" type="dword" data="0000007c"/> <value name="ConWnd Width" type="dword" data="0000007b"/>
<value name="ConWnd Height" type="dword" data="00000023"/> <value name="ConWnd Height" type="dword" data="00000022"/>
<value name="16bit Height" type="ulong" data="0"/> <value name="16bit Height" type="ulong" data="0"/>
<value name="StartCreateDelay" type="ulong" data="100"/> <value name="StartCreateDelay" type="ulong" data="100"/>
<value name="ExtendFonts" type="hex" data="00"/> <value name="ExtendFonts" type="hex" data="00"/>
@ -599,9 +599,18 @@
<value name="Update.DownloadPath" type="string" data="%TEMP%\ConEmu"/> <value name="Update.DownloadPath" type="string" data="%TEMP%\ConEmu"/>
<value name="Update.LeavePackages" type="hex" data="00"/> <value name="Update.LeavePackages" type="hex" data="00"/>
<value name="Update.PostUpdateCmd" type="string" data="echo Last successful update&gt;ConEmuUpdate.info &amp;&amp; date /t&gt;&gt;ConEmuUpdate.info &amp;&amp; time /t&gt;&gt;ConEmuUpdate.info"/> <value name="Update.PostUpdateCmd" type="string" data="echo Last successful update&gt;ConEmuUpdate.info &amp;&amp; date /t&gt;&gt;ConEmuUpdate.info &amp;&amp; time /t&gt;&gt;ConEmuUpdate.info"/>
<key name="Tasks" modified="2018-03-08 18:23:55" build="180206"> <key name="Tasks" modified="2024-02-13 23:54:10" build="230724">
<value name="Count" type="long" data="14"/> <value name="Count" type="long" data="22"/>
<key name="Task1" modified="2018-03-08 18:23:55" build="180206"> <key name="Task1" modified="2024-02-14 12:43:37" build="230724">
<value name="Name" type="string" data="{rtt-env}"/>
<value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data='/icon "%ConEmuBaseDir%\..\..\..\logo.ico"'/>
<value name="Active" type="long" data="0"/>
<value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data='cmd.exe /k ""%ConEmuBaseDir%\CmdInit.cmd" "%ConEmuBaseDir%\..\..\bin\env-init.bat""'/>
</key>
<key name="Task2" modified="2024-02-13 23:54:10" build="230724">
<value name="Name" type="string" data="{Shells::cmd}"/> <value name="Name" type="string" data="{Shells::cmd}"/>
<value name="Flags" type="dword" data="00000002"/> <value name="Flags" type="dword" data="00000002"/>
<value name="Hotkey" type="dword" data="00000000"/> <value name="Hotkey" type="dword" data="00000000"/>
@ -610,7 +619,7 @@
<value name="Count" type="long" data="1"/> <value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data='cmd.exe /k "%ConEmuBaseDir%\CmdInit.cmd"'/> <value name="Cmd1" type="string" data='cmd.exe /k "%ConEmuBaseDir%\CmdInit.cmd"'/>
</key> </key>
<key name="Task2" modified="2018-03-08 18:23:55" build="180206"> <key name="Task3" modified="2024-02-13 23:54:10" build="230724">
<value name="Name" type="string" data="{Shells::cmd (Admin)}"/> <value name="Name" type="string" data="{Shells::cmd (Admin)}"/>
<value name="Flags" type="dword" data="00000004"/> <value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/> <value name="Hotkey" type="dword" data="00000000"/>
@ -619,7 +628,7 @@
<value name="Count" type="long" data="1"/> <value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data='cmd.exe /k "%ConEmuBaseDir%\CmdInit.cmd" -new_console:a'/> <value name="Cmd1" type="string" data='cmd.exe /k "%ConEmuBaseDir%\CmdInit.cmd" -new_console:a'/>
</key> </key>
<key name="Task3" modified="2018-03-08 18:23:55" build="180206"> <key name="Task4" modified="2024-02-13 23:54:10" build="230724">
<value name="Name" type="string" data="{Shells::cmd-32}"/> <value name="Name" type="string" data="{Shells::cmd-32}"/>
<value name="Flags" type="dword" data="00000004"/> <value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/> <value name="Hotkey" type="dword" data="00000000"/>
@ -628,7 +637,7 @@
<value name="Count" type="long" data="1"/> <value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data='"%windir%\syswow64\cmd.exe" /k "%ConEmuBaseDir%\CmdInit.cmd"'/> <value name="Cmd1" type="string" data='"%windir%\syswow64\cmd.exe" /k "%ConEmuBaseDir%\CmdInit.cmd"'/>
</key> </key>
<key name="Task4" modified="2018-03-08 18:23:55" build="180206"> <key name="Task5" modified="2024-02-13 23:54:10" build="230724">
<value name="Name" type="string" data="{Shells::cmd 64/32}"/> <value name="Name" type="string" data="{Shells::cmd 64/32}"/>
<value name="Flags" type="dword" data="00000004"/> <value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/> <value name="Hotkey" type="dword" data="00000000"/>
@ -638,7 +647,7 @@
<value name="Cmd1" type="string" data='&gt; "%windir%\system32\cmd.exe" /k ""%ConEmuBaseDir%\CmdInit.cmd" &amp; echo This is Native cmd.exe"'/> <value name="Cmd1" type="string" data='&gt; "%windir%\system32\cmd.exe" /k ""%ConEmuBaseDir%\CmdInit.cmd" &amp; echo This is Native cmd.exe"'/>
<value name="Cmd2" type="string" data='"%windir%\syswow64\cmd.exe" /k ""%ConEmuBaseDir%\CmdInit.cmd" &amp; echo This is 32 bit cmd.exe -new_console:s50V"'/> <value name="Cmd2" type="string" data='"%windir%\syswow64\cmd.exe" /k ""%ConEmuBaseDir%\CmdInit.cmd" &amp; echo This is 32 bit cmd.exe -new_console:s50V"'/>
</key> </key>
<key name="Task5" modified="2018-03-08 18:23:55" build="180206"> <key name="Task6" modified="2024-02-13 23:54:10" build="230724">
<value name="Name" type="string" data="{Shells::PowerShell}"/> <value name="Name" type="string" data="{Shells::PowerShell}"/>
<value name="Flags" type="dword" data="00000004"/> <value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/> <value name="Hotkey" type="dword" data="00000000"/>
@ -647,7 +656,7 @@
<value name="Count" type="long" data="1"/> <value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data="powershell.exe"/> <value name="Cmd1" type="string" data="powershell.exe"/>
</key> </key>
<key name="Task6" modified="2018-03-08 18:23:55" build="180206"> <key name="Task7" modified="2024-02-13 23:54:10" build="230724">
<value name="Name" type="string" data="{Shells::PowerShell (Admin)}"/> <value name="Name" type="string" data="{Shells::PowerShell (Admin)}"/>
<value name="Flags" type="dword" data="00000004"/> <value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/> <value name="Hotkey" type="dword" data="00000000"/>
@ -656,7 +665,7 @@
<value name="Count" type="long" data="1"/> <value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data="powershell.exe -new_console:a"/> <value name="Cmd1" type="string" data="powershell.exe -new_console:a"/>
</key> </key>
<key name="Task7" modified="2018-03-08 18:23:55" build="180206"> <key name="Task8" modified="2024-02-13 23:54:10" build="230724">
<value name="Name" type="string" data="{Bash::Git bash}"/> <value name="Name" type="string" data="{Bash::Git bash}"/>
<value name="Flags" type="dword" data="00000004"/> <value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/> <value name="Hotkey" type="dword" data="00000000"/>
@ -665,7 +674,7 @@
<value name="Count" type="long" data="1"/> <value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data='set "PATH=%ConEmuDrive%\Program Files\Git\usr\bin;%PATH%" &amp; "%ConEmuDrive%\Program Files\Git\git-cmd.exe" --no-cd --command=%ConEmuBaseDirShort%\conemu-msys2-64.exe /usr/bin/bash.exe -l -i -new_console:p'/> <value name="Cmd1" type="string" data='set "PATH=%ConEmuDrive%\Program Files\Git\usr\bin;%PATH%" &amp; "%ConEmuDrive%\Program Files\Git\git-cmd.exe" --no-cd --command=%ConEmuBaseDirShort%\conemu-msys2-64.exe /usr/bin/bash.exe -l -i -new_console:p'/>
</key> </key>
<key name="Task8" modified="2018-03-08 18:23:55" build="180206"> <key name="Task9" modified="2024-02-13 23:54:10" build="230724">
<value name="Name" type="string" data="{Bash::MinGW bash}"/> <value name="Name" type="string" data="{Bash::MinGW bash}"/>
<value name="Flags" type="dword" data="00000004"/> <value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/> <value name="Hotkey" type="dword" data="00000000"/>
@ -674,7 +683,7 @@
<value name="Count" type="long" data="1"/> <value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data='set CHERE_INVOKING=1 &amp; set "PATH=%ConEmuDrive%\MinGW\msys\1.0\bin;%PATH%" &amp; %ConEmuBaseDirShort%\conemu-msys-32.exe -new_console:p %ConEmuDrive%\MinGW\msys\1.0\bin\bash.exe --login -i -new_console:C:"%ConEmuDrive%\MinGW\msys\1.0\msys.ico"'/> <value name="Cmd1" type="string" data='set CHERE_INVOKING=1 &amp; set "PATH=%ConEmuDrive%\MinGW\msys\1.0\bin;%PATH%" &amp; %ConEmuBaseDirShort%\conemu-msys-32.exe -new_console:p %ConEmuDrive%\MinGW\msys\1.0\bin\bash.exe --login -i -new_console:C:"%ConEmuDrive%\MinGW\msys\1.0\msys.ico"'/>
</key> </key>
<key name="Task9" modified="2018-03-08 18:23:55" build="180206"> <key name="Task10" modified="2024-02-13 23:54:10" build="230724">
<value name="Name" type="string" data="{Bash::Msys2-32}"/> <value name="Name" type="string" data="{Bash::Msys2-32}"/>
<value name="Flags" type="dword" data="00000004"/> <value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/> <value name="Hotkey" type="dword" data="00000000"/>
@ -683,7 +692,7 @@
<value name="Count" type="long" data="1"/> <value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data='set CHERE_INVOKING=1 &amp; set "PATH=%ConEmuDrive%\msys32\usr\bin;%PATH%" &amp; %ConEmuBaseDirShort%\conemu-msys2-32.exe -new_console:p %ConEmuDrive%\msys32\usr\bin\bash.exe --login -i -new_console:C:"%ConEmuDrive%\msys32\msys2.ico"'/> <value name="Cmd1" type="string" data='set CHERE_INVOKING=1 &amp; set "PATH=%ConEmuDrive%\msys32\usr\bin;%PATH%" &amp; %ConEmuBaseDirShort%\conemu-msys2-32.exe -new_console:p %ConEmuDrive%\msys32\usr\bin\bash.exe --login -i -new_console:C:"%ConEmuDrive%\msys32\msys2.ico"'/>
</key> </key>
<key name="Task10" modified="2018-03-08 18:23:55" build="180206"> <key name="Task11" modified="2024-02-13 23:54:10" build="230724">
<value name="Name" type="string" data="{Putty}"/> <value name="Name" type="string" data="{Putty}"/>
<value name="Flags" type="dword" data="00000004"/> <value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/> <value name="Hotkey" type="dword" data="00000000"/>
@ -692,7 +701,7 @@
<value name="Count" type="long" data="1"/> <value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data='"Putty.exe"'/> <value name="Cmd1" type="string" data='"Putty.exe"'/>
</key> </key>
<key name="Task11" modified="2018-03-08 18:23:55" build="180206"> <key name="Task12" modified="2024-02-13 23:54:10" build="230724">
<value name="Name" type="string" data="{Helper::Show ANSI colors}"/> <value name="Name" type="string" data="{Helper::Show ANSI colors}"/>
<value name="Flags" type="dword" data="00000004"/> <value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/> <value name="Hotkey" type="dword" data="00000000"/>
@ -701,7 +710,7 @@
<value name="Count" type="long" data="1"/> <value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data='cmd.exe /k type "%ConEmuBaseDir%\Addons\AnsiColors16t.ans" -cur_console:n'/> <value name="Cmd1" type="string" data='cmd.exe /k type "%ConEmuBaseDir%\Addons\AnsiColors16t.ans" -cur_console:n'/>
</key> </key>
<key name="Task12" modified="2018-03-08 18:23:55" build="180206"> <key name="Task13" modified="2024-02-13 23:54:10" build="230724">
<value name="Name" type="string" data="{SDK::VS 12.0 x86 tools prompt}"/> <value name="Name" type="string" data="{SDK::VS 12.0 x86 tools prompt}"/>
<value name="Flags" type="dword" data="00000004"/> <value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/> <value name="Hotkey" type="dword" data="00000000"/>
@ -710,7 +719,7 @@
<value name="Count" type="long" data="1"/> <value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data='cmd /k ""%ConEmuDrive%\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"" x86 -new_console:t:"VS 12.0" -new_console:C:"%CommonProgramFiles(x86)%\microsoft shared\MSEnv\VSFileHandler.dll,28"'/> <value name="Cmd1" type="string" data='cmd /k ""%ConEmuDrive%\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"" x86 -new_console:t:"VS 12.0" -new_console:C:"%CommonProgramFiles(x86)%\microsoft shared\MSEnv\VSFileHandler.dll,28"'/>
</key> </key>
<key name="Task13" modified="2018-03-08 18:23:55" build="180206"> <key name="Task14" modified="2024-02-13 23:54:10" build="230724">
<value name="Name" type="string" data="{SDK::VS 12.0 x64 tools prompt}"/> <value name="Name" type="string" data="{SDK::VS 12.0 x64 tools prompt}"/>
<value name="Flags" type="dword" data="00000004"/> <value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/> <value name="Hotkey" type="dword" data="00000000"/>
@ -719,7 +728,7 @@
<value name="Count" type="long" data="1"/> <value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data='cmd /k ""%ConEmuDrive%\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"" x64 -new_console:t:"VS 12.0" -new_console:C:"%CommonProgramFiles(x86)%\microsoft shared\MSEnv\VSFileHandler.dll,28"'/> <value name="Cmd1" type="string" data='cmd /k ""%ConEmuDrive%\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"" x64 -new_console:t:"VS 12.0" -new_console:C:"%CommonProgramFiles(x86)%\microsoft shared\MSEnv\VSFileHandler.dll,28"'/>
</key> </key>
<key name="Task14" modified="2018-03-08 18:23:55" build="180206"> <key name="Task15" modified="2024-02-13 23:54:10" build="230724">
<value name="Name" type="string" data="{Tools::Chocolatey (Admin)}"/> <value name="Name" type="string" data="{Tools::Chocolatey (Admin)}"/>
<value name="Flags" type="dword" data="00000004"/> <value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/> <value name="Hotkey" type="dword" data="00000000"/>
@ -728,6 +737,69 @@
<value name="Count" type="long" data="1"/> <value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data='*cmd.exe /k Title Chocolatey &amp; "%ConEmuBaseDir%\Addons\ChocolateyAbout.cmd"'/> <value name="Cmd1" type="string" data='*cmd.exe /k Title Chocolatey &amp; "%ConEmuBaseDir%\Addons\ChocolateyAbout.cmd"'/>
</key> </key>
<key name="Task16" modified="2024-02-13 23:54:10" build="230724">
<value name="Name" type="string" data="{Shells::PowerShell Core}"/>
<value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data=""/>
<value name="Active" type="long" data="0"/>
<value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data="pwsh.exe"/>
</key>
<key name="Task17" modified="2024-02-13 23:54:10" build="230724">
<value name="Name" type="string" data="{Shells::PowerShell Core (Admin)}"/>
<value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data=""/>
<value name="Active" type="long" data="0"/>
<value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data="pwsh.exe -new_console:a"/>
</key>
<key name="Task18" modified="2024-02-13 23:54:10" build="230724">
<value name="Name" type="string" data="{Bash::bash}"/>
<value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data=""/>
<value name="Active" type="long" data="0"/>
<value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data="%windir%\system32\wsl.exe -cur_console:pm:/mnt"/>
</key>
<key name="Task19" modified="2024-02-13 23:54:10" build="230724">
<value name="Name" type="string" data="{Bash::Msys2-64}"/>
<value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data=""/>
<value name="Active" type="long" data="0"/>
<value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data='set CHERE_INVOKING=1 &amp; set "PATH=%ConEmuDrive%\msys64\usr\bin;%PATH%" &amp; %ConEmuBaseDirShort%\conemu-msys2-64.exe -new_console:p %ConEmuDrive%\msys64\usr\bin\bash.exe --login -i -new_console:C:"%ConEmuDrive%\msys64\msys2.ico"'/>
</key>
<key name="Task20" modified="2024-02-13 23:54:10" build="230724">
<value name="Name" type="string" data="{WSL::Alpine}"/>
<value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data=""/>
<value name="Active" type="long" data="0"/>
<value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data="%windir%\system32\wsl.exe -cur_console:pm:/mnt --distribution Alpine"/>
</key>
<key name="Task21" modified="2024-02-13 23:54:10" build="230724">
<value name="Name" type="string" data="{WSL::Ubuntu}"/>
<value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data=""/>
<value name="Active" type="long" data="0"/>
<value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data="%windir%\system32\wsl.exe -cur_console:pm:/mnt --distribution Ubuntu"/>
</key>
<key name="Task22" modified="2024-02-13 23:54:10" build="230724">
<value name="Name" type="string" data="{WSL::WSL}"/>
<value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data=""/>
<value name="Active" type="long" data="0"/>
<value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data="%windir%\system32\wsl.exe -cur_console:pm:/mnt"/>
</key>
</key> </key>
<key name="Apps" modified="2018-03-08 18:23:55" build="180206"> <key name="Apps" modified="2018-03-08 18:23:55" build="180206">
<value name="Count" type="long" data="0"/> <value name="Count" type="long" data="0"/>

View File

@ -39,74 +39,6 @@ if "%ConEmuIsAdmin%" == "ADMIN" (
rem Finally reset color and add notify ConEmu about prompt input start coords rem Finally reset color and add notify ConEmu about prompt input start coords
set ConEmuPrompt3=$E[m$S$E]9;12$E\ set ConEmuPrompt3=$E[m$S$E]9;12$E\
:: ============= RT-Thread ENV Path ==================
set ENV_ROOT=%~dp0..\..\..
set PYTHONPATH=%ENV_ROOT%\tools\Python27
set PYTHONHOME=%ENV_ROOT%\tools\Python27
set RTT_EXEC_PATH=%ENV_ROOT%\tools\gnu_gcc\arm_gcc\mingw\bin
set RTT_CC=gcc
set PKGS_ROOT=%ENV_ROOT%\packages
set SCONS=%PYTHONPATH%\Scripts
set PATH=%ENV_ROOT%\tools\git-2.41.0-32-bit\cmd;%PATH%
set PATH=%ENV_ROOT%\tools\bin;%PATH%
set PATH=%RTT_EXEC_PATH%;%PATH%
set PATH=%PYTHONHOME%;%PATH%
set PATH=%PYTHONPATH%;%PATH%
set PATH=%SCONS%;%PATH%
set PATH=%ENV_ROOT%\tools\qemu\qemu64;%PATH%
:: ====== RT-Thread ENV Change Code Page ================
chcp 65001 > nul
python %~dp0..\..\scripts\env.py -v
echo ^\ ^| /
echo - RT - Thread Operating System
echo / ^| ^\
echo 2006 - 2022 Copyright by RT-Thread team
Setlocal ENABLEDELAYEDEXPANSION
::启用命令扩展参加setlocal /?命令
set str1=%~dp0
set str=%str1%
set env_root=%~dp0
:next
if not "%str%"=="" (
set /a num+=1
if "!str:~0,1!"==" " (
echo.
echo *******************************************************************
echo Env 工具所在路径如下:
echo %env_root:~0,-21%
echo 警告:以上路径不能包含中文或空格,请将 Env 移动到符合要求的路径中。
echo *******************************************************************
endlocal
goto break_str
)
set "str=%str:~1%"
goto next
)
endlocal
set "str=%~dp0"
>"%tmp%\t.t" echo;WSH.Echo(/[\u4E00-\u9FFF]/.test(WSH.Arguments(0)))
for /f %%a in ('cscript -nologo -e:jscript "%tmp%\t.t" "%str%"') do if %%a neq 0 (goto not_support_chinese) else goto break_str
:not_support_chinese
echo.
echo *******************************************************************
echo Env 工具所在路径如下:
echo %env_root:~0,-29%
echo 警告:以上路径不能包含中文或空格,请将 Env 移动到符合要求的路径中。
echo *******************************************************************
:break_str
chcp 437 > nul
:: ======================================================
rem Show 'git status' extract in prompt? rem Show 'git status' extract in prompt?
if /I "%~1" == "/git" goto git if /I "%~1" == "/git" goto git
if /I "%~1" == "-git" goto git if /I "%~1" == "-git" goto git

122
tools/bin/env-init.bat Normal file
View File

@ -0,0 +1,122 @@
@echo off
:: Do not repeat run
if not "%ENV_ROOT%" == "" goto end
:: not ConEmu
if "%ConEmuBaseDir%" == "" goto env
:: Creat user CmdInit.cmd
if not exist "%USERPROFILE%\.conemu\CmdInit.cmd" (
if not exist "%USERPROFILE%\.conemu" (
mkdir "%USERPROFILE%\.conemu"
)
(
echo rem !!! Sample user specific settings that will persist in upgrade !!!
echo rem !!! Save as "%%USERPROFILE%%\.conemu\CmdInit.cmd" to activate !!!
echo.
echo rem echo Loading ConEmu user settings...
echo.
echo rem Loading RT-Thread Env
echo if exist "%%ConEmuBaseDir%%\..\..\..\env.bat" (
echo if exist "%%ConEmuBaseDir%%\..\..\bin\env-init.bat" (
echo call "%%ConEmuBaseDir%%\..\..\bin\env-init.bat"
echo ^)
echo ^)
) > "%USERPROFILE%\.conemu\CmdInit.cmd"
echo Create user profile additions success: "%USERPROFILE%\.conemu\CmdInit.cmd"
)
:env
:: ============= RT-Thread ENV Path ==================
set ENV_ROOT=%~dp0..\..
set PYTHONPATH=%ENV_ROOT%\tools\Python27
set PYTHONHOME=%ENV_ROOT%\tools\Python27
set RTT_EXEC_PATH=%ENV_ROOT%\tools\gnu_gcc\arm_gcc\mingw\bin
set RTT_CC=gcc
set PKGS_ROOT=%ENV_ROOT%\packages
set SCONS=%PYTHONPATH%\Scripts
:: Add to %PATH%
call :AddPath "%ENV_ROOT%\tools\git-2.41.0-32-bit\cmd"
call :AddPath "%ENV_ROOT%\tools\bin"
call :AddPath "%RTT_EXEC_PATH%"
call :AddPath "%PYTHONHOME%"
call :AddPath "%PYTHONPATH%"
call :AddPath "%SCONS%"
call :AddPath "%ENV_ROOT%\tools\qemu\qemu64"
:: ====== RT-Thread ENV Change Code Page ================
chcp 65001 > nul
python %~dp0..\scripts\env.py -v
echo ^\ ^| /
echo - RT - Thread Operating System
echo / ^| ^\
echo 2006 - 2024 Copyright by RT-Thread team
Setlocal ENABLEDELAYEDEXPANSION
:: 启用命令扩展参加setlocal /?命令
set str1=%~dp0
set str=%str1%
set env_root=%~dp0
:next
if not "%str%"=="" (
set /a num+=1
if "!str:~0,1!"==" " (
echo.
echo *******************************************************************
echo Env 工具所在路径如下:
echo %env_root:~0,-21%
echo 警告:以上路径不能包含中文或空格,请将 Env 移动到符合要求的路径中。
echo *******************************************************************
endlocal
goto break_str
)
set "str=%str:~1%"
goto next
)
endlocal
set "str=%~dp0"
>"%tmp%\t.t" echo;WSH.Echo(/[\u4E00-\u9FFF]/.test(WSH.Arguments(0)))
for /f %%a in ('cscript -nologo -e:jscript "%tmp%\t.t" "%str%"') do if %%a neq 0 (goto not_support_chinese) else goto break_str
:not_support_chinese
echo.
echo *******************************************************************
echo Env 工具所在路径如下:
echo %env_root:~0,-29%
echo 警告:以上路径不能包含中文或空格,请将 Env 移动到符合要求的路径中。
echo *******************************************************************
:break_str
set str=
chcp 437 > nul
goto end
:: ======================================================
:: 不重复添加路径到 %PATH% 中
:AddPath
setlocal enabledelayedexpansion
set "new_path=%~1"
:: 将相对路径转换为绝对路径
for %%A in ("%new_path%") do set "new_path=%%~fA"
:: 检查 %PATH% 是否已经包含了要添加的路径
echo %PATH% | findstr /i /c:"%new_path%;" >nul
if errorlevel 1 (
set "PATH=%new_path%;%PATH%"
) else (
:: 如果已经包含则将路径移动到 %PATH% 的最前面
set "PATH=!new_path!;!PATH:%new_path%;=!"
)
endlocal & set "PATH=%PATH%"
goto:eof
:end
if "%ConEmuBaseDir%" == "" (
%ENV_ROOT%\tools\ConEmu\ConEmu\clink\clink.bat inject
)