域名将于6月份到期,并且不再续费,届时网站将无法访问。
6月份之前如果服务器到期将提前关闭网站,请改访问模组网社区

运行库合集

一直希望能自己弄一个运行库合集的程序,但是在制作过程中发现了好多困难,首先是“库”的查找,真不知道微软下载中心的想法,发布新资源后竟然不在旧资源那边说明一下。

然后是“库”的检测,即检测“库”是否已经安装了,还有就是“库”版本的检测,坦诚自己曾经因为这部分的内容无法解决而想放弃,当时自己就有一个想法:那些做出运行库合集的人都是大神啊。。。后来发现还是耐心问题

好不容易解决了“库”的检测问题后(其实还有一些需要完善),又要开始折腾静默安装的问题,大部分程序的静默安装都很轻松,但是7zip的静默安装简直快把我逼疯:官网的说明是不对的……而且到现在,静默安装的问题也没有完全解决,因为最后发现python相关的资源几乎全部没法实现静默安装,python 2.7倒是能够实现,wxpython一开始能静默安装,到了“批处理注册”的时候就开始弹窗口了,剩下的py2exe等一堆程序甚至目前还是没找出他们静默安装的参数。

还有一些小细节的问题:

比如VC2005没法用命令行安装,查了以后才发现是版本的问题,选择解压exe再安装后却发现简体中文和繁体中文其实是同一个文件,这样算是因祸得福?= =

比如directx原安装包没法静默安装,即使使用/?它有提示说我可以用/s,但是安装的时候还是必须先解压再运行setup.exe安装;

比如7zip安装时需要定义正确安装路径,否则文件关联会异常;

比如win7下,XNA必须在.Net Frameworks 4.0前面安装……

感觉应该还会出现一些问题,需要在以后的测试中慢慢发现。

艾玛,废话太多。下面是真正的资源说明:

支持简体中文和繁体中文

支持32位和64位

支持 XP 及以上的操作系统

打包的内容有(应该说这个是针对上古卷轴玩家开发的。。里面有Wrye Bash需要的运行库)

  1. 常用运行库/程序
    • Visual C++ 2005 SP1 (8.0.50727.6195)
    • Visual C++ 2008 SP1 (9.0.30729.6161)
    • Visual C++ 2010 SP1 (10.0.40219.1)
    • Microsoft .NET Framework 3.5 SP1 (含2.0/3.0)
    • Microsoft .NET Framework 4.0
  2. 游戏运行库/程序
    • DirectX 9.0c (2010.6)
    • Open Audio Library 2.07(OpenAL)
    • NVIDIA PhysX System 9.12.1031
    • Microsoft XNA Framework 3.1 (需要 .NET 2.0)
    • Microsoft XNA Framework 4.0 (需要 DirectX 9.0c)
  3. 其他运行库/程序
    • 7zip
    • Java 7 Update 21 (JRE)
    • Microsoft AppLocale
    • Wrye Bash 需要的 Python 运行库

注意:安装过程中,如果安全软件拦截,请增加到信任或忽略,继续安装即可!

提示1:Microsoft .NET Framework 3.5 SP1 不支持 Windows 7 系统(安装 .NET 较慢,请耐心等待)。

提示2:Microsoft XNA Framework 3.1 安装前你不能装有 Microsoft .NET Framework 4.0。

下载地址:TESfans Runtime Libraries v1.0.0.0.exe: 城通网盘 | 旋风高速

最初就决定一开始就开源……

下面是打包脚本,使用的是NSIS (Nullsoft Scriptable Install System)(貌似GFW把SourceForge某个IP给拦截了,所以国内玩家上不了。。)

!define APPNAME "TESfans Runtime Libraries"
!define APPVERSION "1.0.0.0"
!define APPNAMEANDVERSION "${APPNAME} v${APPVERSION}"
!define APPWEBSITE "http://tesfans.org/runtime-library/"

Name "${APPNAMEANDVERSION}"
OutFile "${APPNAMEANDVERSION}.exe"
VIProductVersion "${APPVERSION}"
InstallDir "$TEMP\TRL.tmp"
RequestExecutionLevel admin

!include "MUI2.nsh"
!include "x64.nsh"
!include "WordFunc.nsh"
!include "FileFunc.nsh"

