NSIS:使用FileFunc.nsh头文件判断文件版本

简介: 原文 NSIS:使用FileFunc.nsh头文件判断文件版本 这里,轻狂拿WMP10做一个例子。关于WMP10的原始安装文件,可以下载后通过/C /T:D:\Windows Media Player参数(参数说明:将文件解开到D:\Windows Media Player文件夹)得到。

原文 NSIS:使用FileFunc.nsh头文件判断文件版本

这里,轻狂拿WMP10做一个例子。关于WMP10的原始安装文件,可以下载后通过/C /T:D:\Windows Media Player参数(参数说明:将文件解开到D:\Windows Media Player文件夹)得到。

 

首先,引入头文件:

!include "FileFunc.nsh"

然后,写详细的代码:

Section "WMP" SEC_WMP
${GetFileVersion} "$PROGRAMFILES\Windows Media Player\wmplayer.exe" $R1
Pop $R1
  ${If} $R1 < '10.0.0.3802'
  MessageBox MB_YESNO "您的Windows Media Player版本过低,是否升级到推荐版本?" IDNO NoReadme
 
  SetDetailsPrint textonly
  DetailPrint "正在安装 Windows Media Player10..."
  SetDetailsPrint listonly
 
  SetOutPath "$TEMP\MP10"
  File "Windows Media Player10\9SeriesD.wmz"
  File "Windows Media Player10\asferror.dll"
  File "Windows Media Player10\audiodev.dll"
  File "Windows Media Player10\blackbox.dll"
  File "Windows Media Player10\CEWMDM.dll"
  File "Windows Media Player10\codecs10.cat"
  File "Windows Media Player10\codecs10.inf"
  File "Windows Media Player10\Compact.wmz"
  File "Windows Media Player10\control.xml"
  File "Windows Media Player10\custsat.dll"
  File "Windows Media Player10\DRM10.cat"
  File "Windows Media Player10\DRM10.inf"
  File "Windows Media Player10\DRMClien.dll"
  File "Windows Media Player10\DrmStor.dll"
  File "Windows Media Player10\drmupgds.exe"
  File "Windows Media Player10\drmv2clt.dll"
  File "Windows Media Player10\eula.txt"
  File "Windows Media Player10\l3codecp.acm"
  File "Windows Media Player10\LAPRXY.DLL"
  File "Windows Media Player10\logagent.exe"
  File "Windows Media Player10\migrate.exe"
  File "Windows Media Player10\MPCD10.cat"
  File "Windows Media Player10\MPCD10.inf"
  File "Windows Media Player10\MPPRE10.cat"
  File "Windows Media Player10\MPPRE10.inf"
  File "Windows Media Player10\MPSTUB10.cat"
  File "Windows Media Player10\MPSTUB10.inf"
  File "Windows Media Player10\mpvis.DLL"
  File "Windows Media Player10\msnetobj.dll"
  File "Windows Media Player10\msnlogo.png"
  File "Windows Media Player10\msnsmall.png"
  File "Windows Media Player10\msoobci.dll"
  File "Windows Media Player10\MsPMSNSv.dll"
  File "Windows Media Player10\MsPMSP.dll"
  File "Windows Media Player10\msscp.dll"
  File "Windows Media Player10\MSWMDM.dll"
  File "Windows Media Player10\mymusic.inf"
  File "Windows Media Player10\Plylst1.wpl"
  File "Windows Media Player10\Plylst10.wpl"
  File "Windows Media Player10\Plylst11.wpl"
  File "Windows Media Player10\Plylst12.wpl"
  File "Windows Media Player10\Plylst13.wpl"
  File "Windows Media Player10\Plylst14.wpl"
  File "Windows Media Player10\Plylst15.wpl"
  File "Windows Media Player10\Plylst2.wpl"
  File "Windows Media Player10\Plylst3.wpl"
  File "Windows Media Player10\Plylst4.wpl"
  File "Windows Media Player10\Plylst5.wpl"
  File "Windows Media Player10\Plylst6.wpl"
  File "Windows Media Player10\Plylst7.wpl"
  File "Windows Media Player10\Plylst8.wpl"
  File "Windows Media Player10\Plylst9.wpl"
  File "Windows Media Player10\qasf.dll"
  File "Windows Media Player10\QuickSi.wmz"
  File "Windows Media Player10\Revert.wmz"
  File "Windows Media Player10\setup_wm.exe"
  File "Windows Media Player10\skins.inf"
  File "Windows Media Player10\skinsmui.inf"
  File "Windows Media Player10\syncpl01.wpl"
  File "Windows Media Player10\syncpl02.wpl"
  File "Windows Media Player10\syncpl03.wpl"
  File "Windows Media Player10\syncpl04.wpl"
  File "Windows Media Player10\syncpl05.wpl"
  File "Windows Media Player10\syncpl06.wpl"
  File "Windows Media Player10\syncpl07.wpl"
  File "Windows Media Player10\syncpl08.wpl"
  File "Windows Media Player10\syncpl09.wpl"
  File "Windows Media Player10\syncpl10.wpl"
  File "Windows Media Player10\syncpl11.wpl"
  File "Windows Media Player10\syncpl12.wpl"
  File "Windows Media Player10\unregmp2.exe"
  File "Windows Media Player10\uWDF.exe"
  File "Windows Media Player10\WdfApi.dll"
  File "Windows Media Player10\WdfMgr.exe"
  File "Windows Media Player10\WMADMOD.DLL"
  File "Windows Media Player10\WMADMOE.DLL"
  File "Windows Media Player10\WMASF.DLL"
  File "Windows Media Player10\WMDM10.cat"
  File "Windows Media Player10\WMDM10.inf"
  File "Windows Media Player10\WMDMLOG.dll"
  File "Windows Media Player10\WMDMPS.dll"
  File "Windows Media Player10\wmdrmdev.dll"
  File "Windows Media Player10\wmdrmnet.dll"
  File "Windows Media Player10\wmerror.dll"
  File "Windows Media Player10\WMFSDK10.cat"
  File "Windows Media Player10\WMFSDK10.inf"
  File "Windows Media Player10\wmidx.dll"
  File "Windows Media Player10\wmlaunch.exe"
  File "Windows Media Player10\WMNetMgr.dll"
  File "Windows Media Player10\wmp.dll"
  File "Windows Media Player10\wmp.ocx"
  File "Windows Media Player10\WMP10.cat"
  File "Windows Media Player10\wmp10.chm"
  File "Windows Media Player10\WMP10.inf"
  File "Windows Media Player10\wmpasf.dll"
  File "Windows Media Player10\wmpband.dll"
  File "Windows Media Player10\wmpcd.dll"
  File "Windows Media Player10\wmpcore.dll"
  File "Windows Media Player10\wmpdxm.dll"
  File "Windows Media Player10\wmpenc.exe"
  File "Windows Media Player10\WMPEncEn.dll"
  File "Windows Media Player10\wmperr10.chm"
  File "Windows Media Player10\wmplayer.adm"
  File "Windows Media Player10\wmplayer.exe"
  File "Windows Media Player10\wmploc.DLL"
  File "Windows Media Player10\wmpshell.dll"
  File "Windows Media Player10\wmpsrcwp.dll"
  File "Windows Media Player10\wmpui.dll"
  File "Windows Media Player10\WMSDMOD.DLL"
  File "Windows Media Player10\WMSDMOE2.DLL"
  File "Windows Media Player10\WMSET10.cat"
  File "Windows Media Player10\WMSET10.inf"
  File "Windows Media Player10\wmsetsdk.exe"
  File "Windows Media Player10\wmsetsdk.inf"
  File "Windows Media Player10\WMSPDMOD.DLL"
  File "Windows Media Player10\WMSPDMOE.DLL"
  File "Windows Media Player10\WMVADVD.DLL"
  File "Windows Media Player10\WMVADVE.DLL"
  File "Windows Media Player10\WMVCORE.DLL"
  File "Windows Media Player10\WMVDMOD.DLL"
  File "Windows Media Player10\WMVDMOE2.DLL"
  File "Windows Media Player10\WPD10.cat"
  File "Windows Media Player10\WPD10.inf"
  File "Windows Media Player10\wpdconns.dll"
  File "Windows Media Player10\wpdmtp.dll"
  File "Windows Media Player10\wpdmtp.inf"
  File "Windows Media Player10\wpdmtpdr.dll"
  File "Windows Media Player10\wpdmtpus.dll"
  File "Windows Media Player10\WPDSp.dll"
  File "Windows Media Player10\wpdtrace.dll"
  File "Windows Media Player10\wpdusb.sys"
  File "Windows Media Player10\wpd_ci.dll"
  ExecWait '$TEMP\MP10\setup_wm.exe /Q' $R1
  RMDir /r "$TEMP\MP10"
  ${EndIf}
  NoReadme:
