2026年1月30日 星期五

[研究] SQL Server Management Studio 22.2.1 離線安裝實際測試

[研究] SQL Server Management Studio 22.2.1 離線安裝實際測試

2026-01-28

環境:

  • Windows Server 2019 繁體中文標準版
  • SQL Server 2019 繁體中文標準版
  • SSMS 22.2.1版

SSMS 21 和 SSMS 22 建立 SQL Server Management Studio 的離線安裝
https://learn.microsoft.com/zh-tw/ssms/install/create-offline

SSMS 21 和 SSMS 22 安裝 SQL Server Management Studio 離線安裝的憑證
https://learn.microsoft.com/zh-tw/ssms/install/install-certificates

SSMS 21 和 SSMS 22 命令行參數
https://learn.microsoft.com/zh-tw/ssms/install/command-line-parameters#layout-command-and-command-line-parameters

SSMS 21 和 SSMS 22 語言區域清單
https://learn.microsoft.com/zh-tw/ssms/install/command-line-parameters#list-of-language-locales

SSMS 21 和 SSMS 22 工作負載和元件標識碼
https://learn.microsoft.com/zh-tw/ssms/install/workload-component-ids

下載離線安裝檔案

C:\temp\vs_SSMS.exe --layout D:\SSMS22 --lang zh-tw

下圖,開始下載離線安裝檔案


下圖,下載離線安裝檔案完成

下圖,想做成 .iso 檔案失敗,檔案名稱太長,只能壓縮成˙.zip 拿到 VM 中解壓縮

下圖,
下圖,


匯入憑證

certmgr.exe -add D:\SSMS22\certificates\manifestRootCertificate.cer -s -r LocalMachine root
certmgr.exe -add D:\SSMS22\certificates\manifestCounterSignRootCertificate.cer -s -r LocalMachine root
certmgr.exe -add D:\SSMS22\certificates\vs_installer_opc.RootCertificate.cer -s -r LocalMachine root

certutil.exe -addstore -f "Root" "D:\SSMS22\certificates\manifestRootCertificate.cer"
certutil.exe -addstore -f "Root" "D:\SSMS22\certificates\manifestCounterSignRootCertificate.cer"
certutil.exe -addstore -f "Root" "D:\SSMS22\certificates\vs_installer_opc.RootCertificate.cer"

實際

C:\>certmgr.exe -add D:\SSMS22\certificates\manifestRootCertificate.cer -s -r LocalMachine root
'certmgr.exe' 不是內部或外部命令、可執行的程式或批次檔。

C:\>certutil.exe -addstore -f "Root" "D:\SSMS22\certificates\manifestRootCertificate.cer"
Root "受信任的根憑證授權單位"
簽章符合公開金鑰
相關的憑證:

完全相符:
元素 4:
序號: 3f8bc8b5fc9fb29643b569d66c42e144
簽發者: CN=Microsoft Root Certificate Authority 2011, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
 NotBefore: 2011/3/23 上午 06:05
 NotAfter: 2036/3/23 上午 06:13
主體: CN=Microsoft Root Certificate Authority 2011, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
CA 版本: V0.0
簽章符合公開金鑰
根憑證: 主體符合簽發者
Cert 雜湊(sha1): 8f43288ad272f3103b6fb1428485ea3014c0bcfe

憑證 "Microsoft Root Certificate Authority 2011" 已在存放區中。
CertUtil: -addstore 命令成功完成。

C:\>certutil.exe -addstore -f "Root" "D:\SSMS22\certificates\manifestCounterSignRootCertificate.cer"
Root "受信任的根憑證授權單位"
簽章符合公開金鑰
相關的憑證:

完全相符:
元素 6:
序號: 28cc3a25bfba44ac449a9b586b4339aa
簽發者: CN=Microsoft Root Certificate Authority 2010, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
 NotBefore: 2010/6/24 上午 05:57
 NotAfter: 2035/6/24 上午 06:04
主體: CN=Microsoft Root Certificate Authority 2010, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
CA 版本: V0.0
簽章符合公開金鑰
根憑證: 主體符合簽發者
Cert 雜湊(sha1): 3b1efd3a66ea28b16697394703a72ca340a05bd5

憑證 "Microsoft Root Certificate Authority 2010" 已在存放區中。
CertUtil: -addstore 命令成功完成。