Var WinVer
Var VCR2005_Install
Var VCR2008_Install
Var VCR2010_Install
Var NET35sp1_Install
Var NET40_Install
Var DirectX_Install
Var OpanAL_Install
Var PhysX_Install
Var XNA31_Install
Var XNA40_Install
Var 7zip_Install
Var java_Install
Var AppLocal_Install

!define MUI_ABORTWARNING
!define MUI_WELCOMEFINISHPAGE_BITMAP "wizard.bmp"
!define MUI_ICON "RuntimeLibraries.ico"
!define MUI_UNICON "RuntimeLibraries.ico"
!define MUI_CUSTOMFUNCTION_GUIINIT onGUIInit
BrandingText "TESfans Runtime Libraries Installer By 幻の冰(icedream@tesfans.org)"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE $(license)
!define MUI_COMPONENTSPAGE_NODESC
!define MUI_PAGE_CUSTOMFUNCTION_PRE ComponentsPre
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE ComponentsLeave
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFileS
!define MUI_FINISHPAGE_NOAUTOCLOSE
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "SimpChinese"
!insertmacro MUI_LANGUAGE "TradChinese"

VIAddVersionKey /LANG=${LANG_SIMPCHINESE} "ProductName" "${APPNAME}"
VIAddVersionKey /LANG=${LANG_SIMPCHINESE} "CompanyName" "icedream@tesfans"
VIAddVersionKey /LANG=${LANG_SIMPCHINESE} "LegalCopyright" "icedream@tesfans"
VIAddVersionKey /LANG=${LANG_SIMPCHINESE} "FileDescription" "TESfans 运行库合集"
VIAddVersionKey /LANG=${LANG_SIMPCHINESE} "FileVersion" "${APPVERSION}"
LicenseLangString license ${LANG_SIMPCHINESE} "ReanMe_CN.rtf"
LangString Button_Update ${LANG_SIMPCHINESE} "更新(&U)"
LangString Section_REC ${LANG_SIMPCHINESE} "推荐安装"
LangString Section_TES ${LANG_SIMPCHINESE} "老滚玩家"
LangString Section_FUL ${LANG_SIMPCHINESE} "完整安装"
LangString Section_MAO ${LANG_SIMPCHINESE} "猫猫专用"
LangString Section_COM ${LANG_SIMPCHINESE} "常用运行库/程序"
LangString Section_GAM ${LANG_SIMPCHINESE} "游戏运行库/程序"
LangString Section_OTH ${LANG_SIMPCHINESE} "其他运行库/程序"
LangString Section_WBP ${LANG_SIMPCHINESE} "Wrye Bash 专用"
LangString Text_Unsupported ${LANG_SIMPCHINESE} "不支持的操作系统。"
LangString Text_Installed ${LANG_SIMPCHINESE} "【已安装】"
LangString Text_Update ${LANG_SIMPCHINESE} "【可更新】"
LangString Text_Require ${LANG_SIMPCHINESE} "的安装之前您必须先安装"

VIAddVersionKey /LANG=${LANG_TRADCHINESE} "ProductName" "${APPNAME}"
VIAddVersionKey /LANG=${LANG_TRADCHINESE} "CompanyName" "icedream@tesfans"
VIAddVersionKey /LANG=${LANG_TRADCHINESE} "LegalCopyright" "icedream@tesfans"
VIAddVersionKey /LANG=${LANG_TRADCHINESE} "FileDescription" "TESfans 運行庫合集"
VIAddVersionKey /LANG=${LANG_TRADCHINESE} "FileVersion" "${APPVERSION}"
LicenseLangString license ${LANG_TRADCHINESE} "ReanMe_TW.rtf"
LangString Button_Update ${LANG_TRADCHINESE} "更新(&U)"
LangString Section_REC ${LANG_TRADCHINESE} "推薦安裝"
LangString Section_TES ${LANG_TRADCHINESE} "老滾玩家"
LangString Section_FUL ${LANG_TRADCHINESE} "完整安裝"
LangString Section_MAO ${LANG_TRADCHINESE} "貓貓專用"
LangString Section_COM ${LANG_TRADCHINESE} "常用運行庫/程式"
LangString Section_GAM ${LANG_TRADCHINESE} "遊戲運行庫/程式"
LangString Section_OTH ${LANG_TRADCHINESE} "其他運行庫/程式"
LangString Section_WBP ${LANG_TRADCHINESE} "Wrye Bash 專用"
LangString Text_Unsupported ${LANG_TRADCHINESE} "不支持的操作體系。"
LangString Text_Installed ${LANG_TRADCHINESE} "【已安裝】"
LangString Text_Update ${LANG_TRADCHINESE} "【可更新】"
LangString Text_Require ${LANG_TRADCHINESE} "的安裝之前您必須先安裝"

