﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-iniwf-随笔分类-软件打包</title><link>http://www.cppblog.com/iniwf/category/9827.html</link><description>风是温柔的，雨是伤心的，云是快乐的，月是多情的，爱是迷失的，恋是醉人的，情是难忘的，天是长久的，地是永恒的</description><language>zh-cn</language><lastBuildDate>Sat, 29 Jan 2011 09:54:47 GMT</lastBuildDate><pubDate>Sat, 29 Jan 2011 09:54:47 GMT</pubDate><ttl>60</ttl><item><title>提供修复界面的NSIS安装包</title><link>http://www.cppblog.com/iniwf/archive/2009/05/08/82207.html</link><dc:creator>iniwf</dc:creator><author>iniwf</author><pubDate>Fri, 08 May 2009 00:59:00 GMT</pubDate><guid>http://www.cppblog.com/iniwf/archive/2009/05/08/82207.html</guid><wfw:comment>http://www.cppblog.com/iniwf/comments/82207.html</wfw:comment><comments>http://www.cppblog.com/iniwf/archive/2009/05/08/82207.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/iniwf/comments/commentRss/82207.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/iniwf/services/trackbacks/82207.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: ;&nbsp;该脚本由邦畿千里制作，可自由传播使用&nbsp;QQ:911377!include&nbsp;"LogicLib.nsh";&nbsp;安装背景及文字!define&nbsp;PRODUCT_TEXT_KEY&nbsp;"(邦畿千里)"!define&nbsp;PRODUCT_TEXT_BACK&nbsp;"resource\back.bmp"!define&nbsp;PRODUCT...&nbsp;&nbsp;<a href='http://www.cppblog.com/iniwf/archive/2009/05/08/82207.html'>阅读全文</a><img src ="http://www.cppblog.com/iniwf/aggbug/82207.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/iniwf/" target="_blank">iniwf</a> 2009-05-08 08:59 <a href="http://www.cppblog.com/iniwf/archive/2009/05/08/82207.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>NSIS 的 Modern UI 教程</title><link>http://www.cppblog.com/iniwf/archive/2009/03/20/77267.html</link><dc:creator>iniwf</dc:creator><author>iniwf</author><pubDate>Fri, 20 Mar 2009 01:01:00 GMT</pubDate><guid>http://www.cppblog.com/iniwf/archive/2009/03/20/77267.html</guid><wfw:comment>http://www.cppblog.com/iniwf/comments/77267.html</wfw:comment><comments>http://www.cppblog.com/iniwf/archive/2009/03/20/77267.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/iniwf/comments/commentRss/77267.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/iniwf/services/trackbacks/77267.html</trackback:ping><description><![CDATA[转自<a href="http://chenmy.hanzify.org/article.asp?id=50">http://chenmy.hanzify.org/article.asp?id=50</a>
<div class=textbox-content id=textboxContent>NSIS 2.0 版本支持定制的用户界面。所谓的 Modern UI(下称 MUI) 就是一种模仿最新的 Windows 界面风格的界面系统。MUI 改变了 NSIS 脚本的编写习惯，它使用 NSIS 的宏来表达，指定 MUI 的属性需要使用宏。所以，诸如 LicenseText, Icon, CheckBitmap, InstallColors 在 MUI 中失去意义。<br><br><strong>MUI 的内置向导页面</strong><br><u>和安装程序有关的向导页面</u><br>MUI_PAGE_WELCOME 该向导页面显示欢迎信息<br>MUI_PAGE_LICENSE text/rtf_file 该向导页面显示软件授权申明<br>MUI_PAGE_COMPONENTS 该向导页面显示安装组件选择<br>MUI_PAGE_DIRECTORY 该向导页面显示安转目录选择<br>MUI_PAGE_STARTMENU page_id variable 该向导页面显示开始菜单目录选择<br>MUI_PAGE_INSTFILES 该向导页面显示安装进度<br>MUI_PAGE_FINISH 该向导页面显示安装结束<br><br><u>和卸载程序有关的向导页面</u><br>MUI_UNPAGE_WELCOME<br>MUI_UNPAGE_CONFIRM<br>MUI_UNPAGE_LICENSE text/rtf_file<br>MUI_UNPAGE_COMPONENTS<br>MUI_UNPAGE_DIRECTORY<br>MUI_UNPAGE_INSTFILES<br>MUI_UNPAGE_FINISH<br><br>页面的属性设定需要放在插入页面的宏之前。比如:<br>Var PLUGINS_FOLDER<br>!define MUI_DIRECTORYPAGE_VARIABLE $PLUGINS_FOLDER<br>!insertmacro MUI_PAGE_DIRECTORY<br>这段 nsi 脚本表示，将目录选择页面中用户选择的目录位置存放到变量 $PLUGINS_FOLDER 中去。<br><br>以下是 MUI 各个内置向导页面属性说明：<br><strong>所有页面适用的属性</strong><br>MUI_PAGE_HEADER_TEXT text<br>显示在向导页头上的文字<br><br>MUI_PAGE_HEADER_SUBTEXT text<br>显示在向导页头上的文字，它是通常显示在 MUI_PAGE_HEADER_TEXT 之下，表示对 MUI_PAGE_HEADER_TEXT 的进一步解释。<br>对于使用 InstallOptions 的定制界面，使用宏 !insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)" 实现类似功能。<br><br><strong>欢迎页面属性</strong><br>MUI_WELCOMEPAGE_TITLE title<br>显示在欢迎向导页上的标题<br><br>MUI_WELCOMEPAGE_TITLE_3LINES<br>标题区的空格<br><br>MUI_WELCOMEPAGE_TEXT text<br>显示在欢迎向导页上的文字。使用\r\n换行。<br>通常这些属性不需要制定，省缺的值已经足够。<br><br><strong>软件授权页面属性</strong><br>在软件授权页面中可以定制用户接受软件授权许可的三种方式，一是按钮，二是 checkbox，三是 radio。<br>MUI_LICENSEPAGE_TEXT_TOP text<br>显示在页面顶部的文字<br><br>MUI_LICENSEPAGE_TEXT_BOTTOM text<br>显示在页面底部的文字<br><br>MUI_LICENSEPAGE_BUTTON button_text<br>按钮方式时按钮上的文字<br><br>MUI_LICENSEPAGE_CHECKBOX<br>定义此宏表示用户需要钩选该 checkbox 来接受软件许可<br><br>MUI_LICENSEPAGE_CHECKBOX_TEXT text<br>在 checkbox 旁显示的文字<br><br>MUI_LICENSEPAGE_RADIOBUTTONS<br>定义此宏表示用户需要钩选相应的 radio box 来接受或拒绝软件许可<br><br>MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT text<br>在 radio 旁显示的表示接受的文字<br><br>MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE text<br>在 radio 旁显示的表示拒绝的文字<br><br><strong>安装组件选择页面属性</strong><br><br>MUI_COMPONENTSPAGE_TEXT_TOP text<br>显示在页面顶部的文字<br><br>MUI_COMPONENTSPAGE_TEXT_COMPLIST text<br>显示在组件列表旁边的文字<br><br>MUI_COMPONENTSPAGE_TEXT_INSTTYPE text<br>显示在安转类型下拉框旁边的文字<br><br>MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE text<br>显示在描述框顶部的文字<br><br>MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO text<br>当没有安装组件选中时，显示在描述框中的文字<br><br><strong>安装目录选择页面属性</strong><br><br>MUI_DIRECTORYPAGE_TEXT_TOP text<br>显示在页面顶部的文字<br><br>MUI_DIRECTORYPAGE_TEXT_DESTINATION text<br>显示在目地目录选择框上的文字<br><br>MUI_DIRECTORYPAGE_VARIABLE variable<br>存放用户选择的目录的变量，默认是 $INSTDIR<br><br>MUI_DIRECTORYPAGE_VERIFYONLEAVE<br>在离开该页面时验证目录的有效性，不禁用"下一步"这个按钮<br><br><strong>开始菜单目录选择页面</strong><br><br>创建快捷方式的代码应当放在 MUI_STARTMENU_WRITE_BEGIN 和 MUI_STARTMENU_WRITE_END 之间，示例如下:<br>!insertmacro MUI_STARTMENU_WRITE_BEGIN page_id<br>...create shortcuts...<br>!insertmacro MUI_STARTMENU_WRITE_END<br><br>这里的 page_id 是用户选择要创建快捷方式的页面。<br><br>MUI_STARTMENUPAGE_TEXT_TOP text<br>显示在页面顶部的文字<br><br>MUI_STARTMENUPAGE_TEXT_CHECKBOX text<br>显示在 checkbox 旁的表示禁止快捷方式创建的文字<br><br>MUI_STARTMENUPAGE_DEFAULTFOLDER folder<br>默认的开始菜单目录<br><br>MUI_STARTMENUPAGE_NODISABLE<br>不实现用于禁止快捷方式创建的 checkbox<br><br>MUI_STARTMENUPAGE_REGISTRY_ROOT root<br>MUI_STARTMENUPAGE_REGISTRY_KEY key<br>MUI_STARTMENUPAGE_REGISTRY_VALUENAME value_name<br>这三项用于指定开始菜单设定在注册表中的键和值，用于记录用户的偏好。在卸载时应当删除之。<br>卸载程序可以用宏MUI_STARTMENU_GETFOLDER获得开始菜单目录，下面的例子说明了如何删除快捷方式:<br>!insertmacro MUI_STARTMENU_GETFOLDER page_id $R0<br>Delete "$SMPROGRAMS\$R0\Your Shortcut.lnk"<br><br><strong>安装进度页面属性</strong><br><br>MUI_INSTFILESPAGE_FINISHHEADER_TEXT text<br>显示安装进度页面头上的文字，但对于结束页面不是MUI_(UN)FINISHPAGE_NOAUTOCLOSE)不显示。<br><br>MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT text<br>显示安装进度页面头上的，对MUI_INSTFILESPAGE_FINISHHEADER_TEXT的进一步说明。对于结束页面不是MUI_(UN)FINISHPAGE_NOAUTOCLOSE)不显示。<br><br>MUI_INSTFILESPAGE_ABORTHEADER_TEXT text<br>显示安装进度页面头上的表示安装过程非正常终止的文字<br><br>MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT text<br>对MUI_INSTFILESPAGE_ABORTHEADER_TEXT的进一步描述<br><br><strong>完成页面属性</strong><br><br>在完成页面中可以运行程序，打开文件或网站。<br><br>MUI_FINISHPAGE_TITLE title<br>页面标题<br><br>MUI_FINISHPAGE_TITLE_3LINES<br>页面标题区的额外空格<br><br>MUI_FINISHPAGE_TEXT text<br>显示在完成页面上文字，用\r\n换行<br><br>MUI_FINISHPAGE_TEXT_LARGE<br>如果使用了 checkbox 时，需要设定的文本区的额外空间<br><br>MUI_FINISHPAGE_BUTTON text<br>完成按钮的显示文字<br><br>MUI_FINISHPAGE_TEXT_REBOOT text<br>重启操作系统 checkbox 旁的文字，用\r\n换行<br><br>MUI_FINISHPAGE_TEXT_REBOOTNOW text<br>显示在'Reboot now'旁的文字<br><br>MUI_FINISHPAGE_TEXT_REBOOTLATER text<br>显示在'Reboot later'旁的文字<br><br>MUI_FINISHPAGE_RUN exe_file<br>指定用户可以用 checkbox 选择运行的应用程序，如果有空格无需引用。<br><br>MUI_FINISHPAGE_RUN_TEXT text<br>运行应用程序 checkbox 旁的文字<br><br>MUI_FINISHPAGE_RUN_PARAMETERS parameters<br>运行应用程序的参数，需要用$\"表示双引号<br><br>MUI_FINISHPAGE_RUN_NOTCHECKED<br>指定运行应用程序 checkbox 为非选中状态<br><br>MUI_FINISHPAGE_RUN_FUNCTION function_name<br>指定安装完成后要执行的nsi函数，在该函数中可以运行多个应用程序。<br><br>MUI_FINISHPAGE_SHOWREADME file/url<br>指定用户可以用 checkbox 选择是否查看的文件或网站，如果有空格无需引用。<br><br>MUI_FINISHPAGE_SHOWREADME_TEXT text<br>指定 'Show Readme' checkbox 旁的显示文字<br><br>MUI_FINISHPAGE_SHOWREADME_NOTCHECKED<br>指定 'Show Readme' checkbox 为非选中状态<br><br>MUI_FINISHPAGE_SHOWREADME_FUNCTION function_name<br>指定安装完成后要执行的 nsis 函数，在该函数中可以显示多个文件或网站。<br><br>MUI_FINISHPAGE_LINK link_text<br>用户可及点击的超链上的文字<br><br>MUI_FINISHPAGE_LINK_LOCATION file/url<br>指定用户是否可以用超链查看网站，如果有空格无需引用。<br><br>MUI_FINISHPAGE_LINK_COLOR (color: RRGGBB hexadecimal)<br>超链上文字的颜色，默认为 000080<br><br>MUI_FINISHPAGE_NOREBOOTSUPPORT<br>禁用重启操作系统的功能<br><br><strong>卸载确认页面属性</strong><br><br>MUI_UNCONFIRMPAGE_TEXT_TOP text<br>显示在页面顶部的文字<br><br>MUI_UNCONFIRMPAGE_TEXT_LOCATION text<br>显示在 uninstall location 旁的文字<br><br><strong>InstallOptions 和定制页面<br></strong>InstallOptions 是一个 NSIS 插件，他能让安装程序开发人员创建定制的向导页面来获得内置向导页面不能提供的用户输入。<br><br>InstallOptions 会创建内嵌在 NSIS 窗体中的对话框。InstallOptions 的控件用 INI 文件描述。该文件可以用可视化工具生成。HM NIS EDIT 就是这样的一个工具。<br><br>InstallOptions 控件 INI 文件的结构<br>InstallOptions INI 文件包含一个必须的段。它包含了控件的数量、窗体的属性等。该文还可包含描述具体空间的段。<br>必须的段是 Settings，它可以包含以下内容：<br>NumFields(必须的) 该对话框包含的控件数目<br>Title (可选的) Windows窗体的标题<br>CancelEnabled (可选的) 是否启用Cancel按钮，1:是，0:否<br>CancelShow (可选的) 是否显示Cancel按钮，1:是，0:否<br>BackEnabled (可选的) 是否启用Back按钮，1:是，0:否<br>CancelButtonText (可选的) Cancel按钮的显示文字<br>NextButtonText (可选的) Next按钮的显示文字<br>BackButtonText (可选的) Back按钮的显示文字<br>Rect (可选的)<br>RTL (可选的)<br>State (output) This is not something you have to supply yourself but is set by InstallOptions, before calling your custom page validation function, to the field number of the custom Button control (or other control having the Notify flag) the user pressed, if any.<br><br>每个控件段以"Field #"模式命名，井号表示数字，从1开始。控件有以下属性：<br><br>Type (required) 控件的类型，有"Label", "Text", "Password", "Combobox", "DropList", "Listbox", "CheckBox", "RadioButton", "FileRequest" , "DirRequest" "Icon", "Bitmap", "GroupBox", "Link" 或 "Button"。<br><br>"Label" 用来显示静态文本<br>"Text" 和 "Password" 和 HTML 中的类似，用来接受用户输入。<br>"Combobox"允许用户输入列表中不存在的项， "Droplist" 则只能选择列表中规定的项。<br>"Listbox" 显示多个选项(不用下拉即可看到)，并允许多选<br>"CheckBox" "RadioButton" 和 Windows中的相应控件类似。<br>"FileRequest" 显示一个输入框和浏览按钮，允许用户用文件选择对话框选取文件。<br>"DirRequest" 和 "FileRequest" 类似，但只选取到目录。<br>"Icon" 显示图标<br>"Bitmap" 显示位图<br>"GroupBox" 显示组合框<br>"Link" 显示超链<br>"Button" 按钮<br><br>Text (可选的) 对 checkbox,radio button 控件是 caption；对 DirRequest 控件是浏览对话框的标题；对图标，位图控件是图像文件的的路径。<br><br>State (可选的) 控件状态，该状态可以在 nsi 脚本读取。对于文本类型的控件，state 的值是用户输入的字符串。对于 radio button 和 check boxes state 为'0'或'1'。对 list boxes, combo boxes 和 drop lists 状态值是选中的选项，如果有多个则用管道符号'|'分割。 对于超链和按钮 State 是可以用 ShellExecute 执行的字符串。<br><br>ListItems (可选的) combobox, droplist, 或 listbox的选项，选项之间用管道符号'|'分割<br>MaxLen (可选的) 最大输入长度<br>MinLen (可选的) 最小输入长度<br>ValidateText (可选的) 校验文本<br><br>Left<br>Right<br>Top<br>Bottom (required) 控件坐标，在可视化环境中不重要。<br>Filter (可选的) 指定 "FileRequest" 控件的文件过滤器，模式如 文本文件|*.txt|程序文件|*.exe;*.com|所有文件|*.*<br><br>Root (可选的) 指定"DirRequest" 控件的根目录<br>Flags (可选的) 指定控件的修饰。多个值用管道符号'|'分割且不能有空格。有效的值如下：<br>Value Meaning<br>REQ_SAVE 将 "FileRequest" 控件变成 "另存为" 对话框<br>FILE_MUST_EXIST 用于 "FileRequest" 控件，规定所选文件是否必须存在<br>FILE_EXPLORER 用于 "FileRequest" 控件<br>FILE_HIDEREADONLY 用于 "FileRequest" 控件，隐藏 "open read only"checkbox<br>WARN_IF_EXIST 用于 "FileRequest" 控件，显示警告如果文件已存在<br>PATH_MUST_EXIST 用于 "FileRequest" 控件，规定输入的路径必须存在<br>PROMPT_CREATE 用于 "FileRequest" 控件，在创建之前显示警告如果文件或路径不存在<br>RIGHT 用于"Checkbox"和Radiobutton"控件，规定文字出现在左边，很少用<br>MULTISELECT 用于"Listbox"控件允许多选<br>EXTENDEDSELCT 用于"Listbox"控件允许多选<br>RESIZETOFIT 用于"Bitmap"控件，将图片扩大到控件的大小<br>GROUP 多个控件分组，该标志放在同组的第一个控件上。<br>NOTABSTOP 禁止tab键焦点落在该控件上<br>DISABLED 禁用控件<br>ONLY_NUMBERS 用于"Text"控件，Forces the user to enter only numbers into the edit box.<br>MULTILINE 用于"Text"控件，允许多行输入<br>WANTRETURN 用于"Text"控件，允许多行输入，规定按下Enter键时插入回车<br>NOWORDWRAP 用于"Text"控件，允许多行输入禁用word-wrap<br>HSCROLL 显示水平方向的滚动条<br>VSCROLL 显示垂直方向的滚动条<br>READONLY 用于"Text"控件，使文本输入框变成只读<br>NOTIFY 用于"Button", "Link", "CheckBox", "RadioButton", "ListBox"和"DropList"控件。使InstallOptions触发事件，调用定制页面的validation/leave方法。<br>TxtColor (可选的) 用于"Link"控件，指定文本的前景色，格式为: 0xBBRRGG (十六进制)<br><br>使用定制向导页的步骤：<br>1. 设计定制向导页界面，产生界面描述ini文件，可以使用HM NIS Edit的可视化工具简化开发<br>2. 编写nsi脚本：<br>首先，如果使用了lzma,gzip等压缩算法，需要在所有File指令前reserve定制界面的ini文件：ReserveFile ".ini"。<br>然后，在.onInit方法中使用宏!insertmacro MUI_INSTALLOPTIONS_EXTRACT ".ini"。<br>接着，编写定制对话框的显示函数。<br>最后，用Page指令在合适的位置插入该向导页面。<br><br>定制对话框显示函数的示例：<br>Function setChooseBuildArea<br>!insertmacro MUI_HEADER_TEXT "请选择构建目录" "请选择构建目录"<br>!insertmacro MUI_INSTALLOPTIONS_WRITE "buildarea.ini" "Field 2" "State" "$INSTDIR\buildarea"<br>!insertmacro MUI_INSTALLOPTIONS_DISPLAY "buildarea.ini"<br>FunctionEnd<br>该函数的第一行代码设置向导页面的头上的文字；第二行代码设置向导页面第二个控件的State为"$INSTDIR\buildarea"，也就是设置该控件的默认值；第三行代码显示对话框。<br>用Page指令插入向导页的代码如下：<br>Page custom setChooseBuildArea "" "--选择构建目录"<br>该指令接受三个参数，前两个是该页面的显示函数和离开函数，第三个是显示在标题栏的文字。<br><br>nsi的变量如果存放字符串的话，默认只能保存1024。对于复杂的Java应用，由于需要设置Classpath其命令行的长度往往会超过1024。此时，必须让nsi的变量支持大于1024的字符串长度。有两种方法解决此问题，一个是到http: //nsis.sourceforge.net/download/specialbuilds/处下载Special Builds，目前一个称为Large strings的build支持可以存放8192个字符的变量；另外一个就是手工编译NSIS的源代码，加上需要的选项。<br><br></div>
<img src ="http://www.cppblog.com/iniwf/aggbug/77267.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/iniwf/" target="_blank">iniwf</a> 2009-03-20 09:01 <a href="http://www.cppblog.com/iniwf/archive/2009/03/20/77267.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>NSIS 常用小问题合集</title><link>http://www.cppblog.com/iniwf/archive/2009/03/19/77253.html</link><dc:creator>iniwf</dc:creator><author>iniwf</author><pubDate>Thu, 19 Mar 2009 15:42:00 GMT</pubDate><guid>http://www.cppblog.com/iniwf/archive/2009/03/19/77253.html</guid><wfw:comment>http://www.cppblog.com/iniwf/comments/77253.html</wfw:comment><comments>http://www.cppblog.com/iniwf/archive/2009/03/19/77253.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/iniwf/comments/commentRss/77253.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/iniwf/services/trackbacks/77253.html</trackback:ping><description><![CDATA[转自<a href="http://dreams8.com/thread-682-1-1.html">http://dreams8.com/thread-682-1-1.html</a><br><br>
<div class=t_msgfontfix>
<table cellSpacing=0 cellPadding=0>
    <tbody>
        <tr>
            <td class=t_msgfont id=postmessage_1655>问： 在安装过程中按&#8220;取消&#8221;的话，会弹出是否终止安装的确认窗口，请问怎样<span class=t_tag onclick=tagshow(event) href="tag.php?name=%C9%E8%D6%C3">设置</span>可以让这个窗口不要出现，按&#8220;取消&#8221;就直接退出呢？<br><br>答： !define MUI_ABORTWARNING&nbsp;&nbsp;把这句去掉就可以了....<br><br><br>问： 如图所示的地方，现在显示的是&#8220;setup 将安装...&#8221;，除了用自<span class=t_tag onclick=tagshow(event) href="tag.php?name=%B6%A8%D2%E5">定义</span>字串来修改这个地方以外，如何把这个setup搞成其他的？比如&#8220;安装<span class=t_tag onclick=tagshow(event) href="tag.php?name=%B3%CC%D0%F2">程序</span>现在将...&#8221; <br><br>答： DirText "安装程序将安装 $(^NameDA) 在下列<span class=t_tag onclick=tagshow(event) href="tag.php?name=%CE%C4%BC%FE">文件</span>夹。要安装到不同文件夹，单击 [浏览(B)] 并<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D1%A1%D4%F1">选择</span>其他的文件夹。 $_CLICK"<br><strong>附图：</strong> <span id=attach_378 onmouseover="showMenu(this.id, 0, 1)" style="DISPLAY: none; POSITION: absolute"><img src="http://dreams8.com/images/default/attachimg.gif" border=0></span> <img class="" id=aimg_378 style="CURSOR: pointer" onclick="zoom(this, this.src)" alt=1.gif src="http://dreams8.com/attachment.php?aid=378&amp;k=ba3da14cd06c05d72c9595b0b7fbeb3d&amp;t=1237477236&amp;noupdate=yes" width=503 unselectable="true" status="2" file="attachment.php?aid=378&amp;k=ba3da14cd06c05d72c9595b0b7fbeb3d&amp;t=1237477236&amp;noupdate=yes" h="359" w="503" Y="552" X="238" outfunc="null" initialized="true">
            <div class=t_attach id=aimg_378_menu style="DISPLAY: none; Z-INDEX: 999; LEFT: 238px; CLIP: rect(auto auto auto auto); POSITION: absolute; TOP: 510px" h="42" w="142" initialized="true" ctrlkey="aimg_378"><a title=1.gif href="http://dreams8.com/attachment.php?aid=378&amp;k=ba3da14cd06c05d72c9595b0b7fbeb3d&amp;t=1237477236&amp;nothumb=yes" target=_blank><strong><span class=t_tag onclick=tagshow(event) href="tag.php?name=%CF%C2%D4%D8"><u><font color=#0000ff>下载</font></u></span></strong></a> (17.84 KB)<br>
            <div class=t_smallfont>2007-1-28 07:45 PM</div>
            </div>
            <br><br><br>问： 如何定义欢迎<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D2%B3%C3%E6">页面</span>的标题字体大小。如下图所示，图三红色框内的标题字体。<br><br>答： 使用以下<span class=t_tag onclick=tagshow(event) href="tag.php?name=%BD%C5%B1%BE">脚本</span>
            <div class=blockcode>
            <div id=code0>
            <ol>
                <li>&nbsp; &nbsp; !define MUI_PAGE_CUSTOMFUNCTION_SHOW ChageFONT<br>
                <li>&nbsp; &nbsp; !insertmacro MUI_PAGE_WELCOME<br>
                <li><br>
                <li>&nbsp; &nbsp; Function ChageFONT<br>
                <li>&nbsp; &nbsp; 　GetDlgItem $0 $MUI_HWND 1201<br>
                <li>&nbsp; &nbsp; 　createFont $1 "Tahoma" "11" "700"<br>
                <li>&nbsp; &nbsp; 　SendMessage $0 ${WM_SETFONT} $1 0<br>
                <li>&nbsp; &nbsp; FunctionEnd</li>
            </ol>
            </div>
            <em onclick="copycode($('code0'));">复制<span class=t_tag onclick=tagshow(event) href="tag.php?name=%B4%FA%C2%EB">代码</span></em></div>
            <strong>附图：</strong> <span id=attach_379 onmouseover="showMenu(this.id, 0, 1)" style="DISPLAY: none; POSITION: absolute"><img src="http://dreams8.com/images/default/attachimg.gif" border=0></span> <img class="" id=aimg_379 style="CURSOR: pointer" onclick="zoom(this, this.src)" alt=2.gif src="http://dreams8.com/attachment.php?aid=379&amp;k=3a820080c138e3048ca1100aa6d167f5&amp;t=1237477236&amp;noupdate=yes" width=503 unselectable="true" status="2" file="attachment.php?aid=379&amp;k=3a820080c138e3048ca1100aa6d167f5&amp;t=1237477236&amp;noupdate=yes" h="358" w="503" Y="1239" X="238" outfunc="null" initialized="true">
            <div class=t_attach id=aimg_379_menu style="DISPLAY: none; Z-INDEX: 999; LEFT: 238px; CLIP: rect(auto auto auto auto); POSITION: absolute; TOP: 1197px" h="42" w="142" initialized="true" ctrlkey="aimg_379"><a title=2.gif href="http://dreams8.com/attachment.php?aid=379&amp;k=3a820080c138e3048ca1100aa6d167f5&amp;t=1237477236&amp;nothumb=yes" target=_blank><strong><u><font color=#0000ff>下载</font></u></strong></a> (50.32 KB)<br>
            <div class=t_smallfont>2007-1-28 07:45 PM</div>
            </div>
            <br><br><br>问： 添加版本号
            <div class=blockcode>
            <div id=code1>
            <ol>
                <li>&nbsp;&nbsp;VI<span class=t_tag onclick=tagshow(event) href="tag.php?name=Pro">Pro</span>ductVersion "1.2.3.4"<br>
                <li>&nbsp;&nbsp;VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Test Application"<br>
                <li>&nbsp;&nbsp;VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "A test comment"<br>
                <li>&nbsp;&nbsp;VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "Fake company"<br>
                <li>&nbsp;&nbsp;VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "Test Application is a trademark of Fake company"<br>
                <li>&nbsp;&nbsp;VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "?Fake company"<br>
                <li>&nbsp;&nbsp;VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Test Application"<br>
                <li>&nbsp;&nbsp;VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "1.2.3"</li>
            </ol>
            </div>
            <em onclick="copycode($('code1'));">复制代码</em></div>
            在脚本中加入上面的代码，则为 <span class=t_tag onclick=tagshow(event) href="tag.php?name=NSIS">NSIS</span> 生成的 <span class=t_tag onclick=tagshow(event) href="tag.php?name=exe">exe</span> 添加版本信息。<br>问题就是，能否让属性中<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D3%EF%D1%D4">语言</span>显示为&#8220;<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D6%D0%CE%C4">中文</span>（中国）&#8221;？如附图1<br><br>答： 中文 ID 是 2052。 把 ${LANG_ENGLISH} 改为 2052。<br><br>问： 用 2052 之后确实变成&#8220;中文（中国）&#8221;了。但其他内容仍旧是乱码，不知有什么办法可以<span class=t_tag onclick=tagshow(event) href="tag.php?name=%BD%E2%BE%F6">解决</span>吗？如附图2<br><br>答： 版本信息设置语句，放在 !insertmacro MUI_LANGUAGE 的后面，NSIS 要注重次序的。如果使用古典<span class=t_tag onclick=tagshow(event) href="tag.php?name=%BD%E7%C3%E6">界面</span>，放在 LoadLanguageFile "${NSISDIR}\Contrib\Language files\SimpChinese.nlf" 的后面。<br><strong>附图：</strong> <span id=attach_380 onmouseover="showMenu(this.id, 0, 1)" style="DISPLAY: none; POSITION: absolute"><img src="http://dreams8.com/images/default/attachimg.gif" border=0></span> <img class="" id=aimg_380 style="CURSOR: pointer" onclick="zoom(this, this.src)" alt=3.gif src="http://dreams8.com/attachment.php?aid=380&amp;k=85a565575b680e95a378ed10e6888647&amp;t=1237477236&amp;noupdate=yes" width=367 unselectable="true" status="2" file="attachment.php?aid=380&amp;k=85a565575b680e95a378ed10e6888647&amp;t=1237477236&amp;noupdate=yes" h="459" w="367" Y="2157" X="186" outfunc="null" initialized="true">
            <div class=t_attach id=aimg_380_menu style="DISPLAY: none; Z-INDEX: 999; LEFT: 186px; CLIP: rect(auto auto auto auto); POSITION: absolute; TOP: 2115px" h="42" w="142" initialized="true" ctrlkey="aimg_380"><a title=3.gif href="http://dreams8.com/attachment.php?aid=380&amp;k=85a565575b680e95a378ed10e6888647&amp;t=1237477236&amp;nothumb=yes" target=_blank><strong><u><font color=#0000ff>下载</font></u></strong></a> (46.17 KB)<br>
            <div class=t_smallfont>2007-1-28 07:45 PM</div>
            </div>
            <span id=attach_381 onmouseover="showMenu(this.id, 0, 1)" style="DISPLAY: none; POSITION: absolute"><img src="http://dreams8.com/images/default/attachimg.gif" border=0></span> <img class="" id=aimg_381 style="CURSOR: pointer" onclick="zoom(this, this.src)" alt=4.gif src="http://dreams8.com/attachment.php?aid=381&amp;k=b46a727638b312b00c88fa56e44db89b&amp;t=1237477236&amp;noupdate=yes" width=367 unselectable="true" status="2" file="attachment.php?aid=381&amp;k=b46a727638b312b00c88fa56e44db89b&amp;t=1237477236&amp;noupdate=yes" h="459" w="367" Y="2620" X="186" outfunc="null" initialized="true">
            <div class=t_attach id=aimg_381_menu style="DISPLAY: none; Z-INDEX: 999; LEFT: 186px; CLIP: rect(auto auto auto auto); POSITION: absolute; TOP: 2578px" h="42" w="142" initialized="true" ctrlkey="aimg_381"><a title=4.gif href="http://dreams8.com/attachment.php?aid=381&amp;k=b46a727638b312b00c88fa56e44db89b&amp;t=1237477236&amp;nothumb=yes" target=_blank><strong><u><font color=#0000ff>下载</font></u></strong></a> (46.41 KB)<br>
            <div class=t_smallfont>2007-1-28 07:45 PM</div>
            </div>
            <br><br><br>问： 如何禁止显示如附图中的 banner 。<br><br>答： 图示的效果是因为安装程序初始化的时候，也就是 .onInit 函数里需要用到某个文件的时候安装程序需要搜索整个数据区块来把它解压出来，当安装程序比较大的时候搜索比较费时，这个时候才显示解压百分比。一般都是用 ReserveFile 来避开这种搜索。<br>比如 Function .onInit 里有
            <div class=blockcode>
            <div id=code2>
            <ol>
                <li>&nbsp;&nbsp;InitPluginsDir<br>
                <li>&nbsp;&nbsp;File "/oname=$PLUGINSDIR\io.ini" ".\io.ini"</li>
            </ol>
            </div>
            <em onclick="copycode($('code2'));">复制代码</em></div>
            或者其他类似的话，安装程序就需要搜索并解压这个文件<br>一般在脚本头部加 <br>&nbsp;&nbsp;ReserveFile ".\io.ini"<br>这样 io.ini 就保存在数据区块的尾部，安装程序初始化的时候就不用搜索整个数据区块了，相当于加快了安装程序的启动速度。<br><br>问： 根据以上方法使用了，确实不会再出现初始化的对话框了，但是在自定义的 InstallOptions 页显示前，程序还是会停顿一段时间，请问这是为何？如何避免？ <br><br>答： 某些控件比较消耗时间的，比如显示 ICON、位图 等，如果 InstallOptions 里含有这些控件可能会停顿。如果 InstallOptions 是第一个页面的话还要把 InstallOptions.<span class=t_tag onclick=tagshow(event) href="tag.php?name=dll">dll</span> 加入到 ReserveFile 参数里。再或者就是进入 InstallOptions 的时候含有比较复杂的指令，比如循环等。<br>一般在加入&nbsp;&nbsp;ReserveFile ${NSISDIR}\Plugins\InstallOptions.dll 既可避免。<br><strong>附图：</strong> <span id=attach_382 onmouseover="showMenu(this.id, 0, 1)" style="DISPLAY: none; POSITION: absolute"><img src="http://dreams8.com/images/default/attachimg.gif" border=0></span> <img id=aimg_382 onmouseover="showMenu(this.id, false, 2)" style="CURSOR: pointer" onclick="zoom(this, this.src)" alt=5.gif src="http://dreams8.com/attachment.php?aid=382&amp;k=6e87a9cf6ac74b932ea92a1b81eecbf4&amp;t=1237477236&amp;noupdate=yes" width=257 status="2" file="attachment.php?aid=382&amp;k=6e87a9cf6ac74b932ea92a1b81eecbf4&amp;t=1237477236&amp;noupdate=yes">
            <div class=t_attach id=aimg_382_menu style="DISPLAY: none; POSITION: absolute"><a title=5.gif href="http://dreams8.com/attachment.php?aid=382&amp;k=6e87a9cf6ac74b932ea92a1b81eecbf4&amp;t=1237477236&amp;nothumb=yes" target=_blank><strong><u><font color=#0000ff>下载</font></u></strong></a> (2.43 KB)<br>
            <div class=t_smallfont>2007-1-28 07:45 PM</div>
            </div>
            <br><br>问： 如何<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D4%CB%D0%D0">运行</span>一个安装文件 .inf <br><br>答：
            <div class=blockcode>
            <div id=code3>
            <ol>
                <li>ExecWait "RunDll32 advpack.dll,LaunchINFSection skins.inf,DefaultInstall"</li>
            </ol>
            </div>
            <em onclick="copycode($('code3'));">复制代码</em></div>
            问： 关联文件<span class=t_tag onclick=tagshow(event) href="tag.php?name=%CD%BC%B1%EA">图标</span>后，图标没变化。<br><br>答： 刷新图标用，
            <div class=blockcode>
            <div id=code4>
            <ol>
                <li>System::Call 'shell32.dll::SHChangeNotify(l, l, i, i) v (0x08000000, 0, 0, 0)'</li>
            </ol>
            </div>
            <em onclick="copycode($('code4'));">复制代码</em></div>
            问： 我用NSIS做好了一个安装程序，因为数据较多，一共有400多M，用的LZMA压缩方式，做好后的安装程序约200M，但是我发现在运行这个安装程序时会在<span class=t_tag onclick=tagshow(event) href="tag.php?name=%CF%B5%CD%B3">系统</span>TEMP<span class=t_tag onclick=tagshow(event) href="tag.php?name=%C4%BF%C2%BC">目录</span>产生一个同安装后的全部内容同样大的临时文件（一边运行一边加大，最后到400多M去了），如果我做的程序小倒没什么，可是这个程序有400多M，除了要写入安装的数据外还要同样大小的<span class=t_tag onclick=tagshow(event) href="tag.php?name=%BF%D5%BC%E4">空间</span>放临时文件，这样子也实在是太花不来，<br>我想请问：有什么办法能让其在安装时不使用这么多的临时空间吗？安装的脚本是用HM NIS Edit的向导生成的。<br><br>答： 这是因为 NSIS 在用 LZMA 时采用了固实压缩，何谓固实压缩，其实就是把所有文件统一起来压缩，所以这样压出来的文件更加的小，同时也带来了一个问题，安装解压的时候，在临时文件夹中生成一个临时文件，随着安装的<span class=t_tag onclick=tagshow(event) href="tag.php?name=%BD%F8%B3%CC">进程</span>逐渐增大，到最后，需要临时文件会变成跟原安装程序一样大，也就是说，需要原安装程序 2 倍的空间才可以安装这个程序，所以对于安装大量文件时，这是不适合的。<br>NSIS 2.07 版本之前 LZMA 算法是固实压缩的，没有非固实的选项，如果需要这样做，只有下载非固实压缩的编译器，但是 2.07 后的 NSIS 的 LZMA 压缩已经改为默认非固实压缩了，所以这个问题同时也不再存在。如果在<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D6%C6%D7%F7">制作</span>少量文件的安装时，仍然想取用固实压缩可以加入 /SOLID 参数。像这样： SetCompressor /SOLID lzma<br><br><br>问： 能不能在 Section 区段中实现读取INI文件状态来安装。<br>如图所示，若选中单选框1则安装1中定义的文件。若不选中则不安装。若选中单选框2则安装2定义的文件。若不选则不安装。<br><br>答： 使用以下代码，
            <div class=blockcode>
            <div id=code5>
            <ol>
                <li>&nbsp;&nbsp;!include LogicLib.nsh<br>
                <li>&nbsp;&nbsp;Section -post<br>
                <li>&nbsp; &nbsp; SetOutPath $INSTDIR<br>
                <li>&nbsp; &nbsp; !insertmacro MUI_INSTALLOPTIONS_READ $INI_VALUE "info.ini" "Field 2" "State"<br>
                <li>&nbsp; &nbsp; ${If} $INI_VALUE = 1<br>
                <li>&nbsp; &nbsp;&nbsp; &nbsp;File /a ".\file\fileA.exe"<br>
                <li>&nbsp; &nbsp;&nbsp; &nbsp;File /a ".\file\fileB.exe"<br>
                <li>&nbsp; &nbsp; ${EndIf}<br>
                <li>&nbsp; &nbsp; !insertmacro MUI_INSTALLOPTIONS_READ $INI_VALUE "info.ini" "Field 3" "State"<br>
                <li>&nbsp; &nbsp; ${If} $INI_VALUE = 1<br>
                <li>&nbsp; &nbsp;&nbsp; &nbsp;File /a ".\file\fileA.exe"<br>
                <li>&nbsp; &nbsp; ${EndIf}<br>
                <li>&nbsp;&nbsp;SectionEnd</li>
            </ol>
            </div>
            <em onclick="copycode($('code5'));">复制代码</em></div>
            或者使用以下代码，
            <div class=blockcode>
            <div id=code6>
            <ol>
                <li>&nbsp;&nbsp;!include LogicLib.nsh<br>
                <li>&nbsp;&nbsp;Section -post<br>
                <li>&nbsp; &nbsp; SetOutPath $INSTDIR<br>
                <li>&nbsp; &nbsp; !insertmacro MUI_INSTALLOPTIONS_READ $INI_VALUE "info.ini" "Field 2" "State"<br>
                <li>&nbsp; &nbsp; ${If} $INI_VALUE = 1<br>
                <li>&nbsp; &nbsp;&nbsp; &nbsp;;选中时执行的代码<br>
                <li>&nbsp; &nbsp;&nbsp; &nbsp;File /a ".\file\fileA.exe"<br>
                <li>&nbsp; &nbsp;&nbsp; &nbsp;File /a ".\file\fileB.exe"<br>
                <li>&nbsp; &nbsp; ${Else}<br>
                <li>&nbsp; &nbsp;&nbsp; &nbsp;;不选中时执行的代码<br>
                <li>&nbsp; &nbsp;&nbsp; &nbsp;File /a ".\file\fileA.exe"<br>
                <li>&nbsp; &nbsp; ${EndIf}<br>
                <li>&nbsp;&nbsp;SectionEnd</li>
            </ol>
            </div>
            <em onclick="copycode($('code6'));">复制代码</em></div>
            <strong>附图：</strong> <span id=attach_383 onmouseover="showMenu(this.id, 0, 1)" style="DISPLAY: none; POSITION: absolute"><img src="http://dreams8.com/images/default/attachimg.gif" border=0></span> <img id=aimg_383 onmouseover="showMenu(this.id, false, 2)" style="CURSOR: pointer" onclick="zoom(this, this.src)" alt=6.gif src="http://dreams8.com/attachment.php?aid=383&amp;k=158ee62b0f848cb61d8450d4ff6ab0c7&amp;t=1237477236&amp;noupdate=yes" width=378 status="2" file="attachment.php?aid=383&amp;k=158ee62b0f848cb61d8450d4ff6ab0c7&amp;t=1237477236&amp;noupdate=yes">
            <div class=t_attach id=aimg_383_menu style="DISPLAY: none; POSITION: absolute"><a title=6.gif href="http://dreams8.com/attachment.php?aid=383&amp;k=158ee62b0f848cb61d8450d4ff6ab0c7&amp;t=1237477236&amp;nothumb=yes" target=_blank><strong><u><font color=#0000ff>下载</font></u></strong></a> (815 Bytes)<br>
            <div class=t_smallfont>2007-1-28 07:45 PM</div>
            </div>
            <br><br><br>问： 在 NSIS 中如何设置工作目录，例如一些文件的快捷方式，还有安装完一个<span class=t_tag onclick=tagshow(event) href="tag.php?name=%C8%ED%BC%FE">软件</span>后运行一个程序，而这个程序需要检测当前工作目录下的某个文件，这时候设置工作目录尤为重要，否则程序不能正常运行。<br><br>答： NSIS 中设定工作目录使用 SetOutPath，例如在运行程序的代码 ExecWait "$INSTDIR\test2.exe" 前放入 SetOutPath $INSTDIR，那么 $INSTDIR 将会成为当前的工作目录，建立快捷方式也会把工作目录设为 $INSTDIR。<br><span class=t_tag onclick=tagshow(event) href="tag.php?name=%D0%B6%D4%D8">卸载</span>之前运行某程序只需要把运行指令放到 Function un.onInit 里就行<br><br><br>问： 记得以前看到有帖子介绍过可在NSIS中调用.inf文件安装附加<span class=t_tag onclick=tagshow(event) href="tag.php?name=%C7%FD%B6%AF">驱动</span>程序，具体实现代码如下形式：<br>ExecWait "RunDll32 advpack.dll,LaunchINFSection drivers.inf,DefaultInstall"<br>偶在<span class=t_tag onclick=tagshow(event) href="tag.php?name=%B4%F2%B0%FC">打包</span>一小东东时使用了这一方法，但遇到的问题时，如果在卸载区段里设置能<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D7%D4%B6%AF">自动</span>卸载安装过的驱动程序呢？<br><br>答： 能否卸载需要看 INF 文件里面是否有卸载的区段，例如使用 NSIS 卸载 <span class=t_tag onclick=tagshow(event) href="tag.php?name=Windows">Windows</span> Messenger 可以这样：<br>ExecWait "RunDll32 advpack.dll,LaunchINFSection $windir\INF\msmsgs.inf,BLC.Remove" <br>关于 BLC.Remove 的来源，可以打开 msmsgs.inf 文件后，能找到名称为 BLC.Remove 的区段，该区段用于卸载。区段的名称是编写者自己定制的。不同的inf文件，区段名也可能不同。<br>其他的 *.inf 文件也可以按照此类做法。<br><br><br>问： 1. 我做了一个可同时在简繁英下执行的安装程序。 但有个很大的困惑。<br>&nbsp;&nbsp;刚开始时做的是<span class=t_tag onclick=tagshow(event) href="tag.php?name=%BC%F2%CC%E5%D6%D0%CE%C4">简体中文</span>版，在简中下当然没问题，但在英/繁下，创建的中文程序组名和写<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D7%A2%B2%E1">注册</span>表时显示的是乱码。 于是想到写一个三者皆适合的安装程序。<br>&nbsp;&nbsp;我的做法是这样的，在涉及到创建中文程序组和写<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D7%A2%B2%E1%B1%ED">注册表</span>时，加入一个<span class=t_tag onclick=tagshow(event) href="tag.php?name=%C5%D0%B6%CF">判断</span>，如果英文或繁体，则分别创建英文文件名和big5内码文件名。 但在繁体winxp和英文win2k下测试后，发现根本无法正常创建程序组，也无法正常生成uninstall.exe文件。 而写入注册表的中文字符，也不能在繁体系统的注册表中正常显示，而是乱码。<br>&nbsp;&nbsp;<span class=t_tag onclick=tagshow(event) href="tag.php?name=%C7%EB%BD%CC">请教</span><span class=t_tag onclick=tagshow(event) href="tag.php?name=%B8%DF%CA%D6">高手</span>，这种多语言环境下该怎么处理，才能正常显示呢？ 总不能全部都给创建成英文的吧？<br>&nbsp;&nbsp;2. 另外有个小问题，如何让nsis做的安装程序不显示具体的安装文件名，而只显示&#8220;正在复制文件&#8230;&#8230;&#8221;？　象foobar那样，可惜foobar也有个显示详细情况的<span class=t_tag onclick=tagshow(event) href="tag.php?name=%B0%B4%C5%A5">按钮</span>，我想在复制文件过程中完全不显示和提示被复制的文件情况。 <br><br>答： 1. 最简单的处理办法就是给需要处理的资源进行一个定义，然后使用 LangString 定义不同的资源。给个示例：
            <div class=blockcode>
            <div id=code7>
            <ol>
                <li>&nbsp;&nbsp;Caption "$(CAPTION)"<br>
                <li>&nbsp;&nbsp;LangString CAPTION ${1033} "DreamMail Installation"<br>
                <li>&nbsp;&nbsp;LangString CAPTION ${2052} "DreamMail 安装向导"<br>
                <li>&nbsp;&nbsp;LangString CAPTION ${1028} "DreamMail</li>
            </ol>
            </div>
            <em onclick="copycode($('code7'));">复制代码</em></div>
            </td>
        </tr>
    </tbody>
