Check IIS Version Before Installing: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Removed now-superfluous NoAbort label)
 
(9 intermediate revisions by 6 users not shown)
Line 9: Line 9:
</highlight-nsis>
</highlight-nsis>


[[http://www.shrentcar.com 租车]]
== The Function ==
[[http://www.shrentcar.com 汽车租�]] [[http://www.rentcarcompany.com 租车]][[http://www.shrentbus.cn 租车]]
<highlight-nsis>
[[http://rentcar.host2.9466.net/ 汽车租�]][[http://rentcar.host2.9466.net/ 租车]][[http://www.shrentbus.cn 上海租车]]
;--------------------------------
[[http://www.11rentcar.com/ 汽车租�]][[http://www.11rentcar.com/ 租车]]
; CheckIISVersion Function
;
; This is built off MSFT's required keys for IIS
; (info at http://nsis.sf.net/wiki)
; and the NSIS Wiki (http://nsis.sf.net/wiki).
Function CheckIISVersion


[[http://www.dela88.com/ 防�电]] [[http://www.haungsanok.com/ 防�电]] [[http://www.tripto.com/ 三亚]]
ClearErrors
[[http://www.tripto.com/ 三亚旅游]][[http://www.postdream.org 公�注册]][[http://www.dreamhk.org 注册香港公�]]
ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\InetStp" "MajorVersion"
[[http://www.postdream.org 注册公�]][[http://www.regsh.com/ 注册公�]][[http://www.regsh.com/ 公�注册]]
ReadRegDWORD $1 HKLM "SOFTWARE\Microsoft\InetStp" "MinorVersion"
[[http://www.dreamatsh.com 公�注册]][[http://www.dreamatsh.com 注册公�]]


[[http://www.dreamathk.com 注册香港公�]]
IfErrors IISMajVerLT5 0
[[http://www.companyforyou.com/ 注册公�]][[http://www.companyforyou.com/ 上海注册公�]]
[[http://www.hkcompanyforyou.cn 注册香港公�]][[http://companyok.68l.net/ 公�注册]]
[[http://companyok.68l.net/ 注册公�]][[http://okcomapany.68l.com/ 注册海外公�]]
[[http://okcomapany.68l.com/ 注册美国公�]][[http://www.11company.com/ 注册香港公�]]
[[http://www.11company.com/ 香港公�]][[http://www.companyforhk.cn/ 注册香港公�]]
[[http://www.companyforhk.cn/ 香港公�]] [[http://www.shregister.com/ 注册公�]]
[[http://www.shregister.com/ 公�注册]] [[http://www.mesoresources.com/blog/dzyblog/ 租车]]
[[http://www.for-sme.com 注册商标]][[http://www.for-vip.com 公�注册]]
[[http://www.for-sme.com 商标注册]][[http://www.for-vip.com 注册香港公�]]


[[http://www.mesoresources.com/blog/dzyblog/ 汽车租�]]
IntCmp $0 5 0 IISMajVerLT5 0
[[http://nowbot.com/blog/dzybog/ 上海租车]]
DetailPrint "Found Microsoft Internet Information Server v$0.$1"
Goto ExitFunction
[[http://www.hplc.cn/ 租车]]
[[http://www.hplc.cn/ 汽车租�]]
[[http://www.companyforhk.cn/ 注册香港公�]]
[[http://www.companyforhk.cn/ 香港公�]]
[[http://www.for-vip.net 注册商标]]
[[http://www.for-vip.net 注册英国公�]]
[[http://www.for-vip.net 注册美国公�]]


[[http://www.shticketcenter.com 机票]]
IISMajVerLT5:
[[http://www.cnticket.net 机票]]
Abort "Setup could not detect Microsoft Internet Information Server v5 or later; this is required for installation. Setup will abort."
[[http://www.ticketsh.net 机票]]
 
[[http://www.55377.com 香港六�彩]]
ExitFunction:
[[http://www.55377.com 六�彩]]
 
[[http://www.52lac.net 六�彩]]
FunctionEnd
[[http://www.88299.net 六�彩]]
</highlight-nsis>
[[http://www.88t99.com �费电影]]
 
[[http://www.88t99.com 电影下载]]
[[Category:Other Products Version Detection Functions]]

Latest revision as of 10:10, 20 November 2014

Author: icebrrrg (talk, contrib)


Description

Here's a quick function that will check the registry to see (1) if IIS is installed, and (2) the version is at least v5.0. You can manipulate it to check for other versions. I call this in a section which installs the web virtual directory, so we only check for IIS if that module is selected by the user.

Function Call

	Call CheckIISVersion

The Function

;--------------------------------
; CheckIISVersion Function
;
; This is built off MSFT's required keys for IIS
; (info at http://nsis.sf.net/wiki)
; and the NSIS Wiki (http://nsis.sf.net/wiki).
Function CheckIISVersion
 
	ClearErrors
	ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\InetStp" "MajorVersion"
	ReadRegDWORD $1 HKLM "SOFTWARE\Microsoft\InetStp" "MinorVersion"
 
	IfErrors IISMajVerLT5 0
 
	IntCmp $0 5 0 IISMajVerLT5 0
	DetailPrint "Found Microsoft Internet Information Server v$0.$1"
	Goto ExitFunction
 
	IISMajVerLT5:
		Abort "Setup could not detect Microsoft Internet Information Server v5 or later; this is required for installation. Setup will abort."
 
	ExitFunction:
 
FunctionEnd