InstType "$(Section_REC)" ; 推荐安装
InstType "$(Section_TES)" ; 老滚玩家
InstType "$(Section_FUL)" ; 完整安装
InstType "$(Section_MAO)" ; 猫猫专用

SectionGroup /e "$(Section_COM)"

	Section "Visual C++ 2005 SP1" SEC_VC2005
		SectionIn 1 3
		${If} ${RunningX64}
			SetOutPath "$INSTDIR\vcredist_2005sp1_x86"
			File "VC\vcredist_2005sp1_x86\*.*"
			ExecWait '"msiexec" /i "$INSTDIR\vcredist_2005sp1_x86\vcredist.msi" /quiet /norestart'
			SetOutPath "$INSTDIR\vcredist_2005sp1_x64"
			File "VC\vcredist_2005sp1_x64\*.*"
			ExecWait '"msiexec" /i "$INSTDIR\vcredist_2005sp1_x64\vcredist.msi" /quiet /norestart'
		${Else}
			SetOutPath "$INSTDIR\vcredist_2005sp1_x86"
			File "VC\vcredist_2005sp1_x86\*.*"
			ExecWait '"msiexec" /i "$INSTDIR\vcredist_2005sp1_x86\vcredist.msi" /quiet /norestart'
		${EndIf}
	SectionEnd

	Section "Visual C++ 2008 SP1" SEC_VC2008
		SectionIn 1 2 3 4
		SetOutPath $INSTDIR
		${If} ${RunningX64}
			File "VC\vcredist_2008sp1_x86.exe"
			ExecWait '"$INSTDIR\vcredist_2008sp1_x86.exe" /q /norestart'
			File "VC\vcredist_2008sp1_x64.exe"
			ExecWait '"$INSTDIR\vcredist_2008sp1_x64.exe" /q /norestart'
		${Else}
			File "VC\vcredist_2008sp1_x86.exe"
			ExecWait '"$INSTDIR\vcredist_2008sp1_x86.exe" /q /norestart'
		${EndIf}
	SectionEnd

	Section "Visual C++ 2010 SP1" SEC_VC2010
		SectionIn 1 2 3 4
		SetOutPath $INSTDIR
		${If} ${RunningX64}
			File "VC\vcredist_2010sp1_x86.exe"
			ExecWait '"$INSTDIR\vcredist_2010sp1_x86.exe" /q /norestart'
			File "VC\vcredist_2010sp1_x64.exe"
			ExecWait '"$INSTDIR\vcredist_2010sp1_x64.exe" /q /norestart'
		${Else}
			File "VC\vcredist_2010sp1_x86.exe"
			ExecWait '"$INSTDIR\vcredist_2010sp1_x86.exe" /q /norestart'
		${EndIf}
	SectionEnd

	Section "Microsoft .NET Framework 3.5 SP1(含2.0/3.0)" SEC_NF35
		SectionIn 1 2 3 4
		SetOutPath $INSTDIR
		File "dotNextFX\dotnetfx35sp1.exe"
		ExecWait '"$INSTDIR\dotnetfx35sp1.exe" /q /norestart'
		/*
		${If} $WinVer == "XP"
		${OrIf} $WinVer == "2003"
		${OrIf} $WinVer == "Vista"
			${If} ${RunningX64}
				File "dotNextFX\NDP35SP1-KB958484-x86.exe"
				ExecWait '"$INSTDIR\NDP35SP1-KB958484-x86.exe" /q /norestart'
				File "dotNextFX\NDP35SP1-KB958484-x64.exe"
				ExecWait '"$INSTDIR\NDP35SP1-KB958484-x64.exe" /q /norestart'
			${Else}
				File "dotNextFX\NDP35SP1-KB958484-x86.exe"
				ExecWait '"$INSTDIR\NDP35SP1-KB958484-x86.exe" /q /norestart'
			${EndIf}
		${EndIf}
		*/
	SectionEnd

	Section "Microsoft .NET Framework 4.0" SEC_NF40
		SectionIn 1 2 3
		SetOutPath $INSTDIR

		; Need to install XNA 3.1 before .NET Framework 4.0.
		${If} $3 == ${SF_SELECTED}
			; do nothing
		${Else}
			File "dotNextFX\dotNetFx40_Full_x86_x64.exe"
			ExecWait '"$INSTDIR\dotNetFx40_Full_x86_x64.exe" /q /norestart'
		${EndIf}

	SectionEnd

