NSIS packaged software
Recently made a call to the remote desktop applications need to make a small installation package, and the need to add a registry at the time of installation, I used before is "Advanced Installer" to packaged applications, this software is free. After asked Director Wang package installation package under what software to use, Wang Dao recommended to me NSIS, NSIS installer is making procedure under an open source Windows system. It provides installation, uninstallation, system settings, file decompression functions. NSIS provides a scripting language to customize the installation process. Here only record some scripts that I currently use to the software supplied with help files, it is easy to achieve the look you want to write the script.
This is to share the link: NSIS
extraction code: 2cg3
NSIS constant
$EXEFILE=install.exe -打包名称
${NSISDIR}=D:\软件打包\NSIS2
${WINDIR}=C:\windows
$SYSDIR=C:\windows\system32
$PROGRAMFILES=c:\Program Files (x86)
$PROGRAMFILES32=上同
$PROGRAMFILES64=C:\Program Files
$FONTS=C:\windows\Fonts
$EXEDIR=运行文件所在目录
$DESKTOP=C:\Users\stdio\Desktop 桌面
Tip box
MessageBox MB_OK $EXEDIR
Callback
Installation callback function
.onGUIInit
the callback will be loaded and displayed on the first page is called before Setup dialog box that allows you to adjust the user interface.
example:
Function .onGUIInit
FunctionEnd
.onInit
the callback will be called when the installer is nearly complete initialization. If the '.onInit' function calls Abort, the installer quits immediately.
Function .onInit
MessageBox MB_YESNO "即将安装,继续?" IDYES NoAbort
Abort ; 安装程序退出
NoAbort:
FunctionEnd
Registry read and write
DeleteRegKey HKLM "Software\My Company\software"
;删除注册表键值
DeleteRegValue HKLM "Software\soft" "some value"
; 读取注册表
ReadRegStr $0 HKLM Software\Nsis ""
; 写注册表
WriteRegStr HKLM "Software\soft" "key" "value"