2023年12月3日发(作者:)
NSIS用法注释;this is a test comment#this is a test comment too,/*this is a test comment too*/;MessageBox MB_OK "hi test!";MessageBox MB_OK "$/"A quote from a wise man$/" said the wise man";Var MYVAR;StrCpy $MYVAR "my value";CreateShortCut "$SMPROGRAMS/NSIS/ZIP2EXE project " /; "&INSTDIR/source/zip2exe/"# a comment/# still a ;Function testVar;Var /GLOBAL example2;;StrCpy example2 "hello world";FunctionEnd;编译时执行与安装或卸载时的设置是不同的;license -license page;components - components selection page;director - installation directory selection page;instfiles - installation page where the sections are executed;uninstConfirm - uninstall comfirmation page;我觉得这些字是预先已经定义好了的,如果你想创建一个这些用途之外的页面时你就选择custom来创建Page license skipLicense "" stayInLicensePage custom customPage "" ": custom page"Function skipLicense MessageBox MB_YESNO "Do you want to skip the license page?" IDNO no Abort no:FunctionEndFunction stayInLicense MessageBox MB_YESNO "Do you want to stay in the license page?" IDNO no Abort no:FunctionEndFunction customPage GetTempFileName $R0 File /oname=$R0 InstallOptions::dialog $R0 Pop $R1 StrCmp $R1 "cancel" done StrCmp $R1 "back" done StrCmp $R1 "success" done error: MessageBox MB_OK|MB_ICONSTOP "InstallOptions error:$/r$/n&R1" done:FunctionEnd;一个Section是一个安装组件如安装VS时VB,VC,C#分别各是一个Section;应该是可以嵌套的Section "-hidden section";不可见的SectionEndSection #hidden section;不可见的SectionEndSection "!bold section";加粗的SectionEndSection /o "optional";没有被勾选的SectionEndSection "test1" sec1_idSectionEndSection "test2" sec2_idSectionEndSection "test3" sec3_idSectionEndFunction .onInit SectionGetText ${sec2_id} $0 MessageBox MB_OK "name of ${sec2_id}:$/n$0" # will correctly display 'name of 1: test2'FunctionEndInstType "full" ;index =1InstType "minimal" ;index =2;....... ;.....Section "a section"SectionIn 1 2;这个section在哪个部分SectionEndSection "another section"SectionIn 1SectionEnd;这样以后当用户选择fun时,所有包含SectionIn 1的Section将列出,i thinkSectionGroup /e "group"Section "section one"SectionEndSection "section two"SectionEndSectionGroupEnd;! 粗体显示;/e 展开;Uninstall SectionSection "Uninstall" Delete $INSTDIR/;delete ifself Delete $INSTDIR/ RMDir $INSTDIR DeleteRegKey HKLM SOFTWARE/myAppSectionEnd;Functions;User functions are not called by the installer directly,instead they are called from Sections;using the call ck functions will be called by the installer when a certain event on func #some commandsFunctionEndSection call funcSectionEnd;"."开头的一般保留作为callback function;"un."开头的函数will be generated in the Uninstaller.因此normal install Sections and functions cannot call;uninstall Uninstall Section and uninstall functions cannot call normal functions;回调函数有特定的名字,在特定的时间调用;目前可用的callback functions:1. .onGUIInit;this callback will be called just before the first page is loaded and the installer dialog is shown; allowing you to tweak(调整) the user interface !include "" Function .onGUIInit GetDlgItem $R0 $HWNDPARENT 1028 CreateFont $R1 "Tahoma" 10 700 SendMessage $R0 ${WM_SETFONT} $R1 0 #set background color to white and text color to red SetCtlColors $R0 FFFFFF FF0000 FunctionEnd2. .onInit;即将完成初始化;this function will be called when the installer is nearly finished initializing. if the '.onInit' function; calls abort,the installer will quit on .onInit MessageBox MB_YESNO "This will install .Continue?" IDYES NoAbort Abort;causes installer to onEnd3. .onInstFailed;安装失败时点击取消;this callback is called when the user hits the 'cancel' button after the install has failedFunction .onInstFailed MessageBox MB_OK "Better luck next time."FunctionEnd4. .onInstSuccess ;安装成功窗口关闭前;this callback is called when the install was successful,right before the install window closes(which;may be after the user clicks 'Close' if AutoCloseWindow or SetAutoClose is set to false)Function .onInstSuccess MessageBox MB_YESNO "Congrats,it readme?" IDNO NoReadme Exec ;view readme or whatever if you want. NoReadme:FunctionEnd5. .onGUIEnd;;安装成功窗口关闭后;this callback is called right after the installer window it to free any user interface;related plug-ins if needed6. .onMouseOverSection;鼠标放置的session发生变化是被调用,可以用于改变描述信息;this callback is called whenever the mouse position over the sections tree has allows;you to set a description for each section for section id on which the mouse is over;currently is stored ,temporarily,in $0Function .onMouseOverSection FindWindow $R0 "#32770" "" $HWNDPARENT GetDlgItem $R0 $R0 1043 StrCmp $0 0 "" +2 SendMessage $R0 ${WM_SETTEXT} 0 "STR:first section description"
StrCmp $0 1 "" +2 SendMessage $R0 ${WM_SETTEXT} 0 "STR:second section description"FunctionEnd7. onRebootFailed;自动重启失败;this callback is called if Reboot installer,plug-ins,File and WriteRegBin should not be used;in this callbackFunction .onRebootFailed MessageBox MB_OK|MB_ICONSTOP "Reboot failed,Please reboot manually." /SD IDOKFunctionEnd8. onSelChange;选择发生变化;called when the selection changes on the component l for using with SectionSetFlags and;SectionSetFlags and SectionGetFlags.;selection changes include both section selection and installation type change.9. onUserAbort;安装还没有失败但用户选择了取消时调用,调用Abort时,程序不会退出;called when the user hits the 'cancel' button,and the install hasn't already this function;calls Abort,the install will not be on MessageBox MB_YESNO "Abort install?" IDYES NoCancelAbort Abort; NoCancelAbort: do somethingFunctionEnd10. .onVerifyInstDir;在安装文件夹改变后调用,检查该路径是否有效,如果调用了Abort则$INSTDIR视为无效;enables control over whether or not an installation path is valid for your installer. This code will be;called every time the user changes the install directory,so it shouldn't do anything crazy with MessageBox;or the this function calls Abort,the installation path in $INSTDIR is deemed on IfFileExists $INSTDIR/ PathGood Abort PathGood:FunctionEndUninstall Callbacks11. nit;卸载程序的类似于.onGUIInit;called just before the first page is loaded and the installer dialog is shown, allowing you to tweak the;user interface.12. ;若调用了Abort,程序直接退出,在有必要时检查一下$INSTDIR;this callback will be called when the uninstaller is nearly finished the;'' function calls Abort,the uninstaller will quit that this function can verify;and/or modify $INSTDIR if on MessageBox MB_YESNO "This will uninstall." IDYES NoAbort Abort NoAbort:FunctionEndFunction IfFileExists $INSTDIR/ found MessageBox MB_OK "Uninstall path incorrent" Abort found:FunctionEnd13. stFailed;called when the user hits the 'cancel' button after the uninstall has failed(if it used the
;Abort command or otherwise failed).14. stSuccess15. nd16. otFailed17. hange18. AbortInstaller Attributesthese attributes control how the installer looks and functions,including which pages are present in theinstaller ,as what text is displayed in each part of each page,how the installer is named,what icon theinstaller uses,the default installation directory,what file it writes out,and more,note that these attributescan be set anywhere in the file except in a Section or Function .注意这些属性可以在任何地方设置但是不能在Section和Function中设置1. AddBrandingImage为installer添加一个图标,但不是icon,its size will be set according to the width/height specified,the installer'swidth/height and the installer font,the final size will not always be what you requested;AddBrandingImage only adds a placeholder for an image,to set the image itself on runtime,use SetBrandingImage2. AllowRootDirInstallcontrols whether or not installs are enabled to the root directory of a dirve,or directly into a networkshare,set to true to change the safe behavior,which prevents users from selecting C:/ or //Server/Share as aninstall(and later on ,uninstall)directory,for additional directory selection page customizability,3. AutoCloseWindow[true]/[false]Set whether or not the install window automatically closes when is overrideable from asection using SetAutoClose4. BGFont;设置背景gradient上的字体Specifies the font used to show the text on the background set the color use no parameters are specified ,the default font will be used,the default font is bold and italic Times New Roman5. BGGradient;设置背景gradient上字体的颜色,以及是否显示这样一个渐变背景6. BrandingText /TRIM(LEFT|RIGHT|CENTER) text添加一些文字,但不是窗口标题,缺省的是"Nullsoft Install System ",text is shown at the bottom of theinstall winidow,setting this to an empty string("") uses the default; to set the string to blank use " "后面是靠左,居中和靠右accepts variables .if variables are used,they must be initialized on .onInit7. Caption captionwhen used outside a PageEx block:set the text for the titlebar of the installer,the By default,it is
'Name Setup',where name is specified with the Name can howerver,override it with
'My App installer' or whateverwhen used in a PageEx block:sets the subcaption of the current s variables .if variables are used,they must be initialized on .onInit8. ChangeUI dialog ui_laces dialog(IDD_LICENSE,IDD_DIR,IDD_SELCOM,IDD_INST,IDD_INSTFILES,IDD_UNINST or IDD_VERIFY)by a dialog with the same resource ID in ui_ can also specify 'all' as the dialog if youwish to replace all 7 of the dialogs at one from the same UI file:_LICENSE must contain IDC_EDIT1(RICHEDIT control)_DIR must contain IDC_DIR(edit box),IDC_BROWSE(button) and IDC_CHECK1(checkbox)_SELCOM must contain IDC_TREE1(SysTreeView32 control),and IDC_COMBO1(combo box)_INST must contain IDC_BACK(button).If an image control (static with SS_BITMAP style) will be foundin this dialog it will be used as the default fro _INSTFILES must contain IDC_LIST1(SysListView32 control),IDC_PROGRESS(msctls_progress32 control),andIDC_SHOWDETAILS(button)._UNINST must contain IDC_EDIT1(edit box)_VERIFY must contain IDC_STR(static).ChangeUI all "${NSISDIR}/Contrib/UIs/sdbarker_"9. CheckBitmap ;规格:96*16 pixels 状态selection mask,checked,greyed out, Specifies the bitmap with the images used for the checks of the component-selection page treeview.10. CompletedText textReplaces the default text("Completed") that is Printed at the end of the install if parmeter is specifiedOtherwise the default is s variables,but they should be initialized before the message is printed!11. ComponentText [text [subtext] [subtext2]]Used to change the default text on the component :Text above the controls,to the right of the installation t:Text next to the installation type selectionsubtext2:Text to the left of the components list and below the installation typethe default string will be used if a string is empty("")12. DetailsButtonText show details textreplace the default details button text13 DirText [text] [subtext] [browse_button_text] [browse_dlg_text]used to change the default text on the directory : text above the controls to the right of the installation t: text on the directory selection _button_text:text on the browse buttonbrowse_dlg_text:text on the "browse for folder" dialog,appears after clicking on "Browse" buttondefalut ""14 DirVar user_var(dir input/output)specifies which variable is to be used to contain the directory variable should containthe default value too. this allows to easily create two different directory pages that not require youto move values in and out of $INSTDIR,the default variable is $INSTDIR,This can only be used in PageEx andfor directory and uninstConfirm pages.15 DirVerify auto|leave;检查文件夹是否合法以及是否有足够的空间if DirVerify leave is used,the Next Button will not be disabled if the dir is not valid16 FileErrorText file error text;当文件无法写入时的的提示错误信息,文件名在$0中,Replaces the default text that comes up when a file cannot be written to.17 Icon [patn/];设置安装包的iconuse UninstallIcon to set the Uninstaller icon.18 InstallButtonText install button text;overrides the default install button text(of "Install") with the specified text;accept variables.19 InstallColors /windows|(foreground_color background_color);set the colors to use for the install info screen
;/windows 指示使用默认的前景和背景色20 InstallDir definstdirSets the default installation directory.21 InstallDirRegKey root_key subkey key_name;写注册表;this attribute tells the installer to check a string in the registry,and use it for the install dir if;that string is valid.;让安装器检查某个键值字符串,如果是合法的,将它作为安装目录,如果存在此属性设置且字符串合法,它将覆盖;InstallDir属性,如果不合法,则使用InstallDir的缺省值,在检查字符串时,引号会自动被移除,并且:;"c:/c/"会变成"c"/c";;Language strings和变量不能被使用InstallDirRegKey HKLM Software/NSIS ""22 InstProgressFlags [flag[....]];flag的有效值是:smooth or colorede.g:InstProgressFlagsInstProgressFlags smoothInstProgressFlags smooth coloredwhen XPStyle on ...23 InstType install_type_name | /NOCUTOM |/CUSTOMSTRING=str|/COMPONENTSONLYONCUSTOM;add an install type to the install type list,or disables the custom install type.;安装类型,一般有custom,全部安装,还有自定义;there can be as many as 32 types,each one specifying the name of the install type.;如果前面有'.un'前缀,则是卸载类型,名字中可以包含变量,which will be processed at runtime before thecomponents page r way of changing the InstType name during runtime is the difference is that with InstTypeSetText you are saving your precious user variables,the firsttype is the default (generally 'Typical').If the /NOCUSTOM switch is specified,then the "custom" installtype is disabled,and the user has to choose one of the pre-defined install types,Alternatively,if the
/CUSTOMSTRING switch is specified,the parameter will override the "custom" install type text,Alternativelyif the /COMPONENTSONLYONCUSTOM flag is specified th ecomponent list will only be shown if the "Custom"install type is selected.24 LicenseBkColor color | /gray | /windows;Sets the background color of the license is specified using the form RPGGBB;/gray;/windows25 LicenseData licdata.(txt|rtf);LicenseData ;LicenseData LicenseLangString to show a different license for every language26 LicenseForceSelection (checkbox [accept_text] |radiobuttons [accept_text] [decline_text]|off);Specifieds if the displayed license must be accept explicit or not.;if off is specified the "next button " is enabled by default.27 LicenseText [text [button_text]]; Used to change the default text on the license page.;text: Text above the controls,to the right of the installation icon.;button_text:text on the "I Agree" button.;default string will be used if a string is empty("").28 MiscButtonText[back button text [next button text]] [cancel button text] [close button text];Replaces the default text strings for the four buttons(Back,Next,Cancel,Close);accept variables.29 Name name[name_coubled_ampersands];Name "MyAPP" = "MyAPP";Name "Foo & Bar" "Foo && Bar" = "Foo & bar"30 OutFile [path/];Specifies the output file that the MakeNSIS should write the installer to .;this is just the file that MakeNSIS writes,it doesn't affect the contents of the installer.31 RequestExecutionLevel none|user|highest|admin;Specifies the requested execution level for windows Vista and wiindows 732 SetFont [/LANG = lang_id] font_face_name font_size;Set the installer font.;设置安装包的字体,该字体必须存在于用户的机器上,尽量使用常用字体;SetFont /LANG=${LANG_ENGLISH} "english font" 933 ShowInstDetails hide|show|nevershow;Sets whether or not the details of the uninstall are t is hidenote that sectins can override this using SetDetailsView34 ShowUninstDetails hide|show|nevershow;Sets whether or not the details of the uninstall are shown. default is that sectins can override this using SetDetailsView35 SilentInstall normal|silent|silentlogSpecifies whether or not the installer should be it is 'silent' or 'silentlog',all sectionsthat have the SF_SELECTED flag are installed quietly(you can set tis flag using SectionSetFlags),withno screen output from the installer ifself36 SilentUnInstall normal |silent37 SpaceTexts [reg text [avail text]]if parameters are specified,overrides the space required and space available text("Space required:" and
"Space available:" by default). IF 'none' is specified as the required text no space texts will be shown.38 SubCaption [page_number subcaption]Overrides the subcaptions for each of the installer pages (0=":License Agreement",1=":Installation Options"...);窗口标题you can also set a subcaption using Caption inside a PageEx block39 UninstallButtonText textChanges the text of the button that by default says "Unistall" in the uninstaller40 UninstallCaption captionsets what the titlebars of the uninstaller will display, default it is 'Name Uninstall'UninstallCaption "myapp Uninstall"41 UninstallIcon [path/]s the icon of the uninstaller42 UninstallSubCaption page_number subcaptionset the default subcaptions for the uninstaller pages(0=":Confirmation",1=":Uninstalling Files",2=":Completed").using Caption inside a PageEx block43 UninstallText text [subtext]Specifies the texts on the uninstaller confirm :subtext:44 WindowIcon on|offSets whether or not the installer's icon is being displayed45 XPStyle on|offSet whether or not an XP manifest will be added to the installer,this affects the uninstaller er Flags;编译选项the following commands affect how the compiler generates code and compresses otherwise noted,these commands are valid anywhere in the script,and effect every line below where each one is placed untiloverridden by another command,they cannot be jumped over using flow control instruction46 AllowSkipFiles on|off;on 时允许user skip file,off时,只有abort安装this command specifies whether the user should be able to skip a file or not.a user has an option to skip a file if SetOverwrite is set to on,and the installer fails to open a filefor writing when trying to extract a file. if off is used the ignore button which allows the user to skipthe file will not show and the user will only have an option to abort the installation47 FileBufSize buffer_size_in_mb;内存使用率this command sets the size of the compiler's internal file buffers. This command allows you to control thecompiler's memory usage by limiting how much of a given file it will load into memory at thecompiler needs both input and output,twice the memory size specified could be used at given time for filebuffers.48 SetCompress auto|force|off48 SetCompress auto|force|offthis command sets the compress flag which is used by the installer to determine whether or not data shouldbe compressed49 SetCompressor [/SOLID][/FINAL] zlib|bzip2|lzma;设置压缩算法,不能在section和functions中使用且必须在压缩前使用this command sets the compression algorithm used to compress filese/data in the : (the default) it is a quick and simple method, 300kb memory usesBZIP2: gives better compression raios than ZLIB but a bit slower and uses more memory,4M memory usesLZMA: a new compression method that gives very good compression ratios,compression speed is lower but
decompression speed is high ,8M memory usesif /FINAL is used,subsequent calls to SetCompressor will be ignored.即后面的调用将被忽略if /SOLID is used,all of the installer data is compressed in one block,result in greater compression ratios50 SetCompressorDictSize dict_size_mbSets the dictionary size in megabytes used by the LZMA compressor
51 SetDatablockOptimize on|off;可以让压缩包更小,推荐onthis command tells the compiler whether or not to do datablock ock optimizations havethe compiler check52 SetDateSave on|offthis command sets the file date/time saving flag which is used by the File command to determine whether ornot to save the last write date and time of the file,so that it can be restored on flagsare 'on' and 'off' ,'on' is default53 SetOverwrite on|off|try|ifnewer|ifdiff|lastused;是否覆盖已经存在的文件on 直接覆盖(default)off 不覆盖try 如果能覆盖则覆盖ifnewer 如果存在的文件更旧ifdiff 不同,更新或更旧lastusedVersion Information54 VIAddVersionKey [/LANG=lang_id] keyname_valueadd a field in the Version Tab of the File Properties,this can either be a field provided b the systemor a user defined following fields are provided by the System:.lBuildVIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Test Application"VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "A test comment"VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "Fake company"VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "Test Application is a trademark of Fake company"VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "? Fake company"VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "? Fake company"VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Test Application"VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "1.2.3"55 VIProductVersion [version-string_X.X.X.X]adds the Product Version on top of the Version Tab in the Properties of the uctVersion "1.2.3.4"
InstructionsBasic Instructions1. Delete [/REBOOTOK] file删除文件(可以包含通配符也可以是绝对路径)/REBOOTOK 选项指定重启后删除找到文件但无法删除 error flag is set没有找到文件error flag is not setDelete $INSTDIR|2. Exec command执行指定的program,指定的程序必须存在 $OUTDIR is used for the working directory指定程序无法启动时,error flag is setExec '"$INSTDIR/"'Exec '"$INSTDIR/" some parameters'3. ExecShell action command [parameters[SW_SHOWDEFAULT|SW_SHOWNORMAL|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_HIDE]]使用ShellExecute来执行一个程序,通常执行"open","print" 等$OUTDIR 是工作目录error flag is set 如果无法启动ExecShell "open" ""ExecShell "open" "$INSTDIR/"4. ExecWait command[user_var(exit code)]执行一个程序且等待该程序进程结束,if no ouput variable is specified如果该程序没有返回值返回nonzero error code或执行出错,error flag is set,if an ouput variable is specified该函数将用exit code 填充变量,ExecWait '"$INSTDIR/"'ExecWait '"$INSTDIR/"' $0ExecWait '"$INSTDIR/" some parameters'5 File
.output file name is $OUTDIR/filename_portion_of_ /oname = x switch to 改变output name.x可以包含变量,可以是相对或绝对路径,若包含space 请加上"".支持通配符.if /r is used, 递归查找子文件夹. /x is used to exclude files or directories.排除不需要的文件或文件夹. /a is used,the attributes of the files added will be preserved.
. if /nonfatal is used and no files are found,a warning will be issued instead of an errorFile e /a e *.exeFile /r *.datFile /r dataFile /oname= e /oname=$TEMP/ e "/oname=$TEMP/name with " e /nonfatal "a file that might not exist"File /r /x CVS myProject/*.*File /r /x *.res /x *.obj /x *.pch source/*.*注意 /rwhen using the /r switch,both mathing directories and files will be is always done with or without the useof wildcards,even if the given path perfectly matches one directory,6 Rename [/REBOOTOK] source_file dest_fileRename source_file to des_fileif the current folder is not set using SetOutPath instruction the current folder is $EXEDIR可以用来移动文件和目录Rename $INSTDIR/ $INSTDIR/7 ReserveFile [/nonfatal] [/r] [/x file|wildcard [...]] file []Reserves a file in the data block for later use,文件是按他们在脚本中出现的顺序添加到data block中,而函数则不是按他们出现的顺序被调用的如果你在一个函数中添加一个文件,他会被早早的调用而你却把它定义在脚本的很后面,执行脚本时,all of the files added earlier willhave to be decompressed to get to the required file,此函数可以节省装载时间,另外,先会被调用的函数定义到前面8 RMDir [/r] [/REBOOTOK] directory_name移除文件夹,绝对路径,没有 /r时,只有文件夹为空时才会被移除,有/r 时,文件夹被递归移除/REBOOTOK 重启后移除有error flagRMDir $INSTDIR注意:当前文件夹不能被移除, the current working directory is set by SetOutPathSetOutPath $TEMP/dirRMDir $TEMP/dirThe next example will succeed in deleting the Path $TEMP/dirSetOutPath $TEMPRMDir $TEMP/dir使用RMDir/r $INSTDIR in the uninstaller is not safe though it is unlikely因为如果用户指定 $INSTDIR 是 Program Files时,可能导致整个文件夹被删除Solutions are available for easily uninstalling only files which were installed by the installer.9 SetOutPath outpathSets the output path($OUTDIR) and creates it if it does not exist,must be a full pathname,usually is just $INSTDIRyou can specify $INSTDIR if you are lazy with a single "-"Registry,INI,File Instructions10 DeleteINISec ini_filename section_name删除指定的ini文件的指定sectionDeletes the entire section [section_name] from ini_ the section could not be removed from te ini file,the error flag is set,it does not set the error flag if the section could not be foundWriteINIStr $TEMP/ section1 something 123WriteINIStr $TEMP/ section1 somethingelse 1234WriteINIStr $TEMP/ section2 nsis trueDeleteINISec $TEMP/ section111 DeleteINIStr ini_filename section_name str_nameWriteINIStr $TEMP/ section1 something 123DeleteINIStr $TEMP/ section1 something12 DeleteRegKey [/ifempty] root_key subkeyDeletes a registry keyif /ifempty is specified,the registry key will only be deleted if it has no subkeysroot_key valid value:HKCR or HKEY_CLASSES_ROOTHKLM or HKEY_LOCAL_MACHINEHKCU or HKEY_CURRENT_USERHKU or HKEY_USERSHKCC or HKEY_CURRENT_CONFIGHKDD or HKEY_DYN_DATAHKPD or HKEY_PERFORMANCE_DATASHCTX or SHELL_CONTEXT13 DeleteRegValue root_key subkey key_nameDeletes a registry RegValue HKLM "Software/My Company/My Software" "some value"14 EnumRegKey user_var(output) root_key subkey index枚举所有的子键Set user variable $x with the name of the 'index'th registry key in root_key/s an empty string if there are no more keys15 EnumRegValue user_var(output) root_Key subkey index枚举16 ExpandEnvStrings user_var(output) stringExpands environment variables in string into the user variable $x,if an environment variable doesn't exist,it will not bereplaced. For example,if you use "%var%" and var doesn't exists,the result will be "%var"ExpandEnvStrings $0 "WINDIR=%WINDIR%$/nTEMP=%TEMP%"17 FlushINI ini_filenameFlushes the INI file's bufferscauses the changes to be written to the disk immediatelyWriteINIStr $TEMP/ test test testFlushINI $TEMP/18 ReadEnvStr user_var(output) nameReads from te environment string "name" and sets the value into the user variable $xReadEnvStr $0 WINDIRReadEnvStr $1 TEMP19 ReadINIStr user_var(output) ini_filename section_name entry_name


发布评论