脚本:判断X86,X64,IA64操作系统

优质
小牛编辑
139浏览
2023-12-01
引用脚本的内容:

SetCompressor /SOLID lzma
XPStyle on
!include WinVer.nsh
OutFile "判断X86,X64,IA64操作系统.EXE"
Name "判断X86,X64,IA64操作系统"
Section
${If} ${AtLeastWinXP}
System::Alloc 36
pop $0
	${If} $0  0
	System::Call 'kernel32::GetNativeSystemInfo(i $0)'
	System::Call "*$0(&i2.r1)"
	System::Free $0
	;输出值:$1=0:x86|6:ia64|9:x64|0xffff:unknown
	StrCmp $1 0 +1 +2
	StrCpy $R0 "x86"
	StrCmp $1 6 +1 +2
	StrCpy $R0 "ia64"
	StrCmp $1 9 +1 +2
	StrCpy $R0 "x64"
	IntCmp $1 10 +1 +2 +1
	StrCpy $R0 "unknown"
	${EndIf}
	MessageBox MB_ICONINFORMATION|MB_OK '系统是$R0架构'
${EndIf}
SectionEnd