SectionGroupEnd

SectionGroup /e "$(Section_GAM)"

	Section "DirectX 9.0c (2010.6)" SEC_Directx
		SectionIn 1 2 3 4
		SetOutPath "$INSTDIR\DirectX"
		File "DirectX\*.*"
		ExecWait '"$INSTDIR\DirectX\DXSETUP.exe" /silent'
	SectionEnd

	Section "Open Audio Library 2.07(OpenAL)" SEC_OpenAL
		SectionIn 3
		SetOutPath $INSTDIR
		File "oalinst.exe"
		ExecWait '"$INSTDIR\oalinst.exe" /s /norestart'
	SectionEnd

	Section "NVIDIA PhysX System 9.12.1031" SEC_PhysX
		SectionIn 3
		SetOutPath $INSTDIR
		File "PhysX-9.12.1031-SystemSoftware.msi"
		ExecWait '"msiexec" /i "$INSTDIR\PhysX-9.12.1031-SystemSoftware.msi" /quiet /norestart'
	SectionEnd

	Section "Microsoft XNA Framework 3.1(需要 .NET 2.0)" SEC_XNA31
		SectionIn 1 3
		SetOutPath $INSTDIR
		File "XNA\xnafx31_redist.msi"
		ExecWait '"msiexec" /i "$INSTDIR\xnafx31_redist.msi" /quiet /norestart'

		; If .Net 4.0 is selected...
		${If} $5 == ${SF_SELECTED}
			File "dotNextFX\dotNetFx40_Full_x86_x64.exe"
			ExecWait '"$INSTDIR\dotNetFx40_Full_x86_x64.exe" /q /norestart'
		${EndIf}	
	SectionEnd

	Section "Microsoft XNA Framework 4.0(需要 DirectX 9.0c)" SEC_XNA40
		SectionIn 1 3
		SetOutPath $INSTDIR
		File "XNA\xnafx40_redist.msi"
		ExecWait '"msiexec" /i "$INSTDIR\xnafx40_redist.msi" /quiet /norestart'
	SectionEnd

SectionGroupEnd

SectionGroup /e "$(Section_OTH)"

	Section "7zip" SEC_7Zip
		SectionIn 1 2 3 4
		SetOutPath $INSTDIR
		${If} ${RunningX64}
			File "7zip\7z920-x64.msi"
			ExecWait '"msiexec" /i "$INSTDIR\7z920-x64.msi" /q INSTALLDIR="$PROGRAMFILES64\7-Zip"'
		${Else}
			File "7zip\7z920.exe"
			ExecWait '"$INSTDIR\7z920.exe" -y /S /D="$PROGRAMFILES\7-Zip"'
		${EndIf}
	SectionEnd

	Section "Java 7 Update 21" SEC_Java
		SectionIn 2 3
		SetOutPath $INSTDIR
		${If} ${RunningX64}
			File "Java\jre-7u21-windows-x64.exe"
			ExecWait '"$INSTDIR\jre-7u21-windows-x64.exe" /s /norestart'
		${Else}
			File "Java\jre-7u21-windows-i586.exe"
			ExecWait '"$INSTDIR\jre-7u21-windows-i586.exe" /s /norestart'
		${EndIf}
	SectionEnd

	Section "Microsoft AppLocale" SEC_AppLocale
		SectionIn 1 2 3
		SetOutPath $INSTDIR
		File "pApplocale.msi"
		ExecWait '"msiexec" /i "$INSTDIR\pApplocale.msi" /quiet /norestart'
	SectionEnd

	SectionGroup "$(Section_WBP)" 

		Section "Python 2.7.4" SEC_Python
			SectionIn 4
			SetOutPath $INSTDIR
			File "Python\python-2.7.4.msi"
			ExecWait '"msiexec" /i "$INSTDIR\python-2.7.4.msi" /quiet /norestart'
		SectionEnd

		Section "wxPython 2.8.12.1" SEC_WXPython
			SectionIn 4
			SetOutPath $INSTDIR
			File "Python\wxPython2.8-win32-unicode-2.8.12.1-py27.exe"
			ExecWait '"$INSTDIR\wxPython2.8-win32-unicode-2.8.12.1-py27.exe" SP- /verysilent /norestart'
		SectionEnd

		Section "PyWin32 2.18" SEC_PyWin
			SectionIn 4
			SetOutPath $INSTDIR
			File "Python\pywin32-218.win32-py2.7.exe"
			ExecWait '"$INSTDIR\pywin32-218.win32-py2.7.exe" -quiet' ; silent mode doesn't work
		SectionEnd

		Section "ComTypes 0.6.2" SEC_ComTypes
			SectionIn 4
			SetOutPath $INSTDIR
			File "Python\comtypes-0.6.2.win32.exe"
			ExecWait '"$INSTDIR\comtypes-0.6.2.win32.exe" -silent' ; silent mode doesn't work
		SectionEnd

		Section "py2exe 0.6.9" SEC_Py2Exe
			SectionIn 4
			SetOutPath $INSTDIR
			File "Python\py2exe-0.6.9.win32-py2.7.exe"
			ExecWait '"$INSTDIR\py2exe-0.6.9.win32-py2.7.exe" -silent' ; silent mode doesn't work
		SectionEnd

	SectionGroupEnd

