檢測.net framework 版本

來源:互聯網
上載者:User

標籤:style   blog   http   color   檔案   os   

項目中,自己要製作asp.net項目的安裝檔案,由於項目依賴於.net framework 3.5 sp1,故需檢測環境是否符合要求,才能安裝程式

度娘找到檢測方案:各.net版本對應的安裝補錄下都有msbuild.exe,可通過dos命令運行msbuild.exe -version查看輸出版本

(參考:http://blog.csdn.net/yapingxin/article/details/7320129 )

以下為項目中製作安裝程式用於檢測.net framework 3.5 sp1 命令,

@echo offset netVer=0set netVerStr=3.5if exist %windir%\Microsoft.NET\Framework\v3.5\msbuild.exe (    %windir%\Microsoft.NET\Framework\v3.5\msbuild.exe -version > tmpver.txt    FOR /F "skip=3 tokens=1,2,3,4 delims=." %%i in (tmpver.txt) do (        set netVer=%%k        set netVerStr=%%i.%%j.%%k.%%l    )    del tmpver.txt)rem 表示3.5 SP1 的最小版本號碼:3.5.30729.1if %netVer% GEQ 30729 (    echo .NET Framework 版本號碼 %netVerStr%         echo 環境符合要求,安裝程式...) else (echo 請先安裝.Net Framework 3.5 sp1) pause

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.