NSIS学习笔记三-中文测试

这篇博客介绍了NSIS 3.0的Unicode(中文)支持,展示了如何创建简单的安装程序,包括检查安装程序和主程序是否运行、版本检测、升级安装、用户自定义安装路径等功能。作者提醒,一些旧的NSI编辑器可能对中文支持不佳,推荐使用Notepad或基于example->unicode.nsi进行修改。
摘要由CSDN通过智能技术生成

Title:  NSIS学习笔记三-中文测试
Author: Kagula
Date: 2016-08-30
Environment: NSIS 3.0(Released  July 24, 2016)

Introduction
  Simple install program code demonstrate.  Using default MUI2 Style GUI.
  I think NSIS 3.0 is the first version that support unicode(chinese).
 
Feature List
 [1]支持检查安装程序是否在运行。
 [2]支持检查主程序是否在运行。
 [3]支持版本检测。
 [4]支持升级安装。
 [5]支持用户修改安装路径。
 [6]支持中文。
 [7]支持从控制面板卸载程序。

 

Prepare:

    suppose source directory name is issue and exist in the same directory as nis script.

 

Manifest:

!include "MUI2.nsh" 
!include "FileFunc.nsh"
!include "LogicLib.nsh"  
!include "nsProcess.nsh" 

Unicode true

!define APPNAME     "XXX软件客户端"
!define COMPANYNAME "XXX有限公司"
!define DESCRIPTION  ""  
!define APPEXENAME  "XXX.exe"

!define VERSIONMAJOR    1
!define VERSIONMINOR    0
!define VERSIONBUILD    0  
!define VERSIONREVISION 0

!define MYINSTALLDIR      "organizationName"
!define MYINSTALLSUBDIR   "productName"  

# This is the size (in kB) of all the files copied into "Program Files"  
!define INSTALLSIZE 20000

!define HELPURL   "http://www.kagula.com/" # "Support Information" link  
!define UPDATEURL "http://www.kagula.com/" # "Product Updates" link  
!define ABOUTURL  "http://www.kagula.com/" # "Publisher" link  
;--------------------------------------------------------------------
!define VERSIONLONG  "${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}.${VERSIONREVISION}"  
!define SETUPFILENAME "Setup${VERSIONLONG}.exe"

OutFile "${SETUPFILENAME}"
Name "${APPNAME}"
InstallDir "$PROGRAMFILES\${MYINSTALLDIR}\${MYINSTALLSUBDIR}"

ShowInstDetails show
RequestExecutionLevel admin

XPStyle on

CompletedText "完成安装"

!define      MUI_PAGE_CUSTOMFUNCTION_SHOW MyFuncDir
Function MyFuncDir
  #不知道为什么这里不能引用全局变量
  ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "MainProgramLocation"  
  ${If} $0 != ""
		;disable browser button.
		FindWindow $0 "#32770" "" $HWNDPARENT
		GetDlgItem $0 $0 1001
		EnableWindow $0 0
		
		;disable edit install p
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

kagula086

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值