SectionGroupEnd

Section "-Cleanup installers"
	RMDir /r /REBOOTOK "$INSTDIR"
SectionEnd

; GetWindowsVersion 3.0 (2013-02-07)
;
; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/
; Update by Joost Verburg
; Update (Macro, Define, Windows 7 detection) - John T. Haller of PortableApps.com - 2008-01-07
; Update (Windows 8 detection) - Marek Mizanin (Zanir) - 2013-02-07
;
; Usage: ${GetWindowsVersion} $R0
;
; $R0 contains: 95, 98, ME, NT x.x, 2000, XP, 2003, Vista, 7, 8 or '' (for unknown)

Function GetWindowsVersion

  Push $R0
  Push $R1

  ClearErrors

  ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "CurrentVersion"

  IfErrors 0 lbl_winnt

  ; we are not NT
  ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion" "VersionNumber"

  StrCpy $R1 $R0 1
  StrCmp $R1 '4' 0 lbl_error

  StrCpy $R1 $R0 3

  StrCmp $R1 '4.0' lbl_win32_95
  StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98

  lbl_win32_95:
    StrCpy $R0 '95'
  Goto lbl_done

  lbl_win32_98:
    StrCpy $R0 '98'
  Goto lbl_done

  lbl_win32_ME:
    StrCpy $R0 'ME'
  Goto lbl_done

  lbl_winnt:

  StrCpy $R1 $R0 1

  StrCmp $R1 '3' lbl_winnt_x
  StrCmp $R1 '4' lbl_winnt_x

  StrCpy $R1 $R0 3

  StrCmp $R1 '5.0' lbl_winnt_2000
  StrCmp $R1 '5.1' lbl_winnt_XP
  StrCmp $R1 '5.2' lbl_winnt_2003
  StrCmp $R1 '6.0' lbl_winnt_vista
  StrCmp $R1 '6.1' lbl_winnt_7
  StrCmp $R1 '6.2' lbl_winnt_8 lbl_error

  lbl_winnt_x:
    StrCpy $R0 "NT $R0" 6
  Goto lbl_done

  lbl_winnt_2000:
    Strcpy $R0 '2000'
  Goto lbl_done

  lbl_winnt_XP:
    Strcpy $R0 'XP'
  Goto lbl_done

  lbl_winnt_2003:
    Strcpy $R0 '2003'
  Goto lbl_done

  lbl_winnt_vista:
    Strcpy $R0 'Vista'
  Goto lbl_done

  lbl_winnt_7:
    Strcpy $R0 '7'
  Goto lbl_done

  lbl_winnt_8:
    Strcpy $R0 '8'
  Goto lbl_done

  lbl_error:
    Strcpy $R0 ''
  lbl_done:

  Pop $R1
  Exch $R0

FunctionEnd

