QT 5.14是最后的離線安裝版本,都推薦這個??戳讼?,官方建議搭配 VS2017/VS2015
?VS版本對于QT,我一直偏好社區(qū)版,只要編譯器就夠了,自己加上SDK目錄。因為大部分工作都是在QT內(nèi)完成。VS2017的離線安裝比較復雜,這里記錄一下過程。
1.下載 VS2017社區(qū)版
VS2017版本比較老,下載地址很難找,找了半天找不到。根據(jù)最新的vs2022我修改了地址才找到。地址是:
VS2017脫機安裝https://learn.microsoft.com/zh-cn/previous-versions/visualstudio/visual-studio-2017/install/create-an-offline-installation-of-visual-studio?view=vs-2017
VS2017網(wǎng)上鄰居安裝https://learn.microsoft.com/zh-cn/previous-versions/visualstudio/visual-studio-2017/install/create-a-network-installation-of-visual-studio?view=vs-2017
不過這兩個里面的下載都沒有社區(qū)版 vs_community.exe。
看了下地址:?https://aka.ms/vs/15/release/vs_enterprise.exe ,我修改一下文件名,也能下載。
https://aka.ms/vs/15/release/vs_community.exe
[root@localhost tmp]# wget -c --no-check-certificate -U "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)" https://aka.ms/vs/15/release/vs_community.exe
--2023-06-05 00:44:18-- https://aka.ms/vs/15/release/vs_community.exe
Resolving aka.ms (aka.ms)... 184.26.243.69
Connecting to aka.ms (aka.ms)|184.26.243.69|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://download.visualstudio.microsoft.com/download/pr/8850d5c5-b050-404b-aad7-32152cd2b206/a42f4c9617b6f92c52caa36ce1b88dd04ba52fecb648f9f11737ae93988d7876/vs_Community.exe [following]
--2023-06-05 00:44:19-- https://download.visualstudio.microsoft.com/download/pr/8850d5c5-b050-404b-aad7-32152cd2b206/a42f4c9617b6f92c52caa36ce1b88dd04ba52fecb6 48f9f11737ae93988d7876/vs_Community.exe
Resolving download.visualstudio.microsoft.com (download.visualstudio.microsoft.com)... 218.75.154.169
Connecting to download.visualstudio.microsoft.com (download.visualstudio.microsoft.com)|218.75.154.169|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3694192 (3.5M) [application/octet-stream]
Saving to: ‘vs_community.exe’
100%[======================================>] 3,694,192 5.20MB/s in 0.7s
2023-06-05 00:44:19 (5.20 MB/s) - ‘vs_community.exe’ saved [3694192/3694192]
VS2017脫機離線安裝原理
VS2015以后,就沒有脫機版安裝了。但VS2017、VS2019、VS2022的原理差不多。也就是用一個安裝軟件實現(xiàn)三種功能:?
- 從網(wǎng)絡下載下載安裝包。
- 從安裝源(可以是遠程在線安裝微軟官方網(wǎng)絡、局域網(wǎng)內(nèi)部的網(wǎng)上鄰居、自己本地下載的安裝包)正式安裝到本地開發(fā)機器。網(wǎng)上鄰居/自己本地源都屬于脫機安裝模式。
- 脫機安裝模式下,用這個安裝軟件同步和更新微軟官方的遠程源。
大部分人都是用默認的“在線安裝”模式,來用微軟的官方源下載安裝。不過下載非常多的東西,很大。而實際上,用戶下載完遠程數(shù)據(jù)后,只要用 --noweb 的啟動就能利用脫機模式安裝了。只要制作一個快捷方式.lnk文件,把命令行參數(shù)寫入即可。vs2017都已經(jīng)進入淘汰期了,用這個方法保留開發(fā)環(huán)境。操作一下,記錄流程。
VS2017社區(qū)版脫機離線安裝流程
1.下載
vs2017社區(qū)版??https://aka.ms/vs/15/release/vs_community.exe
這里要確定需要脫機安裝的范圍,這個就是--add 參數(shù)用來選擇
- Microsoft.VisualStudio.Product.Enterprise
- Microsoft.VisualStudio.Product.Professional
- Microsoft.VisualStudio.Product.Community
- Microsoft.VisualStudio.Product.TeamExplorer
- Microsoft.VisualStudio.Product.WDExpress?
如果用??Microsoft.VisualStudio.Product.Community ,那么就下載 vs_2017社區(qū)版的全部。
vs_community.exe --layout C:\VS2017Layout --add Microsoft.VisualStudio.Product.Community
如果用 Microsoft.VisualStudio.Workload.NativeDesktop?,那就下載桌面開發(fā)全部。
vs_community.exe --layout C:\VS2017Layout --add Microsoft.VisualStudio.Workload.NativeDesktop
具體對應組件號?Component ID 官方手冊很多,具體看右側(cè)兩個鏈接,VS2017全版本組件號?、VS2017社區(qū)版組件號。用QT一般只需要桌面開發(fā)即可,我用后者。
2.下載桌面開發(fā)組件。這里要用命令行 vs_community.exe --layout C:\VS2017Layout --add Microsoft.VisualStudio.Workload.NativeDesktop,一定要加上 --layout 參數(shù)。告訴下載位置。
然后有兩個出現(xiàn)圖形和命令行兩種界面,最末有一個環(huán)節(jié)非常慢,只能耐心等待。
Visual Studio Setup Layout Tool, version 3.5.2150.18781
? Microsoft Corporation. All rights reserved.
Download of 'https://aka.ms/vs/15/release/channel' succeeded using engine 'WebClient'
Download of 'https://download.visualstudio.microsoft.com/download/pr/8850d5c5-b050-404b-aad7-32152cd2b206/39ede520ecbd03b7d0d4b042c8a17e7b3251d0a814da819c05f28954062aef9c/VisualStudio.vsman' succeeded using engine 'WebClient'
Layout progress: 0.00%
.......
.......
Layout progress: 97.90%
Layout progress: 97.90%
Layout progress: 97.90%
Download of 'https://www.incredibuild.com/downloads/vs/incredibuild_vs2017_932_2457.exe' succeeded using engine 'WebClient'
已成功完成安裝。
按任意鍵繼續(xù)...
按任意鍵就退出了。也就是從微軟遠端下載到本地或局域網(wǎng),可以斷網(wǎng)脫機安裝。看了下,下載了7.35G
3.把這個文件夾拷貝到 局域網(wǎng)中的網(wǎng)絡鄰居上去?
xcopy /e C:\VS2017Layout \\YourSerer\share\VS2017
4.制作一個啟動bat文件,調(diào)用--noweb,這樣就只調(diào)用局域網(wǎng)內(nèi)部下載的數(shù)據(jù)脫機安裝
type vs_2017_Commnunity_offline.bat
@echo off
%~dp0\vs_setup --noWeb --add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --lang zh-CN
exit
最后用一臺新機器驗證一下,是否能脫機工作。打開這個文件bat 批處理文件
?單擊打開后,顯示安裝 vs2017社區(qū)版
看到右側(cè)這個紅圈,那么就是離線脫機安裝了,--noweb參數(shù)起到作用了。
?然后一路默認安裝。
? ?
至此脫機安裝成功。以后只要直接點擊? bat 就能脫機安裝。
我制作了一個7.3G的ISO文件,文章來源:http://www.zghlxwxcb.cn/news/detail-472590.html
qt 5.14安裝
這個只要下載離線脫機安裝包即可。文章來源地址http://www.zghlxwxcb.cn/news/detail-472590.html
到了這里,關于QT 5.14 和 VS2017脫機離線安裝記錄的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!