</table>
</div>
<img src ="http://www.cppblog.com/iniwf/aggbug/77253.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/iniwf/" target="_blank">iniwf</a> 2009-03-19 23:42 <a href="http://www.cppblog.com/iniwf/archive/2009/03/19/77253.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>NSIS常见问题集锦</title><link>http://www.cppblog.com/iniwf/archive/2009/03/19/77252.html</link><dc:creator>iniwf</dc:creator><author>iniwf</author><pubDate>Thu, 19 Mar 2009 15:40:00 GMT</pubDate><guid>http://www.cppblog.com/iniwf/archive/2009/03/19/77252.html</guid><wfw:comment>http://www.cppblog.com/iniwf/comments/77252.html</wfw:comment><comments>http://www.cppblog.com/iniwf/archive/2009/03/19/77252.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/iniwf/comments/commentRss/77252.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/iniwf/services/trackbacks/77252.html</trackback:ping><description><![CDATA[转自<a href="http://dreams8.com/thread-700-1-1.html">http://dreams8.com/thread-700-1-1.html</a><br><br>
<table cellSpacing=0 cellPadding=0>
    <tbody>
        <tr>
            <td class=t_msgfont id=postmessage_1675><font color=#ff0000><font size=2>问：在安装过程中按&#8220;取消&#8221;的话，会弹出是否终止安装的确认窗口，请问怎样<span class=t_tag onclick=tagshow(event) href="tag.php?name=%C9%E8%D6%C3">设置</span>可以让这个窗口不要出现,按&#8220;取消&#8221;就直接退出呢？</font></font><br><br><font size=2>答：!define MUI_ABORTWARNING 把这句去掉就可以了。</font><br><br><font color=#ff0000><font size=2>问：如何将显示的&#8220;setup 将安装...&#8221;中的&#8220;setup&#8221;去掉，除了用自<span class=t_tag onclick=tagshow(event) href="tag.php?name=%B6%A8%D2%E5">定义</span>字串来修改这个地方以外，如何把这个setup搞成其&nbsp;&nbsp;他的？比如&#8220;安装<span class=t_tag onclick=tagshow(event) href="tag.php?name=%B3%CC%D0%F2">程序</span>现在将...&#8221;</font></font><br><br><font size=2>答：DirText "安装程序将安装 $(^NameDA) 在下列<span class=t_tag onclick=tagshow(event) href="tag.php?name=%CE%C4%BC%FE">文件</span>夹。要安装到不同文件夹，单击 [浏览(B)] 并<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D1%A1%D4%F1">选择</span>其他的文件夹。&nbsp; &nbsp;&nbsp;&nbsp;$_CLICK" </font><br><br><font size=2><font color=#ff0000>问：如何定义欢迎<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D2%B3%C3%E6">页面</span>的标题字体大小。</font></font><br><br><font size=2>答：使用以下<span class=t_tag onclick=tagshow(event) href="tag.php?name=%BD%C5%B1%BE">脚本</span></font><br><br><font size=2>&nbsp; &nbsp; 程序<span class=t_tag onclick=tagshow(event) href="tag.php?name=%B4%FA%C2%EB">代码</span></font>
            <div class=blockcode>
            <div id=code0>
            <ol>
                <li>&nbsp; &nbsp; !define MUI_PAGE_CUSTOMFUNCTION_SHOW ChageFONT<br>
                <li><br>
                <li>&nbsp; &nbsp; !insertmacro MUI_PAGE_WELCOME<br>
                <li><br>
                <li>&nbsp; &nbsp; Function ChageFONT<br>
                <li><br>
                <li>&nbsp; &nbsp; GetDlgItem $0 $MUI_HWND 1201<br>
                <li><br>
                <li>&nbsp; &nbsp; createFont $1 "Tahoma" "11" "700"<br>
                <li><br>
                <li>&nbsp; &nbsp; SendMessage $0 ${WM_SETFONT} $1 0</li>
            </ol>
            </div>
            <em onclick="copycode($('code0'));">复制代码</em></div>
            <font size=2><font color=#ff0000>问：添加版本号</font></font>
            <div class=blockcode>
            <div id=code1>
            <ol>
                <li>VI<span class=t_tag onclick=tagshow(event) href="tag.php?name=Pro">Pro</span>ductVersion "1.2.3.4"<br>
                <li><br>
                <li>VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Test Application"<br>
                <li><br>
                <li>VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "A test comment"<br>
                <li><br>
                <li>VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "Fake company"<br>
                <li><br>
                <li>VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "Test Application is a trademark of Fake company"<br>
                <li><br>
                <li>VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "?Fake company"<br>
                <li><br>
                <li>VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Test Application"<br>
                <li><br>
                <li>VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "1.2.3"</li>
            </ol>
            </div>
            <em onclick="copycode($('code1'));">复制代码</em></div>
            <font size=2><font color=#ff0000>问：在脚本中加入上面的代码，则为 <span class=t_tag onclick=tagshow(event) href="tag.php?name=NSIS">NSIS</span> 生成的 <span class=t_tag onclick=tagshow(event) href="tag.php?name=exe">exe</span> 添加版本信息。问题就是，能否让属性中<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D3%EF%D1%D4">语言</span>显示为&#8220;<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D6%D0%CE%C4">中文</span>（中国）&#8221;？</font></font><br><br><font size=2>答：中文 ID 是 2052。 把 ${LANG_ENGLISH} 改为 2052。</font><br><br><font color=#ff0000><font size=2>问：用 2052 之后确实变成&#8220;中文（中国）&#8221;了。但其他内容仍旧是乱码，不知有什么办法可以<span class=t_tag onclick=tagshow(event) href="tag.php?name=%BD%E2%BE%F6">解决</span>吗？</font></font><br><br><font size=2>答：版本信息设置语句，放在 !insertmacro MUI_LANGUAGE 的后面，NSIS 要注重次序的。如果使用古典<span class=t_tag onclick=tagshow(event) href="tag.php?name=%BD%E7%C3%E6">界面</span>，放在&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; LoadLanguageFile "${NSISDIR}\Contrib\Language files\SimpChinese.nlf" 的后面。</font><br><br><font color=#ff0000><font size=2>问：如何禁止显示 banner 。</font></font><br><br><font size=2>答：图示的效果是因为安装程序初始化的时候，也就是 .onInit 函数里需要用到某个文件的时候安装程序需要搜索整个数据区块&nbsp; &nbsp; 来把它解压出来，当安装程序比较大的时候搜索比较费时，这个时候才显示解压百分比。一般都是用 ReserveFile 来避开&nbsp; &nbsp; 这种搜索。比如 Function .onInit 里有：</font><br><br>程序代码
            <div class=blockcode>
            <div id=code2>
            <ol>
                <li>&nbsp; &nbsp; InitPluginsDir<br>
                <li><br>
                <li>&nbsp; &nbsp; File "/oname=$PLUGINSDIR\io.ini" ".\io.ini"</li>
            </ol>
            </div>
            <em onclick="copycode($('code2'));">复制代码</em></div>
            <font size=2>　　或者其他类似的话，安装程序就需要搜索并解压这个文件。一般在脚本头部加： </font><br><br>程序代码
            <div class=blockcode>
            <div id=code3>
            <ol>
                <li>&nbsp; &nbsp; ReserveFile ".\io.ini"</li>
            </ol>
            </div>
            <em onclick="copycode($('code3'));">复制代码</em></div>
            <font size=2>　　这样 io.ini 就保存在数据区块的尾部，安装程序初始化的时候就不用搜索整个数据区块了，相当于加快了安装程序的启动&nbsp; &nbsp; 速度。</font><br><br><br><font color=#ff0000><font size=2>问：根据以上方法使用了，确实不会再出现初始化的对话框了，但是在自定义的 InstallOptions 页显示前，程序还是会停顿一 段时间，请问这是为何？如何避免？</font></font><br><br><font size=2>答：某些控件比较消耗时间的，比如显示 ICON、位图 等，如果 InstallOptions 里含有这些控件可能会停顿。如果&nbsp; &nbsp;InstallOptions 是第一个页面的话还要把 InstallOptions.<span class=t_tag onclick=tagshow(event) href="tag.php?name=dll">dll</span> 加入到 ReserveFile 参数里。再或者就是进入InstallOptions 的时候含有比较复杂的指令，比如循环等。</font><br><br><font size=2>一般在加入 ReserveFile ${NSISDIR}\Plugins\InstallOptions.dll 既可避免。</font><br><br><font size=2><font color=#ff0000>问：如何<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D4%CB%D0%D0">运行</span>一个安装文件 .inf</font></font> <br><br><font size=2>答：ExecWait "RunDll32 advpack.dll,LaunchINFSection skins.inf,DefaultInstall" </font><br><br><font color=#ff0000><font size=2>问：关联文件<span class=t_tag onclick=tagshow(event) href="tag.php?name=%CD%BC%B1%EA">图标</span>后，图标没变化。</font></font><br><br><font size=2>答：刷新图标用， System::Call shell32.dll::SHChangeNotify(l, l, i, i) v (0x08000000, 0, 0, 0) </font><br><br><font color=#ff0000><font size=2>问：我用NSIS做好了一个安装程序，因为数据较多，一共有400多M，用的LZMA压缩方式，做好后的安装程序约200M，但是我发现 在运行这个安装程序时会在<span class=t_tag onclick=tagshow(event) href="tag.php?name=%CF%B5%CD%B3">系统</span>TEMP<span class=t_tag onclick=tagshow(event) href="tag.php?name=%C4%BF%C2%BC">目录</span>产生一个同安装后的全部内容同样大的临时文件（一边运行一边加大，最后到400多M去了），如果我做的程序小倒没什么，可是这个程序有400多M，除了要写入安装的数据外还要同样大小的<span class=t_tag onclick=tagshow(event) href="tag.php?name=%BF%D5%BC%E4">空间</span>放临时文件，这样子也实在是太花不来，我想请问：有什么办法能让其在安装时不使用这么多的临时空间吗？安装的脚本是用HM NISEdit的向导生成的。</font></font><br><br><font size=2>答：这是因为 NSIS 在用 LZMA 时采用了固实压缩，何谓固实压缩，其实就是把所有文件统一起来压缩，所以这样压出来的文件&nbsp;&nbsp;更加的小，同时也带来了一个问题，安装解压的时候，在临时文件夹中生成一个临时文件，随着安装的<span class=t_tag onclick=tagshow(event) href="tag.php?name=%BD%F8%B3%CC">进程</span>逐渐增大，到最 后，需要临时文件会变成跟原安装程序一样大，也就是说，需要原安装程序 2 倍的空间才可以安装这个程序，所以对于安装大量文件时，这是不适合的。<br><br>NSIS 2.07 版本之前 LZMA 算法是固实压缩的，没有非固实的选项，如果需要这样做，只有<span class=t_tag onclick=tagshow(event) href="tag.php?name=%CF%C2%D4%D8">下载</span>非固实压缩的编译器，但 2.07 后的 NSIS 的 LZMA 压缩已经改为默认非固实压缩了，所以这个问题同时也不再存在。如果在<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D6%C6%D7%F7">制作</span>少量文件的安装时，仍然想取用固实压缩可以加入 /SOLID 参数。<br><br>像这样： SetCompressor /SOLID lzma</font><br><br><font color=#ff0000><font size=2>问：能不能在 Section 区段中实现读取INI文件状态来安装。若选中单选框1则安装1中定义的文件。若不选中则不安装。若选中单选框2则安装2定义的文件。若不选则不安装。</font></font><br><br><font size=2>答：使用以下代码</font><br><br>程序代码
            <div class=blockcode>
            <div id=code4>
            <ol>
                <li>&nbsp; &nbsp; !include LogicLib.nsh<br>
                <li><br>
                <li>&nbsp; &nbsp; Section -post<br>
                <li><br>
                <li>&nbsp; &nbsp; SetOutPath $INSTDIR<br>
                <li><br>
                <li>&nbsp; &nbsp; !insertmacro MUI_INSTALLOPTIONS_READ $INI_VALUE "info.ini" "Field 2" "State"<br>
                <li><br>
                <li>&nbsp; &nbsp; ${If} $INI_VALUE = 1<br>
                <li><br>
                <li>&nbsp; &nbsp; File /a ".\file\fileA.exe"<br>
                <li><br>
                <li>&nbsp; &nbsp; File /a ".\file\fileB.exe"<br>
                <li><br>
                <li>&nbsp; &nbsp; ${EndIf}<br>
                <li><br>
                <li>&nbsp; &nbsp; !insertmacro MUI_INSTALLOPTIONS_READ $INI_VALUE "info.ini" "Field 3" "State"<br>
                <li><br>
                <li>&nbsp; &nbsp; ${If} $INI_VALUE = 1<br>
                <li><br>
                <li>&nbsp; &nbsp; File /a ".\file\fileA.exe"<br>
                <li><br>
                <li>&nbsp; &nbsp; ${EndIf}<br>
                <li><br>
                <li>&nbsp; &nbsp; SectionEnd</li>
            </ol>
            </div>
            <em onclick="copycode($('code4'));">复制代码</em></div>
            　　或者使用以下代码<br><br>程序代码
            <div class=blockcode>
            <div id=code5>
            <ol>
                <li>&nbsp; &nbsp; !include LogicLib.nsh<br>
                <li><br>
                <li>&nbsp; &nbsp; Section -post<br>
                <li><br>
                <li>&nbsp; &nbsp; SetOutPath $INSTDIR<br>
                <li><br>
                <li>&nbsp; &nbsp; !insertmacro MUI_INSTALLOPTIONS_READ $INI_VALUE "info.ini" "Field 2" "State"<br>
                <li><br>
                <li>&nbsp; &nbsp; ${If} $INI_VALUE = 1<br>
                <li><br>
                <li>&nbsp; &nbsp; ;选中时执行的代码<br>
                <li><br>
                <li>&nbsp; &nbsp; File /a ".\file\fileA.exe"<br>
                <li><br>
                <li>&nbsp; &nbsp; File /a ".\file\fileB.exe"<br>
                <li><br>
                <li>&nbsp; &nbsp; ${Else}<br>
                <li><br>
                <li>&nbsp; &nbsp; ;不选中时执行的代码<br>
                <li><br>
                <li>&nbsp; &nbsp; File /a ".\file\fileA.exe"<br>
                <li><br>
                <li>&nbsp; &nbsp; ${EndIf}<br>
                <li><br>
                <li>&nbsp; &nbsp; SectionEnd</li>
            </ol>
            </div>
            <em onclick="copycode($('code5'));">复制代码</em></div>
            <font color=#ff0000><font size=2>问：在 NSIS 中如何设置工作目录，例如一些文件的快捷方式，还有安装完一个<span class=t_tag onclick=tagshow(event) href="tag.php?name=%C8%ED%BC%FE">软件</span>后运行一个程序，而这个程序需要检测当前工作目录下的某个文件，这时候设置工作目录尤为重要，否则程序不能正常运行。</font></font><br><br><font size=2>答：NSIS 中设定工作目录使用 SetOutPath，例如在运行程序的代码 ExecWait "$INSTDIR\test2.exe" 前放入 SetOutPath&nbsp;&nbsp;$INSTDIR，那么 $INSTDIR 将会成为当前的工作目录，建立快捷方式也会把工作目录设为 $INSTDIR。<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D0%B6%D4%D8">卸载</span>之前运行某程序只需要把运行指令放到 Function un.onInit 里就行</font><br><br><font color=#ff0000><font size=2>问：记得以前看到有帖子介绍过可在NSIS中调用.inf文件安装附加<span class=t_tag onclick=tagshow(event) href="tag.php?name=%C7%FD%B6%AF">驱动</span>程序，具体实现代码如下形式：</font></font>
            <div class=blockcode>
            <div id=code6>
            <ol>
                <li>&nbsp; &nbsp; ExecWait "RunDll32 advpack.dll,LaunchINFSection drivers.inf,DefaultInstall"</li>
            </ol>
            </div>
            <em onclick="copycode($('code6'));">复制代码</em></div>
            <font color=#ff0000><font size=2>问：偶在<span class=t_tag onclick=tagshow(event) href="tag.php?name=%B4%F2%B0%FC">打包</span>一小东东时使用了这一方法，但遇到的问题时，如果在卸载区段里设置能<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D7%D4%B6%AF">自动</span>卸载安装过的驱动程序呢？</font></font><br><br><font size=2>答：能否卸载需要看 INF 文件里面是否有卸载的区段，例如使用 NSIS 卸载 <span class=t_tag onclick=tagshow(event) href="tag.php?name=Windows">Windows</span> Messenger 可以这样：</font><br><br>程序代码
            <div class=blockcode>
            <div id=code7>
            <ol>
                <li>&nbsp; &nbsp; ExecWait "RunDll32 advpack.dll,LaunchINFSection $windir\INF\msmsgs.inf,BLC.Remove" </li>
            </ol>
            </div>
            <em onclick="copycode($('code7'));">复制代码</em></div>
            <font size=2>　　关于 BLC.Remove 的来源，可以打开 msmsgs.inf 文件后，能找到名称为 BLC.Remove 的区段，该区段用于卸载。区段的&nbsp; &nbsp; 名称是编写者自己定制的。不同的inf文件，区段名也可能不同。其他的 *.inf 文件也可以按照此类做法。</font><br><br><font color=#ff0000><font size=2>问：（问题如下）<br>　　1、我做了一个可同时在简繁英下执行的安装程序。但有个很大的困惑。刚开始时做的是<span class=t_tag onclick=tagshow(event) href="tag.php?name=%BC%F2%CC%E5%D6%D0%CE%C4">简体中文</span>版，在简中下当然没问题， 但在英/繁下，创建的中文程序组名和写<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D7%A2%B2%E1">注册</span>表时显示的是乱码。于是想到写一个三者皆适合的安装程序。我的做法是这样的，在涉及到创建中文程序组和写<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D7%A2%B2%E1%B1%ED">注册表</span>时，加入一个<span class=t_tag onclick=tagshow(event) href="tag.php?name=%C5%D0%B6%CF">判断</span>，如果英文或繁体，则分别创建英文文件名和big5内码文件名。但在繁体winxp和英文win2k下测试后，发现根本无法正常创建程序组，也无法正常生成uninstall.exe文件。而写入注册表的中文字符，也不能在繁体系统的注册表中正常显示，而是乱码。<span class=t_tag onclick=tagshow(event) href="tag.php?name=%C7%EB%BD%CC">请教</span><span class=t_tag onclick=tagshow(event) href="tag.php?name=%B8%DF%CA%D6">高手</span>，这种多语言环境下该怎么处理，才能正常显示呢？ 总不能全部都给创建成英文的吧？<br><br>　　2、另外有个小问题，如何让nsis做的安装程序不显示具体的安装文件名，而只显示&#8220;正在复制文件&#8230;&#8230;&#8221;？象foobar那样，可惜foobar也有个显示详细情况的<span class=t_tag onclick=tagshow(event) href="tag.php?name=%B0%B4%C5%A5">按钮</span>，我想在复制文件过程中完全不显示和提示被复制的文件情况。</font></font><br><br><font size=2>答：（解答如下）<br><br>　　1、最简单的处理办法就是给需要处理的资源进行一个定义，然后使用 LangString 定义不同的资源。给个示例：</font><br><br>程序代码
            <div class=blockcode>
            <div id=code8>
            <ol>
                <li>&nbsp; &nbsp; Caption "$(CAPTION)"<br>
                <li><br>
                <li>&nbsp; &nbsp; LangString CAPTION ${1033} "DreamMail Installation"<br>
                <li><br>
                <li>&nbsp; &nbsp; LangString CAPTION ${2052} "DreamMail 安装向导"<br>
                <li><br>
                <li>&nbsp; &nbsp; LangString CAPTION ${1028} "DreamMail 杆翾旧"</li>
            </ol>
            </div>
            <em onclick="copycode($('code8'));">复制代码</em></div>
            <font size=2>　　2、可以使用 DetailPrint ，示例，</font><br><br>程序代码
            <div class=blockcode>
            <div id=code9>
            <ol>
                <li>&nbsp; &nbsp; DetailPrint "正在复制文件..."</li>
            </ol>
            </div>
            <em onclick="copycode($('code9'));">复制代码</em></div>
            <font color=#ff0000><font size=2>问：NSIS对于安装卸载的ICO图标大小有什么要求?编译的时候出现以下错误提示：</font></font>
            <div class=quote>
            <blockquote>&nbsp; &nbsp; Error finding icon resources: installer, uninstaller icon size mismatch - see the Icon instructions&nbsp; &nbsp;&nbsp;&nbsp;documentation for more information -- failing! </blockquote></div>
            <font size=2>答：只要保证安装图标与卸载图标大小相同即可。</font><br><br><font color=#ff0000><font size=2>问：如何屏蔽如下图中的安装程序校验。</font></font><br><br><font size=2>答：CRCCheck　on|off|force 指定安装前安装程序是否对自身执行一个 CRC。注意，如果<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D3%C3%BB%A7">用户</span>使用了 /NCRC <span class=t_tag onclick=tagshow(event) href="tag.php?name=%C3%FC%C1%EE">命令</span>行参数，且你没有指定 force 参数时，不会执行 CRC，这样有可能导致用户安装一个损坏的安装程序。安装程序 CRC 校验是默认打开的。可以在脚本中用 CRCCheck off 来默认禁止安装程序的 CRC 校验。不过这样做正如解释上说的可能安装会出现问题。作汉化的最好加上校验，免得安装程序的问题变成你汉化质量的问题。</font><br><br><font color=#ff0000><font size=2>问：在安装的时候不是可以选择多种语言么？但是我怎样实现当选择英文时就装英文版，选择中文时就装<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D6%D0%CE%C4%B0%E6">中文版</span>？</font></font><br><br><font size=2>答：使用以下脚本：</font>
            <div class=blockcode>
            <div id=code10>
            <ol>
                <li>&nbsp; &nbsp; StrCmp $LANGUAGE ${LANG_SIMPCHINESE} 0 +3<br>
                <li><br>
                <li>&nbsp; &nbsp; File "你需要安装的中文文件"<br>
                <li><br>
                <li>&nbsp; &nbsp; Goto lbl_finish<br>
                <li><br>
                <li>&nbsp; &nbsp; File "你需要安装的英文文件"<br>
                <li><br>
                <li>&nbsp; &nbsp; lbl_finish:</li>
            </ol>
            </div>
            <em onclick="copycode($('code10'));">复制代码</em></div>
            <font color=#ff0000>问：<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D7%E9%BC%FE">组件</span>A 组件B 组件C 均为可选，A可单独安装，B或者C被选择的时候A必须被选择。</font><br><br><font size=2>答：以下代码：</font>
            <div class=blockcode>
            <div id=code11>
            <ol>
                <li>Section "组件 A" aaa<br>
                <li><br>
                <li>　detailprint "A"<br>
                <li><br>
                <li>SectionEnd<br>
                <li><br>
                <li>Section "组件 B" bbb<br>
                <li><br>
                <li>　detailprint "B"<br>
                <li><br>
                <li>SectionEnd<br>
                <li><br>
                <li>Section "组件 C" ccc<br>
                <li><br>
                <li>　detailprint "C"<br>
                <li><br>
                <li>SectionEnd<br>
                <li><br>
                <li>Function .onSelChange<br>
                <li><br>
                <li>　SectionGetFlags ${bbb} $0<br>
                <li><br>
                <li>　SectionGetFlags ${ccc} $1<br>
                <li><br>
                <li>　IntOp $0 $0 1<br>
                <li><br>
                <li>　IntOp $1 $1 1<br>
                <li><br>
                <li>　IntCmp $0 1 0 +2<br>
                <li><br>
                <li>　　SectionSetFlags ${aaa} 1<br>
                <li><br>
                <li>　IntCmp $1 1 0 +2<br>
                <li><br>
                <li>　　SectionSetFlags ${aaa} 1<br>
                <li><br>
                <li>FunctionEnd</li>
            </ol>
            </div>
            <em onclick="copycode($('code11'));">复制代码</em></div>
            <font size=2>解释：SectionGetFlags 表示获取某区段的flags状态（就是是否被勾选，选中返回值为1，反之为0）。SectionGetFlags ${bbb} $0 表示获取序号为${bbb}的区段的Flags状态并把返回值输出到变量 $0，C 区段相同。接着就是 StrCmp ，解释同上楼。SectionSetFlags ${aaa} 1 表示设置序号为 ${aaa} 区段的 Flags 状态为 1，即勾选。</font><br><br><font color=#ff0000><font size=2>问：怎么让&#8220;许可协议&#8221;页面的标题栏，如程序中的&#8220;MutliPages 演示&#8221;修改为&#8220;MutliPages 演示：许可协议&#8221;。</font></font><br><br><font size=2>答：首先创建一个函数，如下。</font>
            <div class=blockcode>
            <div id=code12>
            <ol>
                <li>Function LicensePagePre<br>
                <li><br>
                <li>SendMessage $HWNDPARENT ${WM_SETTEXT} 0 "STR:我爱你"<br>
                <li><br>
                <li>FunctionEnd</li>
            </ol>
            </div>
            <em onclick="copycode($('code12'));">复制代码</em></div>
            然后在协议页面句子 <br><br>程序代码
            <div class=blockcode>
            <div id=code13>
            <ol>
                <li>!insertmacro MUI_PAGE_LICENSE "c:\path\to\licence\YourSoftwareLicence.txt"</li>
            </ol>
            </div>
            <em onclick="copycode($('code13'));">复制代码</em></div>
            <font size=2>　　之前加入如下语句</font><br>程序代码
            <div class=blockcode>
            <div id=code14>
            <ol>
                <li>!define MUI_PAGE_CUSTOMFUNCTION_PRE LicensePagePre</li>
            </ol>
            </div>
            <em onclick="copycode($('code14'));">复制代码</em></div>
            <font size=2><font color=#ff0000>问：比如，我把 a.exe 用nsis包装好，安装到 c:\helloLib\a.exe，完成后，想把c:\helloLib\添加到系统环境变量的path 里头，这样，在任何地方输入a.exe可执行。如何将路径添加到系统环境变量中？</font></font><br><br><font size=2>答：以下代码实现：</font><br>程序代码
            <div class=blockcode>
            <div id=code15>
            <ol>
                <li>ReadRegStr $0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path"<br>
                <li><br>
                <li>WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path" "$0;C:\hellolib"</li>
            </ol>
            </div>
            <em onclick="copycode($('code15'));">复制代码</em></div>
            <font size=2>　　另类方法一：写注册表，如</font><br><br>程序代码
            <div class=blockcode>
            <div id=code16>
            <ol>
                <li>[HKEY_CLASSES_ROOT\Applications\a.exe\shell\open\command]<br>
                <li><br>
                <li>@="yourpath\a.exe" </li>
            </ol>
            </div>
            <em onclick="copycode($('code16'));">复制代码</em></div>
            <font size=2>　　另类方法二：</font><br><br>程序代码
            <div class=blockcode>
            <div id=code17>
            <ol>
                <li>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\a.exe]<br>
                <li><br>
                <li>@="c:\helloLib\a.exe"</li>
            </ol>
            </div>
            <em onclick="copycode($('code17'));">复制代码</em></div>
            <font size=2><font color=#ff0000>问：在NSIS中如何才能做到根据对于注册表键值的判断决定是否写入字串，如果判断出某个key存在，则写入相应的字串，如果不 存在，则不写入字串。例如：我先要判断&#8220;HKLM SOFTWARE\nsis&#8221;这个key存不存在。</font></font><br><br><font size=2><font color=#ff0000>如果存在则写入字串&#8220;DispName: nsis&#8221;，应该是用&#8220;WriteRegStr HKLM "SOFTWARE\nsis" "DispName" "nsis"&#8221;。如果不存在这个key，则不写入注册&nbsp; &nbsp; 表，继续下面的安装。</font></font><br><br><font size=2>答：以下代码实现：</font><br><br>程序代码
            <div class=blockcode>
            <div id=code18>
            <ol>
                <li>ReadRegStr $0 HKLM SOFTWARE\nsis ""<br>
                <li><br>
                <li>　IfErrors 0 +2<br>
                <li><br>
                <li>　Goto +2<br>
                <li><br>
                <li>WriteRegStr HKLM "SOFTWARE\nsis" "DispName" "nsis"</li>
            </ol>
            </div>
            <em onclick="copycode($('code18'));">复制代码</em></div>
            <font size=2><font color=#ff0000>问：如何制作安装包的时候需要调用系统函数来检测当前安装包运行的操作系统的内码页。</font></font><br><br><font size=2>答：以下代码显示系统语言：</font><br><br>程序代码
            <div class=blockcode>
            <div id=code19>
            <ol>
                <li>System::Call "Kernel32::GetSystemDefaultLangID(v ..) i .s"<br>
                <li><br>
                <li>Pop $0<br>
                <li><br>
                <li>IntOp $0 $0 0xFFFF<br>
                <li><br>
                <li>MessageBox MB_OK $0</li>
            </ol>
            </div>
            <em onclick="copycode($('code19'));">复制代码</em></div>
            <font size=2><font color=#ff0000>问：如何用NSIS注册字体？</font></font><br><br><font size=2>答：以下代码：</font><br><br>程序代码
            <div class=blockcode>
            <div id=code20>
            <ol>
                <li>!include WinMessages.nsh<br>
                <li><br>
                <li>Section "MainSection" SEC01<br>
                <li><br>
                <li>File /oname=$FONTS\tahoma.ttf tahoma.ttf<br>
                <li><br>
                <li>Push "$FONTS\tahoma.ttf"<br>
                <li><br>
                <li>System::Call "Gdi32::AddFontResource(t s) i .s"<br>
                <li><br>
                <li>Pop $0<br>
                <li><br>
                <li>IntCmp $0 0 0 +2 +2<br>
                <li><br>
                <li>MessageBox MB_OK "注册字体失败"<br>
                <li><br>
                <li>SendMessage ${HWND_BROADcast} ${WM_FONTCHANGE} 0 0<br>
                <li><br>
                <li>SectionEnd</li>
            </ol>
            </div>
            <em onclick="copycode($('code20'));">复制代码</em></div>
            <font size=2><font color=#ff0000>问：如何用 NSIS 安装输入法。</font></font><br><br><font size=2>答：以下代码：</font><br><br>程序代码
            <div class=blockcode>
            <div id=code21>
            <ol>
                <li>SetOutPath $SYSDIR<br>
                <li><br>
                <li>File WBIME.ime<br>
                <li><br>
                <li>Push "五笔输入法"<br>
                <li><br>
                <li>Push "$SYSDIR\WBIME.ime"<br>
                <li><br>
                <li>System::Call "Imm32::ImmInstallIME(t s, t s) i .s"<br>
                <li><br>
                <li>System::Call "Imm32::ImmIsIME(i s) i .s"<br>
                <li><br>
                <li>Pop $0<br>
                <li><br>
                <li>IntCmp $0 1 0 +3 +3<br>
                <li><br>
                <li>MessageBox MB_OK "输入法安装成功"<br>
                <li><br>
                <li>Goto +2<br>
                <li><br>
                <li>MessageBox MB_OK "输入法安装失败"</li>
            </ol>
            </div>
            <em onclick="copycode($('code21'));">复制代码</em></div>
            </td>
        </tr>
    </tbody>
