原文 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

NSIS:使用FileFunc.nsh头文件判断文件版本的更多相关文章

  1. NSIS:使用WinVer.nsh头文件判断操作系统版本

    原文 NSIS:使用WinVer.nsh头文件判断操作系统版本 AtLeastWin<version> 检测是否高于指定版本 IsWin<version> 检测指定版本(唯一限 ...

  2. NSIS使用WinVer.nsh头文件判断操作系统版本

    NSIS使用WinVer.nsh头文件判断操作系统版本,首先请下载最新的WinVer.nsh: http://nsis.sourceforge.net/Include/WinVer.nsh(下载后置于 ...

  3. PHP取二进制文件头快速判断文件类型

    <?php /*文件扩展名说明 *7173 gif *255216 jpg *13780 png *6677 bmp *239187 txt,aspx,asp,sql *208207 xls.d ...

  4. PHP取二进制文件头快速判断文件类型的实现代码

    通过读取文件头信息来识别文件的真实类型. 一般我们都是按照文件扩展名来判断文件类型,但是这个很不靠谱,轻易就通过修改扩展名来躲避了,一般必须要读取文件信息来识别,PHP扩展中提供了类似 exif_im ...

  5. 判断文件是否存在,不存在创建文件&&判断文件夹是否存在,不存在创建文件夹

    1.判断文件是否存在,不存在创建文件 File file=new File("C:\\Users\\QPING\\Desktop\\JavaScript\\2.htm"); if( ...

  6. [Go] golang创建目录写文件判断文件

    package main import ( "log" "os" ) func main() { //创建目录 os.Mkdir("test" ...

  7. [函数] PHP取二进制文件头快速判断文件类型

    一般我们都是按照文件扩展名来判断文件类型,但其实不太靠谱,因为可以通过修改扩展名来伪装文件类型.其实我们可以通过读取文件信息来识别,比如 PHP扩展中提供了类似 exif_imagetype 这样的函 ...

  8. C#判断文件及文件夹是否存在并创建(C#判断文件夹存在)

    protected void Button1_Click(object sender, EventArgs e) { if (Directory.Exists(Server.MapPath(" ...

  9. Asp.Net判断文件是否存在

    在上传文件时经常要判断文件夹是否存在,如果存在就上传文件,否则新建文件夹再上传文件 判断语句为 if (System.IO.Directory.Exists(Server.MapPath(" ...

随机推荐

  1. Hibernate操作Clob数据类型

    在POJO字符串可以声明为一个大型对象java.lang.String要么java.sql.Clob种类. 当程序从数据库加载Clob数据的类型.负荷只有一个Clob数据的逻辑指针类型.我们需要通过使 ...

  2. Trie图

    AC自动机是KMP的多串形式,当文本串失配时,AC自动机的fail指针告诉我们应该跳到哪里去继续匹配(跳到当前匹配串的最长后缀去),所以AC自动机的状态是有限的 但是AC自动机具有不确定性, 比如要求 ...

  3. Android在发送带有附件的邮件

    准备好工作了-下载最新的版本号JMail https://java.net/projects/javamail/pages/Home#Download_JavaMail_1.5.2_Release h ...

  4. 【UFLDL】多层神经网络

    请参见原始英文教程地址:http://ufldl.stanford.edu/tutorial/supervised/MultiLayerNeuralNetworks 本文是在学习该教程时记得笔记,供參 ...

  5. MVC Razor标签

    1. RenderBody在Razor引擎中没有了“母版页”,取而代之的是叫做“布局”的页面(_Layout.cshtml)放在了共享视图文件夹中.在这个页面中,会看到标签里有这样一条语句:@Rend ...

  6. ORACLE Install (10g r2) FOR Red Hat Enterprise Linux Server release 5.5 (64 bit) (转)

    OS Info----------# cat /etc/redhat-releaseRed Hat Enterprise Linux Server release 5.5 (Tikanga)# cat ...

  7. 十大经典数据挖掘算法(9) 朴素贝叶斯分类器 Naive Bayes

    贝叶斯分类器 贝叶斯分类分类原则是一个对象的通过先验概率.贝叶斯后验概率公式后计算,也就是说,该对象属于一类的概率.选择具有最大后验概率的类作为对象的类属.现在更多的研究贝叶斯分类器,有四个,每间:N ...

  8. 《炉石传说》建筑设计欣赏(6):卡&amp;在执行数据时,组织能力

    上一篇文章我们看到了<炉石传说>核心存储卡的数据,今天,我们不断探索卡&身手. 基本的类 通过之前的分析,卡牌&技能涉及到几个类体系:Entity.Actor.Card.S ...

  9. 技术七Gitservergitolite要构建和操作方便

    最近,人懒,为了让自己的变化,所以,我决定花时间学习一些新的技术,.对于这些新技术,现在的需求不是很高.只需要在它的入口. 由于本人仅仅是花三四天整出来的东西,所以不洗勿喷,另外难免会有错误,如有还请 ...

  10. 对比Windows 8模拟器(Simulator)和Windows Phone仿真器(Emulator)

    原文:对比Windows 8模拟器(Simulator)和Windows Phone仿真器(Emulator) 从事移动应用开发,经常会用到模拟器(Simulator)和仿真器(Emulator),本 ...