!macro GetWindowsVersion OUTPUT_VALUE

	Call GetWindowsVersion
	Pop `${OUTPUT_VALUE}`

!macroend

!define GetWindowsVersion '!insertmacro "GetWindowsVersion"'

Function FuncAbout

	ExecShell "open" "${APPWEBSITE}"

FunctionEnd

Function onGUIInit

	; Add an "Update(&U)" button at the left corner on every page.
	System::Call `*(i8,i201,i50,i14)i.R0`
	System::Call `user32::MapDialogRect(i$HWNDPARENT,iR0)`
	System::Call `*$R0(i.R1,i.R2,i.R3,i.R4)`
	System::Free $R0
	System::Call `user32::CreateWindowEx(i,ts,ts,i${BS_PUSHBUTTON}|${WS_CHILD}|${WS_VISIBLE}|${WS_TABSTOP},iR1,iR2,iR3,iR4,i$HWNDPARENT,i1300,i,i)i.R0` `Button` `$(Button_Update)`
	SendMessage $HWNDPARENT ${WM_GETFONT} 0 0 $0
	SendMessage $R0 ${WM_SETFONT} $0 0
	GetFunctionAddress $R0 FuncAbout
	ButtonEvent::AddEventHandler 1300 $R0

FunctionEnd

Function .onInit

	!insertmacro MUI_LANGDLL_DISPLAY

	${GetWindowsVersion} $WinVer
	${If} $WinVer != "XP"
	${AndIf} $WinVer != "2003"
	${AndIf} $WinVer != "Vista"
	${AndIf} $WinVer != "7"
	${AndIf} $WinVer != "8"
		MessageBox MB_OK "$(Text_Unsupported)"
		Abort
	${EndIf}

FunctionEnd