C:\>certutil.exe -addstore -f "Root" "D:\SSMS22\certificates\vs_installer_opc.RootCertificate.cer"
Root "受信任的根憑證授權單位"
簽章符合公開金鑰
相關的憑證:

完全相符:
元素 6:
序號: 28cc3a25bfba44ac449a9b586b4339aa
簽發者: CN=Microsoft Root Certificate Authority 2010, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
 NotBefore: 2010/6/24 上午 05:57
 NotAfter: 2035/6/24 上午 06:04
主體: CN=Microsoft Root Certificate Authority 2010, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
CA 版本: V0.0
簽章符合公開金鑰
根憑證: 主體符合簽發者
Cert 雜湊(sha1): 3b1efd3a66ea28b16697394703a72ca340a05bd5

憑證 "Microsoft Root Certificate Authority 2010" 已在存放區中。
CertUtil: -addstore 命令成功完成。

C:\>


下圖,實際畫面


下圖,


斷網,執行 D:\SSMS22\vs_SSMS.exe  (vs_setup.exe 不用你自己點)

下圖,斷網路

下圖,執行 vs_SSMS.exe


下圖,執行 vs_SSMS.exe


下圖,按下「繼續」按鈕後,工作管理員沒看到?(疑問?)

下圖,改用 vs_setup.exe

下圖,


下圖,按下「繼續」按鈕後,工作管理員沒看到?(疑問?)

檢查離線安裝失敗 Log


 vs_SSMS.exe失敗 Log

[0f08:0001][2026-01-28T11:43:50] Assembly version: 4.0.2168.39045.
[0f08:0001][2026-01-28T11:43:50] Creating new ExperimentationService
[0f08:0001][2026-01-28T11:43:50] Telemetry property VS.ABExp.Flights : 
[0f08:0001][2026-01-28T11:43:50] Command line arguments = --env,_SFX_CAB_EXE_PACKAGE:D:\SSMS22\vs_SSMS.exe _SFX_CAB_EXE_ORIGINALWORKINGDIR:D:\SSMS22
[0f08:0001][2026-01-28T11:43:50] C2R signature did not exist or could not be read: 
[0f08:0001][2026-01-28T11:43:50] Parent process name = vs_SSMS
[0f08:0001][2026-01-28T11:43:50] Parent process product version = 18.2.11415.280
[0f08:0001][2026-01-28T11:43:50] CampaignId = 
[0f08:0001][2026-01-28T11:43:50] Warning: ResponseId not available in 'vs_setup_bootstrapper.config'. Trying to parse filename.
[0f08:0001][2026-01-28T11:43:50] Warning: loading config settings: -update --update --layout -offline --offline --locale --layout --originalworkingdir --installLayoutPath --env
[0f08:0001][2026-01-28T11:43:50] Trying to get response file path from layout.
[0f08:0001][2026-01-28T11:43:50] Returning response file path as: D:\SSMS22\Response.json.
[0f08:0001][2026-01-28T11:43:50] DownloadURL = https://aka.ms/ssms/22/release/installer
[0f08:0001][2026-01-28T11:43:50] InstallLocation = C:\Program Files (x86)\Microsoft Visual Studio\Installer
[0f08:0001][2026-01-28T11:43:50] OfflineFilePath = D:\SSMS22\vs_installer.opc
[0f08:0001][2026-01-28T11:43:50] LayoutLocation = 
[0f08:0001][2026-01-28T11:43:50] ExecutableArguments = /finalizeInstall install --layoutPath "D:\SSMS22" --in "D:\SSMS22\Response.json" --locale zh-TW --activityId "73561dcb-eee1-4c58-a028-6db78a7b6f5f"
[0f08:0001][2026-01-28T11:43:50] OSVersion = Microsoft Windows NT 10.0.17763.0
[0f08:0001][2026-01-28T11:43:50] Starting to detect the existing VS and .NET...
[0f08:0001][2026-01-28T11:43:50] Finished detecting the existing VS and .Net
[0f08:0004][2026-01-28T11:44:00] NoWeb or OfflineFilePath specified, skipping latest installer feed check.
[0f08:0004][2026-01-28T11:44:00] Existing client is unsupported: C:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe does not exist.
[0f08:0004][2026-01-28T11:44:00] Using Offline package: D:\SSMS22\vs_installer.opc
[0f08:0004][2026-01-28T11:44:00] Saving Certificates to layout folder
[0f08:0004][2026-01-28T11:44:00] Certificate is invalid: D:\SSMS22\vs_installer.opc
[0f08:0004][2026-01-28T11:44:00] Error: Unable to verify the certificate: InvalidCertificate
[0f08:0004][2026-01-28T11:44:00] Error 0x80131509: Signature verification failed. Error: Unable to verify the integrity of the installation files: the certificate could not be verified.
   於 Microsoft.VisualStudio.Setup.OpcVerifier.Verify(Stream packageStream, String layoutLocation, Boolean skipSavingCertificate)
   於 Microsoft.VisualStudio.Setup.Bootstrapper.Bootstrapper.VerifyLayoutPackage(Stream packageStream)
