2020年10月9日 星期五

不要讓Windows 10被Windows Update升級大版本

(只是想要快速透過Windows Update立即更新到20H2的, 請參考底下匯入註冊機碼的範例)

Windows 10這幾年來大概都維持一年兩次[功能更新]版本(version), 每個版本的生命週期原則上為18或30個月(從發行日期起算).

使用Windows Update更新系統時, 可能會一不小心就被自動升級到新的版本. 如果想要使用Windows Update安裝[安全性更新], 但是又不想要順便被[功能更新](大版本升級)或是被提示有[功能更新], 可以透過群組原則或是註冊機碼來達成.

從Windows 10 版本1803起, 可以透過設定註冊機碼[TargetReleaseVersionInfo]來指定想要的Windows 10版本.
[Windows 10 版本(version)]與[終止服務(end of service)]日期 請參考這裡: Windows 10 版本資訊


[TargetReleaseVersionInfo]的版本號如果:
比現有Windows 10的版本號: 

  • 通常不會這樣設定, 經測試是會停留在原有的版本 (請參考後面的測試結果)


等於現有Windows 10的版本號:

  • Windows Update僅會基於現有的版本號安裝[安全性更新], 不會下載安裝[功能更新](大版本升級)或是提示有[功能更新], 但是可能會提示Windows版本[已終止服務]或是[即將終止服務]
  • 需注意的是按照微軟的說法, 這個設定並不是永久有效的, 如果現有的Windows 10版本已經過了[終止服務(end of service)]日期, 可能還是會被提示有[功能更新]. 我用已經過了[終止服務]日期的版本1803[專業版]測試, 目前並未發現會被強迫升級, 但是有提示:"您的Windows版本已終止服務...建議更新至最新版本的Windows 10". (請參考後面的測試結果)


比現有Windows 10的版本號: (必須是已經有推送的版本號) 

  • Windows Update會直接下載安裝[功能更新]到指定的版本號
    (所以想跳過某些版本號, 直接升級到後面的版本可以用這方法)
  • 升級完後[TargetReleaseVersionInfo]就變成等於現有Windows 10的版本號
  • 設定大於目前有推送的版本號(尚未推出的版本), 經測試是會停留在原有的版本 (請參考後面的測試結果)


設定方法(一): 用PowerShell script設定 
  • 下載檔案 SetTargetVersion.ps1
  • 在[SetTargetVersion.ps1]檔案上按滑鼠右鍵選[用 PowerShell 執行]
  • 輸入要設定的版本號碼, 如果直接按enter(沒輸入版本號碼), 則使用目前Windows 10的版本號碼當作指定的版本
  • 確定後即設定完成

 

設定方法(二): 匯入註冊機碼

1
2
3
4
5
6
7
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate]
"TargetReleaseVersion"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate]
"TargetReleaseVersionInfo"="2010"

如果要刪除/清空設定:

1
2
3
4
5
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate]
"TargetReleaseVersion"=-
"TargetReleaseVersionInfo"=-


以下是我用各種設定做的測試, 可以參考不同設定會造成的效果:

  • 測試是在2020/10/05~10/11間進行, 版本2009/20H2在當時尚未推出
  • 停留在某一個版本號時, 均可以正常下載安裝該版本的[安全性更新]
  • 測試使用: Windows 10 繁體中文[專業版]
  • 1803 [專業版] EOS: 2019-11-12
  • 1809 [專業版] EOS: 2020-11-10


 
以下是一些測試的截圖:
  • 1803, 無設定, 升級到1909, 提示會有2004功能更新(無"下載並安裝")
 


  • 1803, 設定為1803, 停留在1803, 提示"您的Windowsb版本已終止服務"
 


  • 1809, 設定為1803, 停留在1809, 提示"您目前執行的Windows版本即將終止服務" (1809 [專業版] EOS: 2020-11-10)
 


  • 1903, 無設定, 停留在1903, 提示有2004功能更新("下載並安裝")
 

2020/10/21 補充:
版本20H2已在今天推出, 在微軟網頁公布的已經不是全數字的版本號, 而是20H2

版本20H2比起版本2004(含)以前的版本, 註冊機碼多了[DisplayVersion], [ReleaseId]則是2009

[TargetReleaseVersionInfo]經我測試使用2009或是20H2都無效, 反而是要設定成2010才有效.
可能要等晚些時候再看看有沒有更多的資訊會公布
 
  • 1809, 設定為2010, 直接升級20H2
 
 
2020/11/10 補充:

以下是我在Windows 10 20H2推出後所做的測試, 可以參考不同設定會造成的效果:

  • 測試是在2020/10/23~10/28間進行
  • 測試使用: Windows 10 繁體中文[專業版]


 

2020年9月20日 星期日

Windows 10 安裝[舊版][新倉頡][新速成]中文輸入法 (2004/20H1/20H2適用)

微軟從Windows 10 版本2004 (20H1)開始推出新的中文輸入法, 有些軟體還不能完全相容.

如果想要用以前版本的新倉頡或是新速成輸入法, 需要動點手腳才能安裝.

所需的步驟要改好些地方(設定, 註冊機碼...), 我把它寫成一個PowerShell檔, 只要執行就可以設定安裝舊版的新倉頡跟新速成輸入法.

目前在Windows 10 20H1/20H2/Insider Preview Build 20241上測試都還可以用, 至於以後更新版的Windows 10推出後還能不能繼續這樣用就不知了.

使用方法:

  • 下載檔案 AddNewIME.ps1
  • 語言裡要有[中文(繁體,台灣)]
  • 至少要安裝[微軟注音]輸入法
  • 在[AddNewIME.ps1]檔案上按滑鼠右鍵選[用 PowerShell 執行]即可


有安裝測試過的版本:
Windows 10 繁體中文專業版

  • 版本 Insider Preview Build 20241
  • 版本 20H2
  • 版本 2004/20H1
  • 版本 1909/19H2
  • 版本 1903/19H1
  • 版本 1809/RS5

2020年6月15日 星期一

Windows Terminal 設定

Windows Terminal剛裝好時大概長這樣, 內容會因為你裝的東西有些不同:


點開設定可以看到settings.json大概長這樣:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// This file was initially generated by Windows Terminal 1.0.1401.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.

// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
    "$schema": "https://aka.ms/terminal-profiles-schema",

    "defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",

    // You can add more global application settings here.
    // To learn more about global settings, visit https://aka.ms/terminal-global-settings

    // If enabled, selections are automatically copied to your clipboard.
    "copyOnSelect": false,

    // If enabled, formatted data is also copied to your clipboard
    "copyFormatting": false,

    // A profile specifies a command to execute paired with information about how it should look and feel.
    // Each one of them will appear in the 'New Tab' dropdown,
    //   and can be invoked from the commandline with `wt.exe -p xxx`
    // To learn more about profiles, visit https://aka.ms/terminal-profile-settings
    "profiles":
    {
        "defaults":
        {
            // Put settings here that you want to apply to all profiles.
        },
        "list":
        [
            {
                // Make changes here to the powershell.exe profile.
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Windows PowerShell",
                "commandline": "powershell.exe",
                "hidden": false
            },
            {
                // Make changes here to the cmd.exe profile.
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "name": "命令提示字元",
                "commandline": "cmd.exe",
                "hidden": false
            },
            {
                "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
                "hidden": false,
                "name": "PowerShell",
                "source": "Windows.Terminal.PowershellCore"
            },
            {
                "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
                "hidden": false,
                "name": "Azure Cloud Shell",
                "source": "Windows.Terminal.Azure"
            },
            {
                "guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
                "hidden": false,
                "name": "Ubuntu-20.04",
                "source": "Windows.Terminal.Wsl"
            }
        ]
    },

    // Add custom color schemes to this array.
    // To learn more about color schemes, visit https://aka.ms/terminal-color-schemes
    "schemes": [],

    // Add custom keybindings to this array.
    // To unbind a key combination from your defaults.json, set the command to "unbound".
    // To learn more about keybindings, visit https://aka.ms/terminal-keybindings
    "keybindings":
    [
        // Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
        // These two lines additionally bind them to Ctrl+C and Ctrl+V.
        // To learn more about selection, visit https://aka.ms/terminal-selection
        { "command": {"action": "copy", "singleLine": false }, "keys": "ctrl+c" },
        { "command": "paste", "keys": "ctrl+v" },

        // Press Ctrl+Shift+F to open the search box
        { "command": "find", "keys": "ctrl+shift+f" },

        // Press Alt+Shift+D to open a new pane.
        // - "split": "auto" makes this pane open in the direction that provides the most surface area.
        // - "splitMode": "duplicate" makes the new pane use the focused pane's profile.
        // To learn more about panes, visit https://aka.ms/terminal-panes
        { "command": { "action": "splitPane", "split": "auto", "splitMode": "duplicate" }, "keys": "alt+shift+d" }
    ]
}

可以使用的選項是Windows Terminal根據系統內有安裝的東西自動產生的, 每一項會對應到一個"profile", 以"guid"當作獨特的識別


由"defaultProfile"的"guid"可以看出預設開啟的是"PowerShell",
如果想改成預設開啟"命令提示字元", 把"defaultProfile"的"guid"改為"{0caa0dad-35be-5f56-a8ff-afceeeaa6101}"即可

因為profile是Windows Terminal自動產生的, 如果有些選項不想用, 不能直接刪掉某個profile(會再產生回來), 要把"hidden"改為true, 至於porfile的順序則可以自己調動

以下是修改了:
  • 預設開啟"命令提示字元", 並把選項順序改到最上面
  • 不顯示"Azure Cloud Shell"


如果要修改Windows Terminal的色彩配置, 可以加在:
  • "defaults": 所有的profiles都會套用
  • 個別profile: 僅該profile會套用
以下是修改了:
  • "命令提示字元" profile: 使用Windows Terminal內建的"One Half Light"色彩配置, 並開啟壓克力效果


Windows Terminal內建的色彩配置有:
  • Campbell
  • Campbell Powershell
  • Vintage
  • One Half Dark
  • One Half Light
  • Solarized Dark
  • Solarized Light
  • Tango Dark
  • Tango Light

色彩配置的內容及效果請參考:
https://docs.microsoft.com/zh-tw/windows/terminal/customize-settings/color-schemes

加上 startingDirectory 可以設定起始目錄:


修改過的settings.json:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// This file was initially generated by Windows Terminal 1.0.1401.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.

// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
    "$schema": "https://aka.ms/terminal-profiles-schema",

    "defaultProfile": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",

    // You can add more global application settings here.
    // To learn more about global settings, visit https://aka.ms/terminal-global-settings

    // If enabled, selections are automatically copied to your clipboard.
    "copyOnSelect": false,

    // If enabled, formatted data is also copied to your clipboard
    "copyFormatting": false,

    // A profile specifies a command to execute paired with information about how it should look and feel.
    // Each one of them will appear in the 'New Tab' dropdown,
    //   and can be invoked from the commandline with `wt.exe -p xxx`
    // To learn more about profiles, visit https://aka.ms/terminal-profile-settings
    "profiles":
    {
        "defaults":
        {
            // Put settings here that you want to apply to all profiles. (如果要所有的profiles都套用就加在這下面)
        },
        "list":
        [
            {
                // Make changes here to the cmd.exe profile.
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "name": "命令提示字元",
                "commandline": "cmd.exe",
                "colorScheme": "One Half Light",
                "useAcrylic": true,
                "startingDirectory": "%USERPROFILE%\\Desktop",
                "hidden": false
            },
            {
                // Make changes here to the powershell.exe profile.
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Windows PowerShell",
                "commandline": "powershell.exe",
                "hidden": false
            },
            {
                "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
                "hidden": false,
                "name": "PowerShell",
                "source": "Windows.Terminal.PowershellCore"
            },
            {
                "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
                "hidden": true,
                "name": "Azure Cloud Shell",
                "source": "Windows.Terminal.Azure"
            },
            {
                "guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
                "hidden": false,
                "name": "Ubuntu-20.04",
                "source": "Windows.Terminal.Wsl"
            }
        ]
    },

    // Add custom color schemes to this array.
    // To learn more about color schemes, visit https://aka.ms/terminal-color-schemes
    "schemes": [],

    // Add custom keybindings to this array.
    // To unbind a key combination from your defaults.json, set the command to "unbound".
    // To learn more about keybindings, visit https://aka.ms/terminal-keybindings
    "keybindings":
    [
        // Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
        // These two lines additionally bind them to Ctrl+C and Ctrl+V.
        // To learn more about selection, visit https://aka.ms/terminal-selection
        { "command": {"action": "copy", "singleLine": false }, "keys": "ctrl+c" },
        { "command": "paste", "keys": "ctrl+v" },

        // Press Ctrl+Shift+F to open the search box
        { "command": "find", "keys": "ctrl+shift+f" },

        // Press Alt+Shift+D to open a new pane.
        // - "split": "auto" makes this pane open in the direction that provides the most surface area.
        // - "splitMode": "duplicate" makes the new pane use the focused pane's profile.
        // To learn more about panes, visit https://aka.ms/terminal-panes
        { "command": { "action": "splitPane", "split": "auto", "splitMode": "duplicate" }, "keys": "alt+shift+d" }
    ]
}


版權宣告

Creative Commons License
本著作由 PROLIANTAHOLIC 製作,以創用CC 姓名標示-非商業性-禁止改作 3.0 台灣 授權條款釋出。
文內所述之產品和公司名稱均為其各自擁有者的商標及(或)服務標記。