Function ComponentsPre

	; SectionSize Fix.
	${If} ${RunningX64}

		SectionSetSize ${SEC_VC2005} 3096
		SectionSetSize ${SEC_VC2008} 5086
		SectionSetSize ${SEC_VC2010} 10034
		SectionSetSize ${SEC_7zip} 1345
		SectionSetSize ${SEC_Java} 32344
		/*
		${If} $WinVer == "XP"
		${OrIf} $WinVer == "2003"
		${OrIf} $WinVer == "Vista"
			SectionSetSize ${SEC_NF35} 238492
		${Else}
			SectionSetSize ${SEC_NF35} 237054
		${EndIf}
		*/
	${Else}

		SectionSetSize ${SEC_VC2005} 3096
		SectionSetSize ${SEC_VC2008} 4375
		SectionSetSize ${SEC_VC2010} 8780
		SectionSetSize ${SEC_7Zip} 1085
		SectionSetSize ${SEC_Java} 30925
		/*
		${If} $WinVer == "XP"
		${OrIf} $WinVer == "2003"
		${OrIf} $WinVer == "Vista"
			SectionSetSize ${SEC_NF35} 238446
		${Else}
			SectionSetSize ${SEC_NF35} 237054
		${EndIf}
		*/
	${EndIf}

	${GetFileVersion} "$COMMONFILES\Microsoft Shared\VC\msdia80.dll" $VCR2005_Install
	${If} $VCR2005_Install != ""
		${VersionCompare} $VCR2005_Install "8.0.50727.6195" $R0
		${If} $R0 == "2"
			SectionSetText ${SEC_VC2005} "Visual C++ 2005 SP1$(Text_Update)"
		${Else}
			SectionSetText ${SEC_VC2005} "$(Text_Installed)Visual C++ 2005 SP1"
			SectionSetFlags ${SEC_VC2005} "SECTION_OFF"
		${EndIf}
	${EndIf}

	${GetFileVersion} "$COMMONFILES\Microsoft Shared\VC\msdia90.dll" $VCR2008_Install
	${If} $VCR2008_Install != ""
		${VersionCompare} $VCR2008_Install "9.0.30729.6161" $R0
		${If} $R0 == "2"
			SectionSetText ${SEC_VC2008} "Visual C++ 2008 SP1$(Text_Update)"
		${Else}
			SectionSetText ${SEC_VC2008} "$(Text_Installed)Visual C++ 2008 SP1"
			SectionSetFlags ${SEC_VC2008} "SECTION_OFF"
		${EndIf}
	${EndIf}

	${GetFileVersion} "$COMMONFILES\Microsoft Shared\VC\msdia100.dll" $VCR2010_Install
	${If} $VCR2010_Install != ""
		${VersionCompare} $VCR2010_Install "10.0.40219.1" $R0
		${If} $R0 == "2"
			SectionSetText ${SEC_VC2010} "Visual C++ 2010 SP1$(Text_Update)"
		${Else}
			SectionSetText ${SEC_VC2010} "$(Text_Installed)Visual C++ 2010 SP1"
			SectionSetFlags ${SEC_VC2010} "SECTION_OFF"
		${EndIf}
	${EndIf}

	ReadRegDWORD $NET35sp1_Install HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" "SP"
	${If} $NET35sp1_Install == "1"
		SectionSetText ${SEC_NF35} "$(Text_Installed)Microsoft .NET Framework 3.5 SP1(含2.0/3.0)"
		SectionSetFlags ${SEC_NF35} "SECTION_OFF"
	${EndIf}

	ReadRegDWORD $NET40_Install HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" "Install"
	${If} $NET40_Install == "1"
		SectionSetText ${SEC_NF40} "$(Text_Installed)Microsoft .NET Framework 4.0"
		SectionSetFlags ${SEC_NF40} "SECTION_OFF"
	${EndIf}

	${GetFileVersion} "$SYSDIR\D3DX9_43.dll" $DirectX_Install
	${If} $DirectX_Install != ""
		${GetFileVersion} "$SYSDIR\D3DX10_43.dll" $DirectX_Install
		${If} $DirectX_Install != ""
			${GetFileVersion} "$SYSDIR\D3DX10_43.dll" $DirectX_Install
			${If} $DirectX_Install != ""
				${VersionCompare} $DirectX_Install "9.29.952.3111" $R0
				${If} $R0 == "2"
					SectionSetText ${SEC_Directx} "DirectX 9.0c (2010.6)$(Text_Update)"
				${Else}
					SectionSetText ${SEC_Directx} "$(Text_Installed)DirectX 9.0c (2010.6)"
					SectionSetFlags ${SEC_Directx} "SECTION_OFF"
				${EndIf}
			${EndIf}
		${EndIf}
	${EndIf}

	; need a better way to detect OpenAL
	${GetFileVersion} "$PROGRAMFILES\OpenAL\oalinst.exe" $OpanAL_Install
	${If} $OpanAL_Install != ""
		${VersionCompare} $OpanAL_Install "2.0.7.0" $R0
		${If} $R0 == "2"
			SectionSetText ${SEC_OpenAL} "Open Audio Library 2.07(OpenAL)$(Text_Update)"
		${Else}
			SectionSetText ${SEC_OpenAL} "$(Text_Installed)Open Audio Library 2.07(OpenAL)"
			SectionSetFlags ${SEC_OpenAL} "SECTION_OFF"
		${EndIf}
	${EndIf}

	; need a better way to detect NVIDIA PhysX System
	ReadRegStr $PhysX_Install HKLM "SOFTWARE\NVIDIA Corporation\PhysXUpdateLoader\DllTable\BB1982D9-A929-41d9-A785-54500EB49567" "dll_path"
	${If} $PhysX_Install != ""
		SectionSetText ${SEC_PhysX} "$(Text_Installed)NVIDIA PhysX System 9.12.1031"
		SectionSetFlags ${SEC_PhysX} "SECTION_OFF"
	${EndIf}

	ReadRegStr $XNA31_Install HKLM "SOFTWARE\Microsoft\XNA\Framework\v3.1" "ProductVersion"
	${If} $XNA31_Install != ""
		${VersionCompare} $XNA31_Install "3.1.10527.0" $R0
		${If} $R0 == "2"
			SectionSetText ${SEC_XNA31} "Microsoft XNA Framework 3.1$(Text_Update)"
		${Else}
			SectionSetText ${SEC_XNA31} "$(Text_Installed)Microsoft XNA Framework 3.1"
			SectionSetFlags ${SEC_XNA31} "SECTION_OFF"
		${EndIf}
	${EndIf}

	ReadRegStr $XNA40_Install HKLM "SOFTWARE\Microsoft\XNA\Framework\v4.0" "ProductVersion"
	${If} $XNA40_Install != ""
		${VersionCompare} $XNA40_Install "4.0.30901.0" $R0
		${If} $R0 == "2"
			SectionSetText ${SEC_XNA40} "Microsoft XNA Framework 4.0$(Text_Update)"
		${Else}
			SectionSetText ${SEC_XNA40} "$(Text_Installed)Microsoft XNA Framework 4.0"
			SectionSetFlags ${SEC_XNA40} "SECTION_OFF"
		${EndIf}
	${EndIf}

	${If} ${RunningX64}
		SetRegView 64 ; 64-bit register view fixes for 7zip and java detections
	${EndIf}

	ReadRegStr $7zip_Install HKLM "SOFTWARE\7-Zip" "Path"
	${If} $7zip_Install != ""
		SectionSetText ${SEC_7Zip} "$(Text_Installed)7zip"
		SectionSetFlags ${SEC_7Zip} "SECTION_OFF"
	${EndIf}

	ReadRegStr $JAVA_Install HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "Java7FamilyVersion"
	${If} $JAVA_Install != ""
		${VersionConvert} $JAVA_Install "" $JAVA_Install
		${VersionCompare} $JAVA_Install "1.7.0.21" $R0
		${If} $R0 == "2"
			SectionSetText ${SEC_Java} "Java 7 Update 21$(Text_Update)"
		${Else}
			SectionSetText ${SEC_Java} "$(Text_Installed)Java 7 Update 21"
			SectionSetFlags ${SEC_Java} "SECTION_OFF"
		${EndIf}
	${EndIf}

	SetRegView lastused

	ReadRegStr $AppLocal_Install HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{394BE3D9-7F57-4638-A8D1-1D88671913B7}" "DisplayVersion"
	${If} $AppLocal_Install != ""
		SectionSetText ${SEC_AppLocale} "$(Text_Installed)Microsoft AppLocale"
		SectionSetFlags ${SEC_AppLocale} "SECTION_OFF"
	${EndIf}