SectionEnd
目录
相关文章
|
11月前
|
IDE 编译器 Linux
linux 编译 c或cpp 文件为动态库 so 文件(最简单直观的模板)
linux 编译 c或cpp 文件为动态库 so 文件(最简单直观的模板)
关于 QtCreator中写Qt程序遇到printf不输出问题 的解决方法
关于 QtCreator中写Qt程序遇到printf不输出问题 的解决方法
|
4月前
|
Ubuntu 网络安全 C语言
vscode 编译多个当前目录下cpp文件,报错未定义标识符的问题
vscode 编译多个当前目录下cpp文件,报错未定义标识符的问题
92 0
|
8月前
|
Linux API C语言
编译参数中如何包含头文件和动态链接库
GCC编译参数:如何包含头文件和动态链接库
50 0
|
9月前
|
编解码 IDE Linux
VS2015报错:由于找不到opencv_wordxxx.dll,无法继续执行代码。重新安装程序可能会解决此问题。
VS2015报错:由于找不到opencv_wordxxx.dll,无法继续执行代码。重新安装程序可能会解决此问题。
217 0
|
芯片 C++
【MDK(keil)编译错误】找不到main.o及解决方法、多处报错“未定义”
【MDK(keil)编译错误】找不到main.o及解决方法、多处报错“未定义”
717 0
【MDK(keil)编译错误】找不到main.o及解决方法、多处报错“未定义”
|
Linux
LINUX编译时缺少头文件,查找依赖库的终极解决办法
LINUX编译时缺少头文件,查找依赖库的终极解决办法
327 0
|
C++ iOS开发
iOS开发 -- 在Xcode中引入cpp文件,并调用cpp文件中的方法
iOS开发 -- 在Xcode中引入cpp文件,并调用cpp文件中的方法
661 0
iOS开发 -- 在Xcode中引入cpp文件,并调用cpp文件中的方法
|
Linux Windows
CLion 在头文件和源文件之间切换
该快捷方式在键盘图中称为“相关符号”。
1581 0
|
计算机视觉
Qt实用技巧:win将ffmpeg、opengl、osg等各种库封装成qt模块,运行需要dll,增加自动拷贝运行库到exe目录执行脚本
Qt实用技巧:win将ffmpeg、opengl、osg等各种库封装成qt模块,运行需要dll,增加自动拷贝运行库到exe目录执行脚本