^_^

2007年12月26日星期三

如何使NSIS打包的文件在属性页中显示版本信息

效果如下图所示:


具体实现参见下面的脚本:
!define PRODUCT_VERSION "3.0.2193"
!define PRODUCT_NAME "Tester"
!define PRODUCT_PACKAGE_ID "${__DATE__}"
!define PRODUCT_PACKAGE_SPECIAL_ID ""
!define PRODUCT_PUBLISHER "AAA"

!include "MUI.nsh"
!insertmacro MUI_LANGUAGE "English" ;Language files

;Adds the Product Version on top of the Version Tab in the Properties of the file.
VIProductVersion "${PRODUCT_VERSION}.0"
;Adds a field in the Version Tab of the File Properties.
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${PRODUCT_NAME}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "${PRODUCT_PUBLISHER}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright (c) ${PRODUCT_PUBLISHER} Company"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "${PRODUCT_NAME} Application"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "${PRODUCT_VERSION}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${PRODUCT_VERSION}.0"
VIAddVersionKey /LANG=${LANG_ENGLISH} "OriginalFilename" "${PRODUCT_NAME}_${PRODUCT_VERSION}.${PRODUCT_PACKAGE_ID}${PRODUCT_PACKAGE_SPECIAL_ID}_Setup.exe"
VIAddVersionKey /LANG=${LANG_ENGLISH} "Package Build Date" "${__DATE__}"

OutFile "${PRODUCT_NAME}_${PRODUCT_VERSION}.${PRODUCT_PACKAGE_ID}${PRODUCT_PACKAGE_SPECIAL_ID}_Setup.exe"

Section "!THE_ONLY_SECTION" THE_ONLY_SECTION
SectionEnd
本站文章除注明外,均为本站原创
转载请注明文章转载自: 大笨熊乐园 [ https://blog.foolbear.com/?m=0 ]
文章标题: 如何使NSIS打包的文件在属性页中显示版本信息
文章地址: https://blog.foolbear.com/2007/12/nsis.html?m=0

没有评论 :

发表评论

Related Posts with Thumbnails