FunctionEnd

Function ComponentsLeave

	SectionGetFlags ${SEC_XNA31} $3
	SectionGetFlags ${SEC_XNA40} $4
	SectionGetFlags ${SEC_NF35} $2
	SectionGetFlags ${SEC_NF40} $5

	; warning if XNA Framework 3.1 is selected but .NET Framework 3.5 SP1 not detected.
	${If} $3 == ${SF_SELECTED}
		${If} $2 != ${SF_SELECTED}
		${AndIf} NET35sp1_Install == ""
			MessageBox MB_OK "Microsoft XNA Framework 3.1 $(Text_Require) Microsoft .NET Framework 3.5 SP1。"
			SectionSetFlags ${SEC_NF35} ${SF_SELECTED}
			Abort
		${EndIf}
	${EndIf}

	; warning if XNA Framework 4.0 is selected but .NET Framework 4.0 not detected.
	${If} $4 == ${SF_SELECTED}
		${If} $5 != ${SF_SELECTED}
		${AndIf} NET40_Install == ""
			MessageBox MB_OK "Microsoft XNA Framework 4.0 $(Text_Require) Microsoft .NET Framework 4.0。"
			SectionSetFlags ${SEC_NF40} ${SF_SELECTED}
			Abort
		${EndIf}
	${EndIf}

FunctionEnd

程序图标来源于:http://www.iconshock.com

感觉还需要完善的部分:

  • 可能的话,再增加一些运行库;
  • VC组建的版本貌似不是最新版的(最新版好像是以系统补丁的方式推送的);
  • 需要找一个更好的方式来检测 OpenAL 和 NVIDIA PhysX System ;
  • 安装失败的话会有提示;
  • python相关程序的静默模式;
  • 安装组建选择页面也许需要调整一下。
icedream

About icedream

其实我知道的东西很少,只是翻译了一些东西,悲催的是翻译过后很快就忘了。

3 Responses to 运行库合集

  1. ws00262753 2013 年 5 月 10 日 at 下午 1:00 #

    我记得Win7似乎不兼容AppLocale…

    • icedream 2013 年 5 月 10 日 at 下午 1:02 #

      用兼容模式可以安装,win8测试可以用,win7还没测试,你说的不兼容是什么情况?

      • ws00262753 2013 年 5 月 12 日 at 下午 5:44 #

        呃…Win7没试过用兼容模式装…
        目前用的NTLEA…