Files
Obsidian-Main/00. Inbox/Windows/工具設定/Windows 11 重灌.md

6.6 KiB
Raw Blame History

要保存/恢復的檔案

  • %userprofile%/.config
  • %userprofile%/.ssh
  • %userprofile%/.bash_profile
  • %userprofile%/.bashrc
  • %userprofile%/.gitconfig
  • %userprofile%/.vimrc

安裝工具

安裝 Chocolatey

  1. 安裝Chocolatey用Administrator身份打開powershell輸入下列指令
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
  1. 用安裝常用的工具
choco install powertoys 7zip vscode hxd sublimetext4 androidstudio intellijidea-community git winmerge freefilesync freedownloadmanager gsudo firacode cascadiacode sourcecodepro delta googlechrome googledrive enpass.install sharex win32diskimager k-litecodecpackmega obsidian anki enpass.install --yes

可以在 https://community.chocolatey.org/packages 找到其他工具,再加到清單後面即可。

上面的指令安裝了下列的軟體,可以依自己需求增刪:

用 Chocolatey 升級軟體

choco upgrade all -y

手動安裝

  1. Python 3.6.3
  2. Python 3.9
  3. Visual Studio 2022
  4. Office 365
  5. Lightroom
  6. ShareX
  7. win32diskimager
  8. 卡巴斯基
  9. 字型
    • [Caskaydia](\diskstation\share\Tools\字型\Caskaydia Cove Nerd Font)

~/.bashrc

  1. 打開~/.bashrc
  2. 內容如下:
export PATH="/c/Users/ahuang11/AppData/Local/Android/Sdk/platform-tools:$PATH"

##----- Android -----
alias adb="/c/EasyAVEngine/Tools/Android/ADB/adb.exe"
alias ad='adb devices'
alias fastboot='/c/EasyAVEngine/Tools/Android/ADB/fastboot.exe'
alias fd='fastboot devices'

##----- Logitech coding -----
alias rrp='cd /c/Python363/lib/site-packages/RobotRun'
alias rra='cd /c/RobotRun'
alias rrd='cd /g/My\ Drive/codes/Projects/RobotRunDocs'
alias rro='cd /c/RobotRun/Output'
alias prj='cd /c/Users/awinh/OneDrive/codes/Logitech/project'
alias coderrp='cd "/c/Python363/lib/site-packages/RobotRun" ; code "/c/Python363/lib/site-packages/RobotRun"'
alias coderra='cd "/c/RobotRun"; code "/c/RobotRun"'
alias coderras='code "/d/GoogleDriveLogi/codes/Projects/RobotRunAutoServer"'
alias p3='/c/Python363/python.exe'

##----- Awin coding -----
alias codes='cd /c/Users/awinh/OneDrive/codes'
alias ctest='code "/g/My Drive/codes/test"'
alias jn='C:/Python310/Scripts/jupyter notebook'
alias ipy='C:/Python310/Scripts/ipython'

##----- ELF -----
alias hugo='~/OneDrive/文件/BLOG/Hugo/bin/0.98_extend/hugo.exe'

##----- MISC -----
alias sl="/c/Program\ Files/Sublime\ Text/subl.exe"
alias e.='explorer.exe .'
alias blog="cd ~/OneDrive/文件/BLOG/Hugo/Sites/blog.awin.one"
alias ffmpeg="/c/Users/awinh/OneDrive/codes/CommonLib/RobotRunCommonLib/ffmpeg-n5.0-latest-win64-lgpl-shared-5.0/bin/ffmpeg.exe"
alias ob="cd ~/OneDrive/文件/Obsidian/Main"
alias ffmpeg="/c/Users/awinh/OneDrive/PortableApps/ffmpeg-n5.0-latest-win64-lgpl-shared-5.0/bin/ffmpeg.exe"

##----- Connection -----
alias gods='ssh awin@192.168.1.11'
alias gorp320='ssh pi@192.168.1.20'
alias gopve='ssh root@192.168.1.21'

##----- Git -----
alias gs="git status"
alias gd="git diff"
alias gpull='git pull origin master'
alias gpush='git push origin master'
alias gpushmain='git push origin main'
alias gc='git clone'
alias gclogi='git clone --config user.name="Awin Huang" --config user.email=ahuang11@logitech.com $@'

##----- Python enviroment swich -----
alias pyv='echo PY_PYTHON=$PY_PYTHON'

function set_py() {
    echo "Original Python verison is \"$PY_PYTHON\""
    export PY_PYTHON=$1
    echo "     New Python verison is \"$PY_PYTHON\""

    if [ ! -z "$2" ]
    then
        py "${@:2}"
    fi
}

function py36() {
    set_py "3.6.3" "$@"
}

function py310() {
    set_py "3.10" "$@"
}

Setup Windows Terminal

  1. 開啟Windows Terminal。
  2. ctrl + ,打開設定,之後參考Windows Terminal

恢復右鍵選單

  • 以admin身份打開PowerShell執行 reg add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f /ve
  • 要恢復Windows 11的右鍵選單則是執行reg delete "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}" /f

設定使用者環境變數

  • PYTHON_INCLUDE: C:\Python363\include
  • PYTHON_LIB: C:\Python363\libs
  • RobotRunCommonLib: C:\Users\awinh\OneDrive\codes\CommonLib\RobotRunCommonLib
  • SWIGCmd: C:\Users\awinh\OneDrive\PortableApps\swigwin-4.0.2\swig.exe

參考