</table>
<img src ="http://www.cppblog.com/iniwf/aggbug/77252.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/iniwf/" target="_blank">iniwf</a> 2009-03-19 23:40 <a href="http://www.cppblog.com/iniwf/archive/2009/03/19/77252.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>NSIS教程之提高篇</title><link>http://www.cppblog.com/iniwf/archive/2009/03/19/77249.html</link><dc:creator>iniwf</dc:creator><author>iniwf</author><pubDate>Thu, 19 Mar 2009 15:21:00 GMT</pubDate><guid>http://www.cppblog.com/iniwf/archive/2009/03/19/77249.html</guid><wfw:comment>http://www.cppblog.com/iniwf/comments/77249.html</wfw:comment><comments>http://www.cppblog.com/iniwf/archive/2009/03/19/77249.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/iniwf/comments/commentRss/77249.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/iniwf/services/trackbacks/77249.html</trackback:ping><description><![CDATA[<p>由于本文图片链接已失效，文章移至我们的开发网站，<br><a href="http://qianqiukf.com/%e7%9f%a5%e8%af%86%e5%88%86%e4%ba%ab/tabid/71/EntryId/3/NSIS.aspx">http://qianqiukf.com/%e7%9f%a5%e8%af%86%e5%88%86%e4%ba%ab/tabid/71/EntryId/3/NSIS.aspx</a><br>如果上面链接失效，可以访问<a href="http://qianqiukf.com/%e7%9f%a5%e8%af%86%e5%88%86%e4%ba%ab/tabid/71/EntryId/3/NSIS.aspx">http://qianqiukf.com</a><br><br>感谢大家的光临。O(&#8745;_&#8745;)O谢谢！</p>
<img src ="http://www.cppblog.com/iniwf/aggbug/77249.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/iniwf/" target="_blank">iniwf</a> 2009-03-19 23:21 <a href="http://www.cppblog.com/iniwf/archive/2009/03/19/77249.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>NSIS安装制作基础教程（初级篇）</title><link>http://www.cppblog.com/iniwf/archive/2009/03/19/77247.html</link><dc:creator>iniwf</dc:creator><author>iniwf</author><pubDate>Thu, 19 Mar 2009 15:15:00 GMT</pubDate><guid>http://www.cppblog.com/iniwf/archive/2009/03/19/77247.html</guid><wfw:comment>http://www.cppblog.com/iniwf/comments/77247.html</wfw:comment><comments>http://www.cppblog.com/iniwf/archive/2009/03/19/77247.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/iniwf/comments/commentRss/77247.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/iniwf/services/trackbacks/77247.html</trackback:ping><description><![CDATA[<p>转自<a href="http://dreams8.com/thread-684-1-1.html">http://dreams8.com/thread-684-1-1.html</a><br><br></p>
<div class=t_msgfontfix>
<table cellSpacing=0 cellPadding=0>
    <tbody>
        <tr>
            <td class=t_msgfont id=postmessage_1658><span class=t_tag onclick=tagshow(event) href="tag.php?name=NSIS">NSIS</span>简介：<br>　　NSIS 是&#8220;Nullsoft <span class=t_tag onclick=tagshow(event) href="tag.php?name=%BD%C5%B1%BE">脚本</span>安装<span class=t_tag onclick=tagshow(event) href="tag.php?name=%CF%B5%CD%B3">系统</span>&#8221;（Nullsoft Scriptable Installation System）的缩写，它是一个免费的 Win32 安装、<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D0%B6%D4%D8">卸载</span>系统。它的特点：脚本简洁高效；系统开销小；当然进行安装、卸载、<span class=t_tag onclick=tagshow(event) href="tag.php?name=%C9%E8%D6%C3">设置</span>系统设置、解压<span class=t_tag onclick=tagshow(event) href="tag.php?name=%CE%C4%BC%FE">文件</span>等等更不在话下，几乎可以做所有的事情。更多的功能请阅读蓝色网际的《NSIS帮助文档》。<br>　　对于<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D6%C6%D7%F7">制作</span>NSIS的使用<span class=t_tag onclick=tagshow(event) href="tag.php?name=%BD%CC%B3%CC">教程</span>，蓝色网际是NSIS方面的<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D7%A8%BC%D2">专家</span>，她的《NSIS帮助文档》就是一本NSIS的圣经，而对初学者来说，最头疼的莫过于一大堆看不懂的<span class=t_tag onclick=tagshow(event) href="tag.php?name=%B4%FA%C2%EB">代码</span>，对他们来说无异于一本天书。缘于此，特草此基础教程，希望NSIS专家们勿见笑，不当之处欢迎批评指正以期完善，也希望给初学者作个铺垫。<br><br><span class=t_tag onclick=tagshow(event) href="tag.php?name=%B9%A4%BE%DF">工具</span>：NIS Edit＋Nullsoft Installation System（NSIS）<br><br>思路：脚本向导＋修改代码＝个性化安装包<br><br>步骤：<br><br>　　一、利用向导制作安装包<br><br>　　01、安装上述两款，启动NIS Edit，在&#8220;文件&#8221;<span class=t_tag onclick=tagshow(event) href="tag.php?name=%B2%CB%B5%A5">菜单</span>中&#8220;新建脚本：向导&#8221;&#8594;下一步&#8221;，如图1。<br>&nbsp;&nbsp; <span id=attach_384 onmouseover="showMenu(this.id, 0, 1)" style="DISPLAY: none; POSITION: absolute"><img src="http://dreams8.com/images/default/attachimg.gif" border=0></span> <img class="" id=aimg_384 style="CURSOR: pointer" onclick="zoom(this, this.src)" alt=1.gif src="http://dreams8.com/attachment.php?aid=384&amp;k=7177e2d16804cd43115a9402e13c441a&amp;t=1237475597&amp;noupdate=yes" width=272 unselectable="true" status="2" file="attachment.php?aid=384&amp;k=7177e2d16804cd43115a9402e13c441a&amp;t=1237475597&amp;noupdate=yes" h="304" w="272" Y="745" X="201" outfunc="null" initialized="true">
            <div class=t_attach id=aimg_384_menu style="DISPLAY: none; Z-INDEX: 999; LEFT: 201px; CLIP: rect(auto auto auto auto); POSITION: absolute; TOP: 703px" h="42" w="142" initialized="true" ctrlkey="aimg_384"><a title=1.gif href="http://dreams8.com/attachment.php?aid=384&amp;k=7177e2d16804cd43115a9402e13c441a&amp;t=1237475597&amp;nothumb=yes" target=_blank><strong><span class=t_tag onclick=tagshow(event) href="tag.php?name=%CF%C2%D4%D8"><u><font color=#0000ff>下载</font></u></span></strong></a> (14.18 KB)<br>
            <div class=t_smallfont>2007-1-28 07:50 PM</div>
            </div>
            <br><br>　　02、设置应用<span class=t_tag onclick=tagshow(event) href="tag.php?name=%B3%CC%D0%F2">程序</span>信息，如<span class=t_tag onclick=tagshow(event) href="tag.php?name=%C8%ED%BC%FE">软件</span>名称、版本、出版人等，如图2。当然最一个网站可以留空，如果设置了，则安装包会生成一个对应网址的&#8220;Internet 快捷方式&#8221;。<br><span id=attach_385 onmouseover="showMenu(this.id, 0, 1)" style="DISPLAY: none; POSITION: absolute"><img src="http://dreams8.com/images/default/attachimg.gif" border=0></span> <img class="" id=aimg_385 style="CURSOR: pointer" onclick="zoom(this, this.src)" alt=2.gif src="http://dreams8.com/attachment.php?aid=385&amp;k=873b16460b80f73041b745a900f6ede3&amp;t=1237475597&amp;noupdate=yes" width=505 unselectable="true" status="2" file="attachment.php?aid=385&amp;k=873b16460b80f73041b745a900f6ede3&amp;t=1237475597&amp;noupdate=yes" h="378" w="505" Y="1113" X="186" outfunc="null" initialized="true">
            <div class=t_attach id=aimg_385_menu style="DISPLAY: none; Z-INDEX: 999; LEFT: 186px; CLIP: rect(auto auto auto auto); POSITION: absolute; TOP: 1071px" h="42" w="142" initialized="true" ctrlkey="aimg_385"><a title=2.gif href="http://dreams8.com/attachment.php?aid=385&amp;k=873b16460b80f73041b745a900f6ede3&amp;t=1237475597&amp;nothumb=yes" target=_blank><strong><u><font color=#0000ff>下载</font></u></strong></a> (14.63 KB)<br>
            <div class=t_smallfont>2007-1-28 07:50 PM</div>
            </div>
            <br><br>　　03、设置程序选项，如安装包<span class=t_tag onclick=tagshow(event) href="tag.php?name=%CD%BC%B1%EA">图标</span>、安装程序文件、安装包<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D3%EF%D1%D4">语言</span>[这里选&#8220;SimChinese&#8221;]、<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D3%C3%BB%A7">用户</span>图形<span class=t_tag onclick=tagshow(event) href="tag.php?name=%BD%E7%C3%E6">界面</span>及压缩方式等，我们可以选用默认值，也可以点击对应项目的<span class=t_tag onclick=tagshow(event) href="tag.php?name=%B0%B4%C5%A5">按钮</span>或下拉菜单更改设置，如下图3。<br>&nbsp;&nbsp; <span id=attach_386 onmouseover="showMenu(this.id, 0, 1)" style="DISPLAY: none; POSITION: absolute"><img src="http://dreams8.com/images/default/attachimg.gif" border=0></span> <img class="" id=aimg_386 style="CURSOR: pointer" onclick="zoom(this, this.src)" alt=4.gif src="http://dreams8.com/attachment.php?aid=386&amp;k=a69e7be3cd3dd4aa22111a47dc8586c2&amp;t=1237475597&amp;noupdate=yes" width=505 unselectable="true" status="2" file="attachment.php?aid=386&amp;k=a69e7be3cd3dd4aa22111a47dc8586c2&amp;t=1237475597&amp;noupdate=yes" h="379" w="505" Y="1578" X="201" outfunc="null" initialized="true">
            <div class=t_attach id=aimg_386_menu style="DISPLAY: none; Z-INDEX: 999; LEFT: 201px; CLIP: rect(auto auto auto auto); POSITION: absolute; TOP: 1536px" h="42" w="142" initialized="true" ctrlkey="aimg_386"><a title=4.gif href="http://dreams8.com/attachment.php?aid=386&amp;k=a69e7be3cd3dd4aa22111a47dc8586c2&amp;t=1237475597&amp;nothumb=yes" target=_blank><strong><u><font color=#0000ff>下载</font></u></strong></a> (18.4 KB)<br>
            <div class=t_smallfont>2007-1-28 07:50 PM</div>
            </div>
            <br><br>　　04、设置安装<span class=t_tag onclick=tagshow(event) href="tag.php?name=%C4%BF%C2%BC">目录</span>及授权信息，如图4后&#8220;下一步&#8221;。<br><span id=attach_387 onmouseover="showMenu(this.id, 0, 1)" style="DISPLAY: none; POSITION: absolute"><img src="http://dreams8.com/images/default/attachimg.gif" border=0></span> <img class="" id=aimg_387 style="CURSOR: pointer" onclick="zoom(this, this.src)" alt=4.gif src="http://dreams8.com/attachment.php?aid=387&amp;k=893295ba72bad540eeccbde1e87136ec&amp;t=1237475597&amp;noupdate=yes" width=505 unselectable="true" status="2" file="attachment.php?aid=387&amp;k=893295ba72bad540eeccbde1e87136ec&amp;t=1237475597&amp;noupdate=yes" h="379" w="505" Y="1999" X="186" outfunc="null" initialized="true">
            <div class=t_attach id=aimg_387_menu style="DISPLAY: none; Z-INDEX: 999; LEFT: 186px; CLIP: rect(auto auto auto auto); POSITION: absolute; TOP: 1957px" h="42" w="142" initialized="true" ctrlkey="aimg_387"><a title=4.gif href="http://dreams8.com/attachment.php?aid=387&amp;k=893295ba72bad540eeccbde1e87136ec&amp;t=1237475597&amp;nothumb=yes" target=_blank><strong><u><font color=#0000ff>下载</font></u></strong></a> (18.4 KB)<br>
            <div class=t_smallfont>2007-1-28 07:50 PM</div>
            </div>
            <br><br>　　05、选定程序文件，即我们要<span class=t_tag onclick=tagshow(event) href="tag.php?name=%B4%F2%B0%FC">打包</span>的文件，可以使用默认的&#8220;Mainsection&#8221;，也可以根据需要进行更改或新建组别，如果组比较多时，你也可以设置是否&#8220;允许用户<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D1%A1%D4%F1">选择</span>要安装的<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D7%E9%BC%FE">组件</span>&#8221;，如图5。<br><span id=attach_388 onmouseover="showMenu(this.id, 0, 1)" style="DISPLAY: none; POSITION: absolute"><img src="http://dreams8.com/images/default/attachimg.gif" border=0></span> <img class="" id=aimg_388 style="CURSOR: pointer" onclick="zoom(this, this.src)" alt=5.gif src="http://dreams8.com/attachment.php?aid=388&amp;k=5dd87fb9c5513cf4cc00fb68106392cd&amp;t=1237475597&amp;noupdate=yes" width=506 unselectable="true" status="2" file="attachment.php?aid=388&amp;k=5dd87fb9c5513cf4cc00fb68106392cd&amp;t=1237475597&amp;noupdate=yes" h="381" w="506" Y="2465" X="186" outfunc="null" initialized="true">
            <div class=t_attach id=aimg_388_menu style="DISPLAY: none; Z-INDEX: 999; LEFT: 186px; CLIP: rect(auto auto auto auto); POSITION: absolute; TOP: 2423px" h="42" w="142" initialized="true" ctrlkey="aimg_388"><a title=5.gif href="http://dreams8.com/attachment.php?aid=388&amp;k=5dd87fb9c5513cf4cc00fb68106392cd&amp;t=1237475597&amp;nothumb=yes" target=_blank><strong><u><font color=#0000ff>下载</font></u></strong></a> (19.29 KB)<br>
            <div class=t_smallfont>2007-1-28 07:50 PM</div>
            </div>
            <br><br>　　完毕后进行&#8220;添加文件&#8221;操作，选定我们要打包的文件，如图6，完成<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D7%D4%B6%AF">自动</span>后返回的图5的界面，执行下一步操作。&nbsp; &nbsp; <span id=attach_389 onmouseover="showMenu(this.id, 0, 1)" style="DISPLAY: none; POSITION: absolute"><img src="http://dreams8.com/images/default/attachimg.gif" border=0></span> <img class="" id=aimg_389 style="CURSOR: pointer" onclick="zoom(this, this.src)" alt=6.gif src="http://dreams8.com/attachment.php?aid=389&amp;k=569eea7984d4955b224afa4bd4196466&amp;t=1237475597&amp;noupdate=yes" width=356 unselectable="true" status="2" file="attachment.php?aid=389&amp;k=569eea7984d4955b224afa4bd4196466&amp;t=1237475597&amp;noupdate=yes" h="233" w="356" Y="2889" X="346" outfunc="null" initialized="true">
            <div class=t_attach id=aimg_389_menu style="DISPLAY: none; Z-INDEX: 999; LEFT: 346px; CLIP: rect(auto auto auto auto); POSITION: absolute; TOP: 2847px" h="42" w="142" initialized="true" ctrlkey="aimg_389"><a title=6.gif href="http://dreams8.com/attachment.php?aid=389&amp;k=569eea7984d4955b224afa4bd4196466&amp;t=1237475597&amp;nothumb=yes" target=_blank><strong><u><font color=#0000ff>下载</font></u></strong></a> (13.55 KB)<br>
            <div class=t_smallfont>2007-1-28 07:50 PM</div>
            </div>
            <br><br>　　06、设置开始菜单<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D6%D0%CE%C4">中文</span>件夹名称及快捷方式，这里我们使用默认值，如图7，按&#8220;下一步&#8221;。 <span id=attach_390 onmouseover="showMenu(this.id, 0, 1)" style="DISPLAY: none; POSITION: absolute"><img src="http://dreams8.com/images/default/attachimg.gif" border=0></span> <img class="" id=aimg_390 style="CURSOR: pointer" onclick="zoom(this, this.src)" alt=7.gif src="http://dreams8.com/attachment.php?aid=390&amp;k=2a3853e6528816e785b726fc8956f4f2&amp;t=1237475597&amp;noupdate=yes" width=505 unselectable="true" status="2" file="attachment.php?aid=390&amp;k=2a3853e6528816e785b726fc8956f4f2&amp;t=1237475597&amp;noupdate=yes" h="379" w="505" Y="3165" X="235" outfunc="null" initialized="true">
            <div class=t_attach id=aimg_390_menu style="DISPLAY: none; Z-INDEX: 999; LEFT: 235px; CLIP: rect(auto auto auto auto); POSITION: absolute; TOP: 3123px" h="42" w="142" initialized="true" ctrlkey="aimg_390"><a title=7.gif href="http://dreams8.com/attachment.php?aid=390&amp;k=2a3853e6528816e785b726fc8956f4f2&amp;t=1237475597&amp;nothumb=yes" target=_blank><strong><u><font color=#0000ff>下载</font></u></strong></a> (19.64 KB)<br>
            <div class=t_smallfont>2007-1-28 07:50 PM</div>
            </div>
            <br><br>　　07、指定安装后要<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D4%CB%D0%D0">运行</span>的程序，同上用默认值并设置相关运行参数及描述，如果你和我一样懒的话，或不想在安装运行任何程序，则留空即可，如图8。 <span id=attach_391 onmouseover="showMenu(this.id, 0, 1)" style="DISPLAY: none; POSITION: absolute"><img src="http://dreams8.com/images/default/attachimg.gif" border=0></span> <img class="" id=aimg_391 style="CURSOR: pointer" onclick="zoom(this, this.src)" alt=8.gif src="http://dreams8.com/attachment.php?aid=391&amp;k=ad6bfd5224ff25719314ce19a656db21&amp;t=1237475597&amp;noupdate=yes" width=505 unselectable="true" status="2" file="attachment.php?aid=391&amp;k=ad6bfd5224ff25719314ce19a656db21&amp;t=1237475597&amp;noupdate=yes" h="381" w="505" Y="3609" X="216" outfunc="null" initialized="true">
            <div class=t_attach id=aimg_391_menu style="DISPLAY: none; Z-INDEX: 999; LEFT: 216px; CLIP: rect(auto auto auto auto); POSITION: absolute; TOP: 3567px" h="42" w="142" initialized="true" ctrlkey="aimg_391"><a title=8.gif href="http://dreams8.com/attachment.php?aid=391&amp;k=ad6bfd5224ff25719314ce19a656db21&amp;t=1237475597&amp;nothumb=yes" target=_blank><strong><u><font color=#0000ff>下载</font></u></strong></a> (15.11 KB)<br>
            <div class=t_smallfont>2007-1-28 07:50 PM</div>
            </div>
            <br><br>　　08、这步是有关卸载程序的相关信息，如卸载时的提示、卸载的图标等，如图9。 <span id=attach_392 onmouseover="showMenu(this.id, 0, 1)" style="DISPLAY: none; POSITION: absolute"><img src="http://dreams8.com/images/default/attachimg.gif" border=0></span> <img class="" id=aimg_392 style="CURSOR: pointer" onclick="zoom(this, this.src)" alt=9.gif src="http://dreams8.com/attachment.php?aid=392&amp;k=40c40cc60b94ab685e3f05c3420e015d&amp;t=1237475597&amp;noupdate=yes" width=505 unselectable="true" status="2" file="attachment.php?aid=392&amp;k=40c40cc60b94ab685e3f05c3420e015d&amp;t=1237475597&amp;noupdate=yes" h="381" w="505" Y="4033" X="216" outfunc="null" initialized="true">
            <div class=t_attach id=aimg_392_menu style="DISPLAY: none; Z-INDEX: 999; LEFT: 216px; CLIP: rect(auto auto auto auto); POSITION: absolute; TOP: 3991px" h="42" w="142" initialized="true" ctrlkey="aimg_392"><a title=9.gif href="http://dreams8.com/attachment.php?aid=392&amp;k=40c40cc60b94ab685e3f05c3420e015d&amp;t=1237475597&amp;nothumb=yes" target=_blank><strong><u><font color=#0000ff>下载</font></u></strong></a> (16.72 KB)<br>
            <div class=t_smallfont>2007-1-28 07:50 PM</div>
            </div>
            <br><br>　　09、至此完成向导，如图10，钩选&#8220;保存脚本&#8221;、&#8220;转换文件路径到相关路径&#8221;及&#8220;编译脚本&#8221;。 <span id=attach_393 onmouseover="showMenu(this.id, 0, 1)" style="DISPLAY: none; POSITION: absolute"><img src="http://dreams8.com/images/default/attachimg.gif" border=0></span> <img class="" id=aimg_393 style="CURSOR: pointer" onclick="zoom(this, this.src)" alt=10.gif src="http://dreams8.com/attachment.php?aid=393&amp;k=c5a811e5871ad5fe59b7aef725870d49&amp;t=1237475597&amp;noupdate=yes" width=505 unselectable="true" status="2" file="attachment.php?aid=393&amp;k=c5a811e5871ad5fe59b7aef725870d49&amp;t=1237475597&amp;noupdate=yes" h="381" w="505" Y="4457" X="235" outfunc="null" initialized="true">
            <div class=t_attach id=aimg_393_menu style="DISPLAY: none; Z-INDEX: 999; LEFT: 235px; CLIP: rect(auto auto auto auto); POSITION: absolute; TOP: 4415px" h="42" w="142" initialized="true" ctrlkey="aimg_393"><a title=10.gif href="http://dreams8.com/attachment.php?aid=393&amp;k=c5a811e5871ad5fe59b7aef725870d49&amp;t=1237475597&amp;nothumb=yes" target=_blank><strong><u><font color=#0000ff>下载</font></u></strong></a> (17.87 KB)<br>
            <div class=t_smallfont>2007-1-28 07:50 PM</div>
            </div>
            <br><br>　　提示保存脚本路径并自动编译脚本，我们可以按或F9运行安装程序进行预览，向导产生的安装包效果图如图11所示。 <span id=attach_394 onmouseover="showMenu(this.id, 0, 1)" style="DISPLAY: none; POSITION: absolute"><img src="http://dreams8.com/images/default/attachimg.gif" border=0></span> <img class="" id=aimg_394 style="CURSOR: pointer" onclick="zoom(this, this.src)" alt=11.gif src="http://dreams8.com/attachment.php?aid=394&amp;k=4724ee0df389d82ab7e057404718fee7&amp;t=1237475597&amp;noupdate=yes" width=501 unselectable="true" status="2" file="attachment.php?aid=394&amp;k=4724ee0df389d82ab7e057404718fee7&amp;t=1237475597&amp;noupdate=yes" h="358" w="501" Y="4903" X="221" outfunc="null" initialized="true">
            <div class=t_attach id=aimg_394_menu style="DISPLAY: none; Z-INDEX: 999; LEFT: 221px; CLIP: rect(auto auto auto auto); POSITION: absolute; TOP: 4861px" h="42" w="142" initialized="true" ctrlkey="aimg_394"><a title=11.gif href="http://dreams8.com/attachment.php?aid=394&amp;k=4724ee0df389d82ab7e057404718fee7&amp;t=1237475597&amp;nothumb=yes" target=_blank><strong><u><font color=#0000ff>下载</font></u></strong></a> (21.7 KB)<br>
            <div class=t_smallfont>2007-1-28 07:50 PM</div>
            </div>
            <br><br>　　二、修改代码以个性化安装包<br><br>　　10、选择可修改之处。软件LOGO[如图11A]、安装包标题[图11B]、图11C、图12、图13。<br><br>　　图11见上楼　图12如下<br><span id=attach_395 onmouseover="showMenu(this.id, 0, 1)" style="DISPLAY: none; POSITION: absolute"><img src="http://dreams8.com/images/default/attachimg.gif" border=0></span> <img class="" id=aimg_395 style="CURSOR: pointer" onclick="zoom(this, this.src)" alt=12.gif src="http://dreams8.com/attachment.php?aid=395&amp;k=8f94450a88358a0de4cea98ddeb86baf&amp;t=1237475597&amp;noupdate=yes" width=503 unselectable="true" status="2" file="attachment.php?aid=395&amp;k=8f94450a88358a0de4cea98ddeb86baf&amp;t=1237475597&amp;noupdate=yes" h="358" w="503" Y="5404" X="186" outfunc="null" initialized="true">
            <div class=t_attach id=aimg_395_menu style="DISPLAY: none; Z-INDEX: 999; LEFT: 186px; CLIP: rect(auto auto auto auto); POSITION: absolute; TOP: 5362px" h="42" w="142" initialized="true" ctrlkey="aimg_395"><a title=12.gif href="http://dreams8.com/attachment.php?aid=395&amp;k=8f94450a88358a0de4cea98ddeb86baf&amp;t=1237475597&amp;nothumb=yes" target=_blank><strong><u><font color=#0000ff>下载</font></u></strong></a> (19.69 KB)<br>
            <div class=t_smallfont>2007-1-28 07:50 PM</div>
            </div>
            <br>　　图13如下<br><span id=attach_396 onmouseover="showMenu(this.id, 0, 1)" style="DISPLAY: none; POSITION: absolute"><img src="http://dreams8.com/images/default/attachimg.gif" border=0></span> <img class="" id=aimg_396 style="CURSOR: pointer" onclick="zoom(this, this.src)" alt=13.gif src="http://dreams8.com/attachment.php?aid=396&amp;k=2b078e320ba39d9e2387fe6db27399b4&amp;t=1237475597&amp;noupdate=yes" width=503 unselectable="true" status="2" file="attachment.php?aid=396&amp;k=2b078e320ba39d9e2387fe6db27399b4&amp;t=1237475597&amp;noupdate=yes" h="360" w="503" Y="5788" X="186" outfunc="null" initialized="true">
            <div class=t_attach id=aimg_396_menu style="DISPLAY: none; Z-INDEX: 999; LEFT: 186px; CLIP: rect(auto auto auto auto); POSITION: absolute; TOP: 5746px" h="42" w="142" initialized="true" ctrlkey="aimg_396"><a title=13.gif href="http://dreams8.com/attachment.php?aid=396&amp;k=2b078e320ba39d9e2387fe6db27399b4&amp;t=1237475597&amp;nothumb=yes" target=_blank><strong><u><font color=#0000ff>下载</font></u></strong></a> (20.26 KB)<br>
            <div class=t_smallfont>2007-1-28 07:50 PM</div>
            </div>
            &nbsp; &nbsp;<br><br>　　11、修改代码<br><br>　　①、修改软件LOGO：在源代码&#8220; MUI Settings&#8221;后面添加下列代码：<br><br>程序代码
            <div class=blockcode>
            <div id=code0>
            <ol>
                <li>!define MUI_WELCOMEFINISHPAGE_BITMAP "G:\temp\ pwr.bmp" </li>
            </ol>
            </div>
            <em onclick="copycode($('code0'));">复制代码</em></div>
            　　注释：引号内为位图的路径，位图大小大约为165*298<br><br>　　效果图如图14所示<br><span id=attach_397 onmouseover="showMenu(this.id, 0, 1)" style="DISPLAY: none; POSITION: absolute"><img src="http://dreams8.com/images/default/attachimg.gif" border=0></span> <img class="" id=aimg_397 style="CURSOR: pointer" onclick="zoom(this, this.src)" alt=14.gif src="http://dreams8.com/attachment.php?aid=397&amp;k=9255c0a24b7e6649b6c46ce0ed4be739&amp;t=1237475597&amp;noupdate=yes" width=501 unselectable="true" status="2" file="attachment.php?aid=397&amp;k=9255c0a24b7e6649b6c46ce0ed4be739&amp;t=1237475597&amp;noupdate=yes" h="358" w="501" Y="6405" X="186" outfunc="null" initialized="true">
            <div class=t_attach id=aimg_397_menu style="DISPLAY: none; Z-INDEX: 999; LEFT: 186px; CLIP: rect(auto auto auto auto); POSITION: absolute; TOP: 6363px" h="42" w="142" initialized="true" ctrlkey="aimg_397"><a title=14.gif href="http://dreams8.com/attachment.php?aid=397&amp;k=9255c0a24b7e6649b6c46ce0ed4be739&amp;t=1237475597&amp;nothumb=yes" target=_blank><strong><u><font color=#0000ff>下载</font></u></strong></a> (27.46 KB)<br>
            <div class=t_smallfont>2007-1-28 07:50 PM</div>
            </div>
            <br><br>　　②、修改安装包标题，在同上位置添加下列代码：<br><br>程序代码
            <div class=blockcode>
            <div id=code1>
            <ol>
                <li>!define MUI_WELCOMEPAGE_TITLE "\r\n PDF2all 5.35d 汉化版" </li>
            </ol>
            </div>
            <em onclick="copycode($('code1'));">复制代码</em></div>
            　　注释：\r\n为换行标志<br><br>　　效果图上楼如图14所示。<br><br>　　③、修改图11C中的说明，同上位置添加下列代码：<br><br>程序代码
            <div class=blockcode>
            <div id=code2>
            <ol>
                <li>!define MUI_WELCOMEPAGE_TEXT "　　pdf2all是一个转换器的集合，它能转换包括doc2pdf （Word to PDF），xls2pdf （Excel Sheet到PDF），ppt2pdf（PowerPoint到PDF），mdb2pdf （Access到PDF），ps2pdf（PostScript到PDF），pdf2jpg（PDF到JPEG），pdf2bmp（PDF到BMP），pdf2tiff（PDF到TIFF），pdf2eps（PDF到EPS），pdfMerge（合并PDF文件），pdf2ppt（PDF到PowerPoint）。\r\n\r\n　　软件汉化：高芳銮 (Raindy)\r\n\r\n　　$_CLICK" </li>
            </ol>
            </div>
            <em onclick="copycode($('code2'));">复制代码</em></div>
            　　效果图如图14所示。<br><br>　　④、对图12中的修改，在源代码：<br><br>程序代码
            <div class=blockcode>
            <div id=code3>
            <ol>
                <li>ShowInstDetails show <br>
                <li>ShowUnInstDetails show</li>
            </ol>
            </div>
            <em onclick="copycode($('code3'));">复制代码</em></div>
            　　后添加：<br>程序代码
            <div class=blockcode>
            <div id=code4>
            <ol>
                <li>BrandingText "　软件汉化：高芳銮 (Raindy)" </li>
            </ol>
            </div>
            <em onclick="copycode($('code4'));">复制代码</em></div>
            　　效果图如图15所示。 <span id=attach_398 onmouseover="showMenu(this.id, 0, 1)" style="DISPLAY: none; POSITION: absolute"><img src="http://dreams8.com/images/default/attachimg.gif" border=0></span> <img class="" id=aimg_398 style="CURSOR: pointer" onclick="zoom(this, this.src)" alt=15.gif src="http://dreams8.com/attachment.php?aid=398&amp;k=b4c8cb54ee6c928e9bef9a10f08d7f84&amp;t=1237475597&amp;noupdate=yes" width=503 unselectable="true" status="2" file="attachment.php?aid=398&amp;k=b4c8cb54ee6c928e9bef9a10f08d7f84&amp;t=1237475597&amp;noupdate=yes" h="358" w="503" Y="7582" X="221" outfunc="null" initialized="true">
            <div class=t_attach id=aimg_398_menu style="DISPLAY: none; Z-INDEX: 999; LEFT: 221px; CLIP: rect(auto auto auto auto); POSITION: absolute; TOP: 7540px" h="42" w="142" initialized="true" ctrlkey="aimg_398"><a title=15.gif href="http://dreams8.com/attachment.php?aid=398&amp;k=b4c8cb54ee6c928e9bef9a10f08d7f84&amp;t=1237475597&amp;nothumb=yes" target=_blank><strong><u><font color=#0000ff>下载</font></u></strong></a> (19.39 KB)<br>
            <div class=t_smallfont>2007-1-28 07:50 PM</div>
            </div>
            <br>　　⑤、在完成添加&#8220;汉化说明&#8221;，只要在源代码：<br><br>程序代码
            <div class=blockcode>
            <div id=code5>
            <ol>
                <li>; Finish page </li>
            </ol>
            </div>
            <em onclick="copycode($('code5'));">复制代码</em></div>
            　　后添加：<br><br>程序代码
            <div class=blockcode>
            <div id=code6>
            <ol>
                <li>!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\汉化说明.txt" <br>
                <li>!define MUI_FINISHPAGE_SHOWREADME_TEXT "汉化说明" </li>
            </ol>
            </div>
            <em onclick="copycode($('code6'));">复制代码</em></div>
            　　效果所示 <span id=attach_399 onmouseover="showMenu(this.id, 0, 1)" style="DISPLAY: none; POSITION: absolute"><img src="http://dreams8.com/images/default/attachimg.gif" border=0></span> <img class="" id=aimg_399 style="CURSOR: pointer" onclick="zoom(this, this.src)" alt=16.gif src="http://dreams8.com/attachment.php?aid=399&amp;k=b5498eaf41c9cb9c71922095d59bc634&amp;t=1237475597&amp;noupdate=yes" width=503 unselectable="true" status="2" file="attachment.php?aid=399&amp;k=b5498eaf41c9cb9c71922095d59bc634&amp;t=1237475597&amp;noupdate=yes" h="360" w="503" Y="8260" X="186" outfunc="null" initialized="true">
            <div class=t_attach id=aimg_399_menu style="DISPLAY: none; Z-INDEX: 999; LEFT: 186px; CLIP: rect(auto auto auto auto); POSITION: absolute; TOP: 8218px" h="42" w="142" initialized="true" ctrlkey="aimg_399"><a title=16.gif href="http://dreams8.com/attachment.php?aid=399&amp;k=b5498eaf41c9cb9c71922095d59bc634&amp;t=1237475597&amp;nothumb=yes" target=_blank><strong><u><font color=#0000ff>下载</font></u></strong></a> (25.81 KB)<br>
            <div class=t_smallfont>2007-1-28 07:50 PM</div>
            </div>
            <br><br>　　⑥、闪屏界面，可以在源代码中加入下列代码即可：<br><br>　　A、普通效果<br><br>程序代码
            <div class=blockcode>
            <div id=code7>
            <ol>
                <li>Function .onInit <br>
                <li>SetOutPath $TEMP <br>
                <li>File /oname=spltmp.bmp "G:\Temp\Nsisres\splash.bmp" <br>
                <li><br>
                <li>splash::show 2300 $TEMP\spltmp <br>
                <li><br>
                <li>Pop $0 <br>
                <li><br>
                <li>FunctionEnd</li>
            </ol>
            </div>
            <em onclick="copycode($('code7'));">复制代码</em></div>
            　　B、渐隐闪屏<br><br>程序代码
            <div class=blockcode>
            <div id=code8>
            <ol>
                <li>Function .OnInit <br>
                <li>InitPluginsDir <br>
                <li>File /oname=$PLUGINSDIR\splash.bmp "G:\Temp\Nsisres\splash.bmp" <br>
                <li>advsplash::show 1500 800 600 -1 $PLUGINSDIR\splash <br>
                <li>Functionend</li>
            </ol>
            </div>
            <em onclick="copycode($('code8'));">复制代码</em></div>
            　　⑦、背景<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D2%F4%C0%D6">音乐</span>[贯穿安装过程]<br><br>程序代码
            <div class=blockcode>
            <div id=code9>
            <ol>
                <li>Var hmci <br>
                <li>Function .OnInit <br>
                <li>InitPluginsDir <br>
                <li>SetOutPath $PLUGINSDIR <br>
                <li>File "G:\Temp\Nsisres\music.mp3"　　[说明：源MP3的存放路径] <br>
                <li>System::Call msvfw32.<span class=t_tag onclick=tagshow(event) href="tag.php?name=dll">dll</span>::MCIWndCreate(i 0, i 0,i 0x0070, t "$PLUGINSDIR\music.mp3") i .r0 <br>
                <li>SendMessage $0 0x0465 0 "STR:play repeat" <br>
                <li>System::Call user32.dll::ShowWindow(i r0, i 0) <br>
                <li>StrCpy $hmci $0 <br>
                <li>Functionend <br>
                <li><br>
                <li>Section <br>
                <li>;add your codes <br>
                <li>SendMessage $hmci 0x0010 0 0 <br>
                <li>Sectionend</li>
            </ol>
            </div>
            <em onclick="copycode($('code9'));">复制代码</em></div>
            　　后语：<br><br>　　以上仅是NSIS制作安装包最基本的操作，供初学者入门之用，故云&#8220;初级篇&#8221;。希望不会怡笑大方，更希望蓝MM、陈敏毅老大等NSIS<span class=t_tag onclick=tagshow(event) href="tag.php?name=%B8%DF%CA%D6">高手</span>的中高级教程。<br><br><br>　　精品代码　(^-^)<br><br><strong>1、闪屏效果（渐现渐隐）<br></strong><br>程序代码
            <div class=blockcode>
            <div id=code10>
            <ol>
                <li>Function .OnInit <br>
                <li>InitPluginsDir <br>
                <li>File /oname=$PLUGINSDIR\splash.bmp c:\test.bmp <br>
                <li>advsplash::show 1500 800 600 -1 $PLUGINSDIR\splash <br>
                <li>Functionend </li>
            </ol>
            </div>
            <em onclick="copycode($('code10'));">复制代码</em></div>
            　　<br><strong>2、背景音乐1（贯穿安装全过程）</strong><br><br>程序代码
            <div class=blockcode>
            <div id=code11>
            <ol>
                <li>Function .OnInit <br>
                <li>InitPluginsDir <br>
                <li>SetOutPath $PLUGINSDIR <br>
                <li>File "c:\a.mp3" <br>
                <li>System::Call msvfw32.dll::MCIWndCreate(i 0, i 0,i 0x0070, t "$PLUGINSDIR\a.mp3") i .r0 <br>
                <li>SendMessage $0 0x0465 0 "STR:play repeat" <br>
                <li>System::Call user32.dll::ShowWindow(i r0, i 0) <br>
                <li>StrCpy $hmci $0 <br>
                <li>Functionend <br>
                <li><br>
                <li>Section <br>
                <li>;add your codes <br>
                <li>SendMessage $hmci 0x0010 0 0 <br>
                <li>Sectionend</li>
            </ol>
            </div>
            <em onclick="copycode($('code11'));">复制代码</em></div>
            　　<br><strong>3、背景音乐2</strong><br><br>程序代码
            <div class=blockcode>
            <div id=code12>
            <ol>
                <li>Section/Function <br>
                <li>SetOutPath $PLUGINSDIR <br>
                <li>File $WINDIR\MEDIA\chimes.wav <br>
                <li>BgImage::Sound /NOUNLOAD /WAIT "$PLUGINSDIR\chimes.wav" <br>
                <li>BgImage::Clear /NOUNLOAD <br>
                <li>Sectionend/Functionend</li>
            </ol>
            </div>
            <em onclick="copycode($('code12'));">复制代码</em></div>
            　　<br><strong>4、闪屏效果[渐隐]＋背景音乐[全程]</strong><br><br>程序代码
            <div class=blockcode>
            <div id=code13>
            <ol>
                <li>outfile test.<span class=t_tag onclick=tagshow(event) href="tag.php?name=exe">exe</span> <br>
                <li>Var hmci <br>
                <li><br>
                <li>Function .OnInit <br>
                <li>InitPluginsDir <br>
                <li>SetOutPath $PLUGINSDIR <br>
                <li>File "c:\a.mp3" <br>
                <li>System::Call msvfw32.dll::MCIWndCreate(i 0, i 0,i 0x0070, t "$PLUGINSDIR\a.mp3") i .r0 <br>
                <li>SendMessage $0 0x0465 0 "STR:play repeat" <br>
                <li>System::Call user32.dll::ShowWindow(i r0, i 0) <br>
                <li>StrCpy $hmci $0 <br>
                <li><br>
                <li>File /oname=$PLUGINSDIR\splash.bmp c:\test.bmp <br>
                <li>advsplash::show 1500 800 600 -1 $PLUGINSDIR\splash <br>
                <li><br>
                <li>Functionend <br>
                <li><br>
                <li>Section <br>
                <li>;add your codes <br>
                <li>sleep 5000 <br>
                <li>SendMessage $hmci 0x0010 0 0 <br>
                <li>Sectionend </li>
            </ol>
            </div>
            <em onclick="copycode($('code13'));">复制代码</em></div>
            　　<br>5、如何把安装<span class=t_tag onclick=tagshow(event) href="tag.php?name=%D2%B3%C3%E6">页面</span>中的&#8220;<span class=t_tag onclick=tagshow(event) href="tag.php?name=Setup">Setup</span>将安装&#8230;&#8230;&#8221;中的Setup改成别的字<br><br>　　只需在<br><br>程序代码
            <div class=blockcode>
            <div id=code14>
            <ol>
                <li>!insertmacro MUI_PAGE_DIRECTORY</li>
            </ol>
            </div>
            <em onclick="copycode($('code14'));">复制代码</em></div>
            　　前面添加一行<br><br>程序代码
            <div class=blockcode>
            <div id=code15>
            <ol>
                <li>!define MUI_DIRECTORYPAGE_TEXT_TOP "你需要的文字" </li>
            </ol>
            </div>
            <em onclick="copycode($('code15'));">复制代码</em></div>
            　　6、设置了自<span class=t_tag onclick=tagshow(event) href="tag.php?name=%B6%A8%D2%E5">定义</span>安装、卸载图标<br><br>程序代码
            <div class=blockcode>
            <div id=code16>
            <ol>
                <li>!define MUI_ICON "G:\Temp\Nsisres\Win 安装.ico"<br>
                <li>!define MUI_UNICON "G:\Temp\Nsisres\Win 卸载.ico"</li>
            </ol>
            </div>
            <em onclick="copycode($('code16'));">复制代码</em></div>
            </td>
        </tr>
    </tbody>
</table>
</div>
<img src ="http://www.cppblog.com/iniwf/aggbug/77247.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/iniwf/" target="_blank">iniwf</a> 2009-03-19 23:15 <a href="http://www.cppblog.com/iniwf/archive/2009/03/19/77247.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>