[0f08:0004][2026-01-28T11:44:00] Bootstrapper failed with known error.

 vs_setup.exe失敗 Log

[1584:0001][2026-01-28T11:45:54] Assembly version: 4.0.2168.39045.
[1584:0001][2026-01-28T11:45:54] Creating new ExperimentationService
[1584:0001][2026-01-28T11:45:54] Telemetry property VS.ABExp.Flights : 
[1584:0001][2026-01-28T11:45:55] Command line arguments = --env,_SFX_CAB_EXE_PACKAGE:D:\SSMS22\vs_setup.exe _SFX_CAB_EXE_ORIGINALWORKINGDIR:D:\SSMS22
[1584:0001][2026-01-28T11:45:55] C2R signature did not exist or could not be read: 
[1584:0001][2026-01-28T11:45:55] Parent process name = vs_setup
[1584:0001][2026-01-28T11:45:55] Parent process product version = 18.2.11415.280
[1584:0001][2026-01-28T11:45:55] CampaignId = 
[1584:0001][2026-01-28T11:45:55] Warning: ResponseId not available in 'vs_setup_bootstrapper.config'. Trying to parse filename.
[1584:0001][2026-01-28T11:45:55] Warning: loading config settings: -update --update --layout -offline --offline --locale --layout --originalworkingdir --installLayoutPath --env
[1584:0001][2026-01-28T11:45:55] Trying to get response file path from layout.
[1584:0001][2026-01-28T11:45:55] Returning response file path as: D:\SSMS22\Response.json.
[1584:0001][2026-01-28T11:45:55] DownloadURL = https://aka.ms/ssms/22/release/installer
[1584:0001][2026-01-28T11:45:55] InstallLocation = C:\Program Files (x86)\Microsoft Visual Studio\Installer
[1584:0001][2026-01-28T11:45:55] OfflineFilePath = D:\SSMS22\vs_installer.opc
[1584:0001][2026-01-28T11:45:55] LayoutLocation = 
[1584:0001][2026-01-28T11:45:55] ExecutableArguments = /finalizeInstall install --layoutPath "D:\SSMS22" --in "D:\SSMS22\Response.json" --locale zh-TW --activityId "ef700274-05ac-43ee-849c-ed5e8f297105"
[1584:0001][2026-01-28T11:45:55] OSVersion = Microsoft Windows NT 10.0.17763.0
[1584:0001][2026-01-28T11:45:55] Starting to detect the existing VS and .NET...
[1584:0001][2026-01-28T11:45:55] Finished detecting the existing VS and .Net
[1584:0007][2026-01-28T11:45:59] NoWeb or OfflineFilePath specified, skipping latest installer feed check.
[1584:0007][2026-01-28T11:45:59] Existing client is unsupported: C:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe does not exist.
[1584:0007][2026-01-28T11:45:59] Using Offline package: D:\SSMS22\vs_installer.opc
[1584:0007][2026-01-28T11:45:59] Saving Certificates to layout folder
[1584:0007][2026-01-28T11:45:59] Certificate is invalid: D:\SSMS22\vs_installer.opc
[1584:0007][2026-01-28T11:45:59] Error: Unable to verify the certificate: InvalidCertificate
[1584:0007][2026-01-28T11:45:59] Error 0x80131509: Signature verification failed. Error: Unable to verify the integrity of the installation files: the certificate could not be verified.
   於 Microsoft.VisualStudio.Setup.OpcVerifier.Verify(Stream packageStream, String layoutLocation, Boolean skipSavingCertificate)
   於 Microsoft.VisualStudio.Setup.Bootstrapper.Bootstrapper.VerifyLayoutPackage(Stream packageStream)
[1584:0007][2026-01-28T11:45:59] Bootstrapper failed with known error.

*****

添加參數 --noWeb 安裝看看

D:\SSMS22>vs_SSMS.exe --noWeb

D:\SSMS22>

檢視 Log


[1b64:0001][2026-01-28T12:57:30] Assembly version: 4.0.2168.39045.
[1b64:0001][2026-01-28T12:57:30] Creating new ExperimentationService
[1b64:0001][2026-01-28T12:57:30] Telemetry property VS.ABExp.Flights : 
[1b64:0001][2026-01-28T12:57:30] Command line arguments = --noWeb,--env,_SFX_CAB_EXE_PACKAGE:D:\SSMS22\vs_SSMS.exe _SFX_CAB_EXE_ORIGINALWORKINGDIR:D:\SSMS22
[1b64:0001][2026-01-28T12:57:30] C2R signature did not exist or could not be read: 
[1b64:0001][2026-01-28T12:57:30] Parent process name = vs_SSMS
[1b64:0001][2026-01-28T12:57:30] Parent process product version = 18.2.11415.280
[1b64:0001][2026-01-28T12:57:30] CampaignId = 
[1b64:0001][2026-01-28T12:57:30] Warning: ResponseId not available in 'vs_setup_bootstrapper.config'. Trying to parse filename.
[1b64:0001][2026-01-28T12:57:30] Warning: loading config settings: -update --update --layout -offline --offline --locale --layout --originalworkingdir --installLayoutPath --env
[1b64:0001][2026-01-28T12:57:30] Trying to get response file path from layout.
[1b64:0001][2026-01-28T12:57:30] Returning response file path as: D:\SSMS22\Response.json.
[1b64:0001][2026-01-28T12:57:30] DownloadURL = https://aka.ms/ssms/22/release/installer
[1b64:0001][2026-01-28T12:57:30] InstallLocation = C:\Program Files (x86)\Microsoft Visual Studio\Installer
[1b64:0001][2026-01-28T12:57:30] OfflineFilePath = D:\SSMS22\vs_installer.opc
[1b64:0001][2026-01-28T12:57:30] LayoutLocation = 
[1b64:0001][2026-01-28T12:57:30] ExecutableArguments = /finalizeInstall install --layoutPath "D:\SSMS22" --in "D:\SSMS22\Response.json" --noWeb --locale zh-TW --activityId "a38ef7cc-bcb4-4e70-8192-3853d55c463d"
[1b64:0001][2026-01-28T12:57:30] OSVersion = Microsoft Windows NT 10.0.17763.0
[1b64:0001][2026-01-28T12:57:30] Starting to detect the existing VS and .NET...
[1b64:0001][2026-01-28T12:57:30] Finished detecting the existing VS and .Net
[1b64:0007][2026-01-28T12:57:34] NoWeb or OfflineFilePath specified, skipping latest installer feed check.
[1b64:0007][2026-01-28T12:57:34] Existing client is unsupported: C:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe does not exist.
[1b64:0007][2026-01-28T12:57:34] Using Offline package: D:\SSMS22\vs_installer.opc
[1b64:0007][2026-01-28T12:57:34] Saving Certificates to layout folder
[1b64:0007][2026-01-28T12:57:34] Certificate is invalid: D:\SSMS22\vs_installer.opc
[1b64:0007][2026-01-28T12:57:34] Error: Unable to verify the certificate: InvalidCertificate
[1b64:0007][2026-01-28T12:57:34] Error 0x80131509: Signature verification failed. Error: Unable to verify the integrity of the installation files: the certificate could not be verified.
   於 Microsoft.VisualStudio.Setup.OpcVerifier.Verify(Stream packageStream, String layoutLocation, Boolean skipSavingCertificate)
   於 Microsoft.VisualStudio.Setup.Bootstrapper.Bootstrapper.VerifyLayoutPackage(Stream packageStream)
[1b64:0007][2026-01-28T12:57:34] Bootstrapper failed with known error.

原因待查,失敗。

(完)

沒有留言:

張貼留言