nsi大致可以分为基本指令、注册表及ini操作指令、通用指令、流程控制指令、文件操作指令、卸载指令、字符串处理指令、多语言支持指令、重启指令。
以下是常用的基本指令:
Delete
Delete [/REBOOTOK] file
Exec
Exec command
ExecShell
ExecShell action command [parameters] [SW_SHOWNORMAL | SW_SHOWMAXIMIZED | SW_SHOWMINIMIZED | SW_HIDE]ExecShell "open" 示例"http://nsis.sf.net/"
ExecWait
以下是常用的基本指令:
Delete
Delete [/REBOOTOK] file
Exec
Exec command
ExecShell
ExecShell action command [parameters] [SW_SHOWNORMAL | SW_SHOWMAXIMIZED | SW_SHOWMINIMIZED | SW_HIDE]ExecShell "open" 示例"http://nsis.sf.net/"
ExecWait
ExecWait command [user_var(exit code)]
示例:
ExecWait '"$INSTDIR\someprogram.exe"'
ExecWait '"$INSTDIR\someprogram.exe"' $0
DetailPrint "some program returned $0"
File
File [/nonfatal] [/a] ([/r] [/x file|wildcard [...]] (file|wildcard) [...] | /oname=file.dat infile.dat)
/r选项用作递归模式,/x用于排出文件
示例:
File something.exe
File /a something.exe
File *.exe
File /r *.dat
File /r data
File /oname=$TEMP\temp.dat somefile.ext
File /nonfatal "a file that might not exist"
File /r /x CVS myproject
File /r /x *.res /x *.obj /x *.pch source
Rename
Rename [/REBOOTOK] source_file dest_file
RMDir
RMDir [/r] [/REBOOTOK] directory_name