﻿<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>学习日记 &#187; nsis</title>
	<atom:link href="https://www.softwareace.cn/?cat=105&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>https://www.softwareace.cn</link>
	<description>时刻想着为自己的产品多做一些对他好的事情</description>
	<lastBuildDate>Fri, 20 Mar 2026 06:58:28 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>NSetup一键自动升级安装包制作</title>
		<link>https://www.softwareace.cn/?p=1799</link>
		<comments>https://www.softwareace.cn/?p=1799#comments</comments>
		<pubDate>Fri, 19 Nov 2021 05:22:42 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[nsis]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=1799</guid>
		<description><![CDATA[您是否在为新产品没有安装包或者自动升级而发愁？ 是否因为目前已有安装不稳定，不支持美化或者频繁被杀毒误报等而苦 [&#8230;]]]></description>
				<content:encoded><![CDATA[<p style="color: #222222;">您是否在为新产品没有安装包或者自动升级而发愁？<br />
是否因为目前已有安装不稳定，不支持美化或者频繁被杀毒误报等而苦恼？<br />
一切交给NSetup解决方案来处理，您专心做产品，专业的人做专业的事，</p>
<p style="color: #222222;">安装升级这种后勤工作交给NSetup，辅助您一路前行！</p>
<p style="color: #222222;">
<p style="color: #222222;"><span style="color: #d35400;"><span style="font-weight: bolder;">NSetup一键自动升级安装包制作</span></span><br />
官方网站<a style="color: #2378ff;" href="https://support.qq.com/products/341558/faqs/106125" target="_blank">https://www.nsetup.cn</a></p>
<p style="color: #222222;"><span style="font-weight: bolder;">专业提供美化安装，增量升级，数据统计等服务</span></p>
<p style="color: #222222;"><img src="https://img.alicdn.com/imgextra/i3/822827686/O1CN01fwGofC26eEsOHGtKG_!!822827686.png" alt="O1CN01fwGofC26eEsOHGtKG_!!822827686.png" /></p>
<p style="color: #222222;"><span style="font-weight: bolder;">产品卖点</span></p>
<p style="color: #222222;"><span style="font-weight: bolder;">1.产品成熟</span></p>
<p style="color: #222222;">NSetup从2016年一直发布至今，不断收集客户需求和问题，逐步完善产品，使得NSetup成为Windows部署方面，安全稳定高效的解决方案。</p>
<p style="color: #222222;"><span style="font-weight: bolder;">2. 全部脚本源代码</span></p>
<p style="color: #222222;">方案包含全部产品脚本源码，代码高度整理，可自行二次开发和维护，兼容标准NSIS，方便查找资料</p>
<p style="color: #222222;"><img src="https://img.alicdn.com/imgextra/i4/822827686/O1CN01rJ6hpN26eEs8uOj3q_!!822827686.png" alt="O1CN01rJ6hpN26eEs8uOj3q_!!822827686.png" /></p>
<p style="color: #222222;"><span style="font-weight: bolder;">3. 永久授权</span></p>
<p style="color: #222222;">产品永久授权，终身免费升级，订单内问题终身免费售后</p>
<p style="color: #222222;"><span style="font-weight: bolder;">4.交易无风险</span></p>
<p style="color: #222222;">客户可提供自己真实项目，进行打包测试，测试满意后再进行付款，零风险</p>
<p style="color: #222222;"><span style="font-weight: bolder;">5.简单易用，功能强大</span></p>
<p style="color: #222222;">提供一键部署工具，首次配置完，以后一键完成所有操作，简化操作，避免人为错误<br />
复杂设置界化，对于一些常规需求，可以通过NSetup项目设置进项修改，无需了解技术细节<br />
<img src="https://img.alicdn.com/imgextra/i1/822827686/O1CN0137EwYH26eEsOHR1l9_!!822827686.png" alt="O1CN0137EwYH26eEsOHR1l9_!!822827686.png" /></p>
<p style="color: #222222;">
<p style="color: #222222;"><span style="font-weight: bolder;">6. 可自定义二次开发</span></p>
<p style="color: #222222;">界面基于DirectUI技术，支持动画，窗体特效等，可支持各种酷炫界面自定义开发</p>
<p style="color: #222222;"><span style="font-weight: bolder;">7.成员技术背景</span></p>
<p style="color: #222222;">成员大都来自国内头部软件公司，如金山软件等，拥有10年以上开发经验</p>
<p style="color: #222222;">
<p style="color: #222222;"><span style="font-weight: bolder;">部分服务客户展示</span></p>
<p style="color: #222222;"><img src="https://img.alicdn.com/imgextra/i1/822827686/O1CN011vK2KY26eEsHumWdE_!!822827686.png" alt="O1CN011vK2KY26eEsHumWdE_!!822827686.png" /></p>
<p style="color: #222222;">
<h3 style="font-weight: normal; color: #2c2c2c;"><span style="font-weight: bolder;">部分例子展示</span></h3>
<h3 style="font-weight: normal; color: #2c2c2c;">更多可查看官网 <a style="color: #2378ff;" href="https://support.qq.com/products/341558/faqs/106125" target="_blank">https://nsetup.cn/html/products/</a></h3>
<p style="color: #222222;"> <img src="https://img.alicdn.com/imgextra/i1/822827686/TB2A35RdbRkpuFjSspmXXc.9XXa_!!822827686.gif" alt="TB2A35RdbRkpuFjSspmXXc.9XXa_!!822827686.gif" width="582" height="499" /></p>
<p style="color: #222222;"><img src="https://img.alicdn.com/imgextra/i1/822827686/TB2z5ZLc4XkpuFjy0FiXXbUfFXa_!!822827686.gif" alt="TB2z5ZLc4XkpuFjy0FiXXbUfFXa_!!822827686.gif" width="583" height="432" /></p>
<p style="color: #222222;"><img src="https://img.alicdn.com/imgextra/i2/822827686/TB2c17YcYVkpuFjSspcXXbSMVXa_!!822827686.gif" alt="TB2c17YcYVkpuFjSspcXXbSMVXa_!!822827686.gif" width="621" height="418" /></p>
<p style="color: #222222;">
<p style="color: #222222;"> <img src="https://img.alicdn.com/imgextra/i2/822827686/TB2WPMUcYXlpuFjy1zbXXb_qpXa_!!822827686.gif" alt="TB2WPMUcYXlpuFjy1zbXXb_qpXa_!!822827686.gif" width="618" height="416" /></p>
<p style="color: #222222;"><img src="https://img.alicdn.com/imgextra/i2/822827686/TB2OeMRc3xlpuFjSszbXXcSVpXa_!!822827686.gif" alt="TB2OeMRc3xlpuFjSszbXXcSVpXa_!!822827686.gif" width="521" height="329" /></p>
<p style="color: #222222;"><img src="https://img.alicdn.com/imgextra/i2/822827686/TB2th9Mdm0jpuFjy0FlXXc0bpXa_!!822827686.gif" alt="TB2th9Mdm0jpuFjy0FlXXc0bpXa_!!822827686.gif" width="563" height="707" /></p>
<p style="color: #222222;"> <img src="https://img.alicdn.com/imgextra/i3/822827686/TB2Idz9XX95V1Bjy0FbXXawipXa_!!822827686.gif" alt="TB2Idz9XX95V1Bjy0FbXXawipXa_!!822827686.gif" width="508" height="674" /></p>
<p style="color: #222222;">
<p style="color: #222222;"><img src="https://img.alicdn.com/imgextra/i1/822827686/TB2cO1Sdl8lpuFjy0FnXXcZyXXa_!!822827686.gif" alt="TB2cO1Sdl8lpuFjy0FnXXcZyXXa_!!822827686.gif" width="764" height="414" /></p>
<p style="color: #222222;"><img src="https://img.alicdn.com/imgextra/i4/822827686/TB2G5Y8Xae5V1BjSspkXXcoqpXa_!!822827686.gif" alt="TB2G5Y8Xae5V1BjSspkXXcoqpXa_!!822827686.gif" width="690" height="705" /></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=1799</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>安装net.framework4产生阻滞的问题: 前一次安装要求重新启动计算机</title>
		<link>https://www.softwareace.cn/?p=1605</link>
		<comments>https://www.softwareace.cn/?p=1605#comments</comments>
		<pubDate>Fri, 10 Mar 2017 08:56:51 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[nsis]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=1605</guid>
		<description><![CDATA[安装net.framework4时出现对话框： “产生阻滞的问题: 前一次安装要求重新启动计算机，所以安装程序 [&#8230;]]]></description>
				<content:encoded><![CDATA[<p style="color: #666666;">安装net.framework4时出现对话框：</p>
<p style="color: #666666;">“产生阻滞的问题: 前一次安装要求重新启动计算机，所以安装程序无法继续。请重新启动计算机，然后重新运行。”</p>
<p style="color: #666666;">按照要求重启电脑后还是出现以上提示，具体如何解决呢？方法如下。</p>
<p style="color: #666666;">打开控制面板——将右上角的查看方式改为“大图标”——打开windows update——打开更新设置——改成更新是提醒自己选择更新——在更新中点击立即重启电脑。</p>
<p style="color: #666666;">重启电脑后再安装net4就没问题了。</p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=1605</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NSetup  一键自动升级安装包制作</title>
		<link>https://www.softwareace.cn/?p=1533</link>
		<comments>https://www.softwareace.cn/?p=1533#comments</comments>
		<pubDate>Wed, 02 Nov 2016 06:48:02 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[nsis]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=1533</guid>
		<description><![CDATA[官方网站：https://nsetup.cn/index.html NSetup(一键自动升级安装包制作)是一 [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>官方网站</strong>：<a href="https://nsetup.cn/index.html" target="_blank">https://nsetup.cn/index.html</a></p>
<p><span style="color: #1a1aa6;">NSetup(一键自动升级安装包制作)是一款专业的安装程序制作软件, 目前有很多大型软件在基于NSetup进行部署，包括大型网络软件，银行项目，部队系统等，主要特点:一键部署安装和升级，逻辑基于NSIS，脚本源码级别方便客户自己二次开发维护, 界面支持各种酷炫动效。</span></p>
<p>&nbsp;</p>
<p><img src="https://nsetup.cn/uploads/210407/1-21040G1441N61.png" alt="" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=1533</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>115浏览器 NSIS源代码 A版</title>
		<link>https://www.softwareace.cn/?p=1426</link>
		<comments>https://www.softwareace.cn/?p=1426#comments</comments>
		<pubDate>Wed, 13 Jan 2016 05:32:51 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[nsis]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=1426</guid>
		<description><![CDATA[[crayon-69dc0a5dc3270576478845/] &#160;]]></description>
				<content:encoded><![CDATA[<p></p><pre class="crayon-plain-tag">/*
    Compile the script to use the Unicode version of NSIS
    The producers：surou
*/
;ExecShell taskbarunpin "$DESKTOP\${PRODUCT_NAME}.lnk"是删除任务栏图标

;安装包 解压空白
!system '&gt;blank set/p=MSCF&lt;nul'
!packhdr temp.dat 'cmd /c Copy /b temp.dat /b +blank&amp;&amp;del blank'

;定义变量
Var Dialog
Var MessageBoxHandle
Var installPath
Var FreeSpaceSize

; 安装程序初始定义常量
!define PRODUCT_VERSION "2016.01.11.000"
!define MAIN_APP_NAME "GoogleTranslate.exe"
!define PRODUCT_NAME "Google Translate"
!define PRODUCT_NAME_EN "Google Translate"
!define PRODUCT_PUBLISHER "aceui"
!define PRODUCT_WEB_SITE "http://www.aceui.cn"
!define PRODUCT_2345WEB_SITE "http://www.2345.com/?k652511569"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\${MAIN_APP_NAME}"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_AUTORUN_KEY "Software\Microsoft\Windows\CurrentVersion\Run"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define MUI_ICON "resouce\115Browser\app.ico"
!define MUI_UNICON "resouce\115Browser\app.ico"
!define UNINSTALL_DIR "$TEMP\ACEUI\aceuiStep"
;刷新关联图标
!define SHCNE_ASSOCCHANGED 0x08000000
!define SHCNF_IDLIST 0
; 安装不需要重启
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
; 设置文件覆盖标记
SetOverwrite on
; 设置压缩选项
SetCompress auto
; 选择压缩方式
SetCompressor /SOLID lzma
SetCompressorDictSize 32
; 设置数据块优化
SetDatablockOptimize on
; 设置在数据中写入文件时间
SetDateSave on
;设置Unicode 编码 3.0以上版本支持
Unicode false
; 是否允许安装在根目录下
AllowRootDirInstall false
Name "${PRODUCT_NAME}"
OutFile "output\115Browser.exe"
InstallDir "$PROGRAMFILES\Google Translate"
InstallDirRegKey HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
;Request application privileges for Windows Vista
RequestExecutionLevel admin
;文件版本声明-开始
VIProductVersion ${PRODUCT_VERSION}
VIAddVersionKey /LANG=2052 "ProductName" "Google Translate"
VIAddVersionKey /LANG=2052 "Comments" "Google Translate"
VIAddVersionKey /LANG=2052 "CompanyName" "Aceui"
VIAddVersionKey /LANG=2052 "LegalTrademarks" "Google Translate"
VIAddVersionKey /LANG=2052 "LegalCopyright" "Google Translate."
VIAddVersionKey /LANG=2052 "FileDescription" "Google Translate install"
VIAddVersionKey /LANG=2052 "FileVersion" ${PRODUCT_VERSION}
;文件版本声明-结束

; 引入的头文件
!include  "MUI.nsh"
!include "FileFunc.nsh"
;Languages 
!insertmacro MUI_LANGUAGE "SimpChinese"
;初始化数据

; 安装和卸载页面
Page         custom     InstallProgress
Page         instfiles  "" InstallShow
UninstPage   custom     un.UninstallProgress
UninstPage   instfiles	""	un.UninstallNow
Function .onInit
 ;创建互斥防止重复运行
  System::Call 'kernel32::CreateMutexA(i 0, i 0, t "ACEUIInstall") i .r1 ?e'
  Pop $R0
  StrCmp $R0 0 +3
    MessageBox MB_OK|MB_ICONEXCLAMATION "有一个 Google Translate 安装向导已经运行！"
    Abort

  KillProcDLL::KillProc "${MAIN_APP_NAME}"     ;强制结束进程

  SetOutPath "${UNINSTALL_DIR}"
  File /r /x *.db ".\resouce\115Browser\*.*"
  ;初始化数据  安装目录
 
  ReadRegStr $installPath HKLM "SOFTWARE\aceui\115browser" "installDir"
  ${If} $installPath == ""
    ;初始化安装位置 $APPDATA
    StrCpy $installPath "$PROGRAMFILES\Google Translate"
  ${EndIf}
FunctionEnd

Function InstallProgress
   nsSkinEngine::InitNSISSkinEngine /NOUNLOAD "${UNINSTALL_DIR}" "InstallPackages.xml" "WizardTab" "false" "115浏览器" "7B4D2AD97EC46776D7504B1F501B17483E5EFD52B3BA9E8BE9D6401E4F742E19B822CC7DDF6FC224A5D8AAFB9FFC899B" "app.ico" "true"
   Pop $Dialog
   ;初始化MessageBox窗口
   nsSkinEngine::InitNSISMessageBox "MessageBox.xml" "TitleLab" "TextLab" "CloseBtn" "YESBtn" "NOBtn"
   Pop $MessageBoxHandle
   
   ;关闭按钮绑定函数
   nsSkinEngine::FindControl "InstallTab_sysCloseBtn"
   Pop $0
   ${If} $0 == "-1"
    MessageBox MB_OK "Do not have InstallTab_sysCloseBtn"
   ${Else}
    GetFunctionAddress $0 OnInstallCancelFunc
    nsSkinEngine::OnControlBindNSISScript "InstallTab_sysCloseBtn" $0
   ${EndIf}

   ;------------------------安装界面-----------------------

    ;安装路径编辑框设定数据
   nsSkinEngine::FindControl "InstallTab_InstallFilePath"
   Pop $0
   ${If} $0 == "-1"
    MessageBox MB_OK "Do not have InstallTab_InstallFilePath"
   ${Else}
   
    GetFunctionAddress $0 OnTextChangeFunc
    nsSkinEngine::OnControlBindNSISScript "InstallTab_InstallFilePath" $0
    nsSkinEngine::SetControlData "InstallTab_InstallFilePath" $installPath "text"
    Call OnTextChangeFunc
   ${EndIf}

   ;安装路径浏览按钮绑定函数
   nsSkinEngine::FindControl "InstallTab_SelectFilePathBtn"
   Pop $0
   ${If} $0 == "-1"
    MessageBox MB_OK "Do not have InstallTab_SelectFilePathBtn button"
   ${Else}
    GetFunctionAddress $0 OnInstallPathBrownBtnFunc    
        nsSkinEngine::OnControlBindNSISScript "InstallTab_SelectFilePathBtn"  $0
   ${EndIf}
   
	;展开自定义选项
   nsSkinEngine::FindControl "CustomOptionsCheckBox"
   ${If} $0 == "-1"
    MessageBox MB_OK "Do not have CustomOptionsCheckBox"
   ${Else}
    GetFunctionAddress $0 OnCheckChanged    
        nsSkinEngine::OnControlBindNSISScript "CustomOptionsCheckBox"  $0
   ${EndIf}
   
   ;是否同意
   nsSkinEngine::FindControl "acceptCheckBox"
   ${If} $0 == "-1"
    MessageBox MB_OK "Do not have acceptCheckBox"
   ${Else}
    GetFunctionAddress $0 acceptCheckChangedFunc    
        nsSkinEngine::OnControlBindNSISScript "acceptCheckBox"  $0
   ${EndIf}
   
   ;使用协议
   nsSkinEngine::FindControl "acceptBtn"
   Pop $0
   ${If} $0 == "-1"
    MessageBox MB_OK "Do not have acceptBtn button"
   ${Else}
    GetFunctionAddress $0 acceptPageFunc    
        nsSkinEngine::OnControlBindNSISScript "acceptBtn"  $0
   ${EndIf}
   
   ;使用协议确定
   nsSkinEngine::FindControl "okAcceptBtn"
   Pop $0
   ${If} $0 == "-1"
    MessageBox MB_OK "Do not have okAcceptBtn button"
   ${Else}
    GetFunctionAddress $0 acceptOkFunc    
        nsSkinEngine::OnControlBindNSISScript "okAcceptBtn"  $0
   ${EndIf}
   
   ;开始安装按钮绑定函数
   nsSkinEngine::FindControl "InstallBtn"
   Pop $0
   ${If} $0 == "-1"
    MessageBox MB_OK "Do not have InstallBtn button"
   ${Else}
    GetFunctionAddress $0 InstallPageFunc    
        nsSkinEngine::OnControlBindNSISScript "InstallBtn"  $0
   ${EndIf}
   ;--------------------------------------完成页面----------------------------------
   nsSkinEngine::FindControl "CompleteTab_CompleteBtn"
   Pop $0
   ${If} $0 == "-1"
    MessageBox MB_OK "Do not have CompleteTab_CompleteBtn button"
   ${Else}
    GetFunctionAddress $0 OnCompleteBtnFunc    
        nsSkinEngine::OnControlBindNSISScript "CompleteTab_CompleteBtn"  $0
   ${EndIf}
   ;--------------------------------------窗体显示-----------------------------------
   Call OnCheckChanged
   nsSkinEngine::SetControlData "defaultAppCheckBox"  "true"  "Checked"
   nsSkinEngine::SetControlData "acceptCheckBox"  "true"  "Checked"
   nsSkinEngine::SetControlData "deskShortCheckBox"  "true"  "Checked"
   nsSkinEngine::SetControlData "2345CheckBox"  "true"  "Checked"
   nsSkinEngine::SetControlData "autoCheckBox"  "true"  "Checked"
   nsSkinEngine::SetControlData "userFuckCheckBox"  "true"  "Checked"
   nsSkinEngine::RunNSISSkinEngine
FunctionEnd

Function OnNextBtnFunc
   nsSkinEngine::NSISSendMessage $Dialog WM_NSISNEXT
FunctionEnd

Function OnInstallCancelFunc
    nsSkinEngine::ExitNSISSkinEngine
FunctionEnd

Function UpdateFreeSpace
  ${GetRoot} $INSTDIR $0
  StrCpy $1 "Bytes"

  System::Call kernel32::GetDiskFreeSpaceEx(tr0,*l,*l,*l.r0)
   ${If} $0 &gt; 1024
   ${OrIf} $0 &lt; 0
      System::Int64Op $0 / 1024
      Pop $0
      StrCpy $1 "KB"
      ${If} $0 &gt; 1024
      ${OrIf} $0 &lt; 0
     System::Int64Op $0 / 1024
     Pop $0
     StrCpy $1 "MB"
     ${If} $0 &gt; 1024
     ${OrIf} $0 &lt; 0
        System::Int64Op $0 / 1024
        Pop $0
        StrCpy $1 "GB"
     ${EndIf}
      ${EndIf}
   ${EndIf}

   StrCpy $FreeSpaceSize  "$0$1"
FunctionEnd

Function FreshInstallDataStatusFunc
    ;更新磁盘空间文本显示
   nsSkinEngine::FindControl "InstallTab_FreeSpace"
   Pop $0
   ${If} $0 == "-1"
    MessageBox MB_OK "Do not have InstallTab_FreeSpace"
   ${Else}
    nsSkinEngine::SetControlData "InstallTab_FreeSpace"  $FreeSpaceSize  "text"
   ${EndIf}
   ;路径是否合法（合法则不为0Bytes）
   ${If} $FreeSpaceSize == "0Bytes"
    nsSkinEngine::SetControlData "InstallTab_InstallBtn" "false" "enable"
   ${Else}
    nsSkinEngine::SetControlData "InstallTab_InstallBtn" "true" "enable"
   ${EndIf}
FunctionEnd

Function OnTextChangeFunc
   ; 改变可用磁盘空间大小
   nsSkinEngine::GetControlData InstallTab_InstallFilePath "text"
   Pop $0
   ;MessageBox MB_OK $0
   StrCpy $INSTDIR $0

   ;重新获取磁盘空间
   Call UpdateFreeSpace
   Call FreshInstallDataStatusFunc
FunctionEnd

Function OnInstallPathBrownBtnFunc
   nsSkinEngine::GetControlData "InstallTab_InstallFilePath" "text" ;
   Pop $installPath
   nsSkinEngine::SelectFolderDialog "请选择文件夹" $installPath
   Pop $installPath

   StrCpy $0 $installPath
   ${If} $0 == "-1"
   ${Else}
      StrCpy $INSTDIR "$installPath\${PRODUCT_NAME_EN}"
      ;设置安装路径编辑框文本
      nsSkinEngine::FindControl "InstallTab_InstallFilePath"
      Pop $0
      ${If} $0 == "-1"
     MessageBox MB_OK "Do not have Wizard_InstallPathBtn4Page2 button"
      ${Else}
     ;nsSkinEngine::SetText2Control "InstallTab_InstallFilePath"  $installPath
     StrCpy $installPath $INSTDIR
     nsSkinEngine::SetControlData "InstallTab_InstallFilePath"  $installPath  "text"
      ${EndIf}
   ${EndIf}

   ;重新获取磁盘空间
   Call UpdateFreeSpace
   Call FreshInstallDataStatusFunc
FunctionEnd

Function OnCheckChanged
    nsSkinEngine::GetControlData "CustomOptionsCheckBox" "Checked" ;
    Pop $0
    ${If} $0 == "1"
	nsSkinEngine::NSISResize "445" "608"
	nsSkinEngine::SetControlData "customVer"  "true"  "visible"
	${Else}
	nsSkinEngine::NSISResize "445" "462"
	nsSkinEngine::SetControlData "customVer"  "false"  "visible"
	${EndIf}
FunctionEnd

Function acceptCheckChangedFunc
	nsSkinEngine::GetControlData "acceptCheckBox" "Checked" ;
    Pop $0
    ${If} $0 == "1"
		nsSkinEngine::SetControlData "InstallBtn"  "true"  "enable"
	${Else}
		nsSkinEngine::SetControlData "InstallBtn"  "false"  "enable"
    ${EndIf}
FunctionEnd

Function acceptPageFunc
	nsSkinEngine::SetControlData "windowbk"  "1"  "TabCurrentIndexInt"
	nsSkinEngine::ShowLicense "acceptInfo" "license.txt"
FunctionEnd

Function acceptOkFunc
	nsSkinEngine::SetControlData "windowbk"  "0"  "TabCurrentIndexInt"
FunctionEnd

Function InstallPageFunc
    nsSkinEngine::SetControlData "InstallTab_sysCloseBtn"  "false"  "enable"
	nsSkinEngine::NSISResize "445" "462"
	nsSkinEngine::SetControlData "customVer"  "false"  "visible"
    Call OnNextBtnFunc
    ;设置进度条
    nsSkinEngine::SetControlData "CompleteTab_RunAppCheckBox"  "true" "Checked" ;默认勾选运行程序
    nsSkinEngine::FindControl "InstallProgressBar"
      Pop $0
      ${If} $0 == "-1"
     MessageBox MB_OK "Do not have InstallProgressBar"
      ${Else}
     nsSkinEngine::SetControlData "InstallProgressBar"  "0"  "ProgressInt"
     nsSkinEngine::SetControlData "progressText"  "0%"  "text"
     nsSkinEngine::NSISStopMsgLoop
     ${EndIf} 
FunctionEnd

Function InstallShow
     nsSkinEngine::FindControl "InstallProgressBar"
      Pop $0
      ${If} $0 == "-1"
     MessageBox MB_OK "Do not have InstallProgressBar"
      ${Else}
     nsSkinEngine::NSISBindingProgress "InstallProgressBar" "progressText"
	 ${EndIf}
FunctionEnd

Section InstallFiles
  SetOutPath "$INSTDIR"
  SetOverwrite ifnewer
  File /r "bin\*.*"
SectionEnd

Section RegistKeys
    WriteUninstaller "$INSTDIR\uninst.exe"
    WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\${MAIN_APP_NAME}"
    WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
    WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
    WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\${MAIN_APP_NAME},0"
    WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
    WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
    WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd

Section CreateShorts
    WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
    SetShellVarContext all
    ;创建开始菜单快捷方式
    CreateDirectory "$SMPROGRAMS\Google Translate"
    CreateShortCut "$SMPROGRAMS\Google Translate\${PRODUCT_NAME}.lnk" "$INSTDIR\${MAIN_APP_NAME}"
    CreateShortCut "$SMPROGRAMS\Google Translate\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
    CreateShortCut "$SMPROGRAMS\Google Translate\Uninstall.lnk" "$INSTDIR\uninst.exe"
    SetOverwrite ifnewer
	nsSkinEngine::GetControlData "deskShortCheckBox" "Checked" ;
    Pop $0
    ${If} $0 == "1"
      ;创建桌面快捷方式
		CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\${MAIN_APP_NAME}"
    ${EndIf}
    
/* 	CreateShortCut "$QUICKLAUNCH\${PRODUCT_NAME}.lnk" "$INSTDIR\${MAIN_APP_NAME}"
	System::Call 'shell32.dll::ShellExecute(i 0, t "taskbarpin", t "$QUICKLAUNCH\${PRODUCT_NAME}.lnk", i 0, i 0, i 0)  i .r1 ?e' */
    Call RefreshShellIcons
SectionEnd

Section Finish
	nsSkinEngine::SetControlData "InstallTab_sysCloseBtn"  "true"  "enable"
	nsSkinEngine::GetControlData "2345CheckBox" "Checked" ;
    Pop $0
    ${If} $0 == "1"
      ;设置浏览器首页
		WriteRegStr HKCU "Software\Microsoft\Internet Explorer\Main" "Start Page" "${PRODUCT_2345WEB_SITE}"
    ${EndIf}
SectionEnd

Function OnCompleteBtnFunc
    nsSkinEngine::HideNSISSkinEngine
    nsSkinEngine::StopAnimationBkControl
    nsSkinEngine::GetControlData "autoCheckBox" "Checked" ;
    Pop $0
    ${If} $0 == "1"
      WriteRegStr HKCU "${PRODUCT_AUTORUN_KEY}" "${PRODUCT_NAME}" "$INSTDIR\${MAIN_APP_NAME} -mini"
    ${EndIf}
	
    Exec '"$INSTDIR\${MAIN_APP_NAME}"'
    nsSkinEngine::ExitNSISSkinEngine "false"
FunctionEnd


Function un.accept
  nsSkinEngine::NSISSendMessage $Dialog WM_NSISOPENURL "http://www.aceui.cn/";
FunctionEnd
;-----------------------------------------------------------------------------------------------------------------------------

Function un.onInit
  ;创建互斥防止重复运行
  System::Call 'kernel32::CreateMutexA(i 0, i 0, t "aceuiUnInstall") i .r1 ?e'
  Pop $R0
  StrCmp $R0 0 +3
    MessageBox MB_OK|MB_ICONEXCLAMATION "有一个 115浏览器 卸载向导已经运行！"
    Abort

  SetOutPath "${UNINSTALL_DIR}"
  File /r /x *.db ".\resouce\115Browser\*.*"
  
  KillProcDLL::KillProc "${MAIN_APP_NAME}"     ;强制结束进程
FunctionEnd

Function un.UninstallProgress
    nsSkinEngine::InitNSISSkinEngine /NOUNLOAD "${UNINSTALL_DIR}" "UninstallPackages.xml" "WizardTab" "false" "115浏览器" "7B4D2AD97EC46776D7504B1F501B17483E5EFD52B3BA9E8BE9D6401E4F742E19B822CC7DDF6FC224A5D8AAFB9FFC899B" "app.ico" "true"
   Pop $Dialog
   ;初始化MessageBox窗口
   nsSkinEngine::InitNSISMessageBox "MessageBox.xml" "TitleLab" "TextLab" "CloseBtn" "YESBtn" "NOBtn"
   Pop $MessageBoxHandle
   
   ;关闭按钮绑定函数
   nsSkinEngine::FindControl "sysCloseBtn"
   Pop $0
   ${If} $0 == "-1"
    MessageBox MB_OK "Do not have sysCloseBtn"
   ${Else}
    GetFunctionAddress $0 un.OnUnInstallCancelFunc
    nsSkinEngine::OnControlBindNSISScript "sysCloseBtn" $0
   ${EndIf}
   
   ;取消按钮绑定函数
   nsSkinEngine::FindControl "cancelUninstallBtn"
   Pop $0
   ${If} $0 == "-1"
    MessageBox MB_OK "Do not have cancelUninstallBtn"
   ${Else}
    GetFunctionAddress $0 un.OnUnInstallCancelFunc
    nsSkinEngine::OnControlBindNSISScript "cancelUninstallBtn" $0
   ${EndIf}
 
   ;残忍卸载 okUninstallBtn
   nsSkinEngine::FindControl "okUninstallBtn"
   Pop $0
   ${If} $0 == "-1"
    MessageBox MB_OK "Do not have okUninstallBtn"
   ${Else}
    GetFunctionAddress $0 un.UnInstallPageFunc
    nsSkinEngine::OnControlBindNSISScript "okUninstallBtn" $0
   ${EndIf}
   
   ;卸载完成 completeBtn
   nsSkinEngine::FindControl "completeBtn"
   Pop $0
   ${If} $0 == "-1"
    MessageBox MB_OK "Do not have completeBtn"
   ${Else}
    GetFunctionAddress $0 un.OnCompleteBtnFunc
    nsSkinEngine::OnControlBindNSISScript "completeBtn" $0
   ${EndIf}
   
   ;--------------------------------------窗体显示-----------------------------------
   nsSkinEngine::RunNSISSkinEngine
FunctionEnd

Function un.OnUnInstallCancelFunc
     nsSkinEngine::ExitNSISSkinEngine
FunctionEnd

Function un.OnNextBtnFunc
   nsSkinEngine::NSISSendMessage $Dialog WM_NSISNEXT
FunctionEnd

Function un.UnInstallPageFunc
    Call un.OnNextBtnFunc
    nsSkinEngine::NSISStopMsgLoop
FunctionEnd

Function un.UninstallNow
     nsSkinEngine::FindControl "UnInstallProgressBar"
      Pop $0
      ${If} $0 == "-1"
     MessageBox MB_OK "Do not have UnInstallProgressBar"
      ${Else}
     nsSkinEngine::NSISBindingProgress "UnInstallProgressBar" "progressText"
	 ${EndIf}
FunctionEnd

Section "Uninstall"
    # 设置为当前用户
    SetShellVarContext current
    # 设置为所有用户
    SetShellVarContext all

    Delete "$SMPROGRAMS\Google Translate\*.lnk"
    Delete "$SMPROGRAMS\Google Translate\Uninstall.lnk"
    Delete "$SMPROGRAMS\Google Translate\Website.lnk"
    Delete "$SMPROGRAMS\Google Translate\${PRODUCT_NAME}.lnk"
    Delete "$DESKTOP\${PRODUCT_NAME}.lnk"
    RMDir /r /REBOOTOK  "$SMPROGRAMS\Google Translate"
    RMDir /r /REBOOTOK  "$INSTDIR"
	
	DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
    DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
    DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Google Translate"
    DeleteRegValue HKCU "${PRODUCT_AUTORUN_KEY}" "${PRODUCT_NAME}"
    
SectionEnd

Function un.OnCompleteBtnFunc
    nsSkinEngine::HideNSISSkinEngine
    ;Call un.SendStatistics
    ;Call un.DeleteRegKey ;发送完统计再调用删除key,因为发送可能需要某些键值
    nsSkinEngine::ExitNSISSkinEngine
FunctionEnd

;刷新关联图标
Function RefreshShellIcons
  System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v \
  (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
FunctionEnd

Function .onInstSuccess
FunctionEnd</pre><p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=1426</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NSIS 程序互斥函数</title>
		<link>https://www.softwareace.cn/?p=1424</link>
		<comments>https://www.softwareace.cn/?p=1424#comments</comments>
		<pubDate>Fri, 08 Jan 2016 10:00:56 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[nsis]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=1424</guid>
		<description><![CDATA[[crayon-69dc0a5dc3d5e719173285/] &#160;]]></description>
				<content:encoded><![CDATA[<p></p><pre class="crayon-plain-tag">/************************
      CheckMutex.nsi
************************/
;NSIS 安装程序与卸载程序互相检查互斥的例子
;编写：zhfi
#定义自己的互斥名称：#
#注意安：装程序不能与卸载程序相同！#
!define MyMutex_Install     "MyMutex_Install"
!define MyMutex_UnInstall   "MyMutex_UnInstall"

;--------------------------------
;Include Modern UI

!include "MUI.nsh"
!include "LogicLib.nsh"

;--------------------------------
;General

  ;Name and file
  Name "Mutex Test"
  OutFile "Mutex.exe"

;--------------------------------
#添加安装页面：#
  !insertmacro MUI_PAGE_Welcome
  !insertmacro MUI_PAGE_InstFiles
  !insertmacro MUI_PAGE_Finish
#添加卸载页面：#
  !insertmacro MUI_UNPAGE_Welcome
  !insertmacro MUI_UNPAGE_InstFiles
  !insertmacro MUI_UNPAGE_Finish

;--------------------------------
;加入语言文件
 
  !insertmacro MUI_LANGUAGE "SimpChinese"

;--------------------------------
;安装程序部分

Function .onInit
InitPluginsDir
Call CreateMutex
FunctionEnd

Function CreateMutex
#检查安装互斥：#
ReCheck:
  System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${MyMutex_Install}") i .R1 ?e'
Pop $R0
  System::Call 'kernel32::CloseHandle(i R1) i.s'
#检查卸载互斥：#
  System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${MyMutex_UnInstall}") i .R3 ?e'
Pop $R2
  System::Call 'kernel32::CloseHandle(i R3) i.s'
#判断安装/卸载互斥的存在#
${If} $R0 != 0
  MessageBox MB_RetryCancel|MB_ICONEXCLAMATION "安装程序已经运行！" IdRetry ReCheck
Quit
${ElseIf} $R2 != 0
  MessageBox MB_RetryCancel|MB_ICONEXCLAMATION "卸载程序已经运行！" IdRetry ReCheck
Quit
${Else}
#创建安装互斥：#
  System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${MyMutex_Install}") i .R1 ?e'
Pop $R0
  StrCmp $R0 0 +2
Quit
${EndIf}
FunctionEnd

Section Install
  SetOutPath $EXEDIR
  WriteUninstaller "$EXEDIR\Uninstall.exe"
SectionEnd

;--------------------------------
;卸载程序部分

Function un.onInit
InitPluginsDir
Call un.CreateMutex
FunctionEnd

Function Un.CreateMutex
#检查安装互斥：#
ReCheck:
  System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${MyMutex_Install}") i .R1 ?e'
Pop $R0
  System::Call 'kernel32::CloseHandle(i R1) i.s'
#检查卸载互斥：#
CheckUnInstall:
  System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${MyMutex_UnInstall}") i .R3 ?e'
Pop $R2
  System::Call 'kernel32::CloseHandle(i R3) i.s'
#判断安装/卸载互斥的存在#
${If} $R0 != 0
  MessageBox MB_RetryCancel|MB_ICONEXCLAMATION "安装程序已经运行！" IdRetry ReCheck
Quit
${ElseIf} $R2 != 0
  MessageBox MB_RetryCancel|MB_ICONEXCLAMATION "卸载程序已经运行！" IdRetry ReCheck
Quit
${Else}
#创建卸载互斥：#
  System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${MyMutex_UnInstall}") i .R1 ?e'
Pop $R0
  StrCmp $R0 0 +2
Quit
${EndIf}
FunctionEnd

Section Uninstall
  SetOutPath $EXEDIR
  Delete "$EXEDIR\Uninstall.exe"
SectionEnd

#脚本结束！#</pre><p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=1424</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NSIS皮肤插件 nsSkinEngine 免费</title>
		<link>https://www.softwareace.cn/?p=1385</link>
		<comments>https://www.softwareace.cn/?p=1385#comments</comments>
		<pubDate>Wed, 02 Sep 2015 03:08:22 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[nsis]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=1385</guid>
		<description><![CDATA[分享一款NSIS 皮肤插件，功能强大，（duilib二次开发），动画，异性，阴影 API Wiki http: [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>分享一款NSIS 皮肤插件，功能强大，（duilib二次开发），动画，异性，阴影</p>
<p>API Wiki</p>
<p><a href="http://www.aceui.cn/api/index.php" target="_blank">http://www.aceui.cn/api/index.php</a></p><pre class="crayon-plain-tag">所有插件或接口怎么收费?
&nbsp;&nbsp;&nbsp;&nbsp;永久免费！并持续更新。
为什么我使用插件后报错?
&nbsp;&nbsp;&nbsp;&nbsp;插件为U版，请先确认自己的NSIS版本。建议使用例子中的一键打包环境。
插件依赖其他DLL或者环境吗?
&nbsp;&nbsp;&nbsp;&nbsp;插件纯win32 C++编写，互不依赖。</pre><p></p><pre class="crayon-plain-tag">插件下载地址： &lt;a style=&quot;color: #337ab7;&quot; href=&quot;http://pan.baidu.com/s/1eQDBQeA&quot; target=&quot;_blank&quot;&gt;百度网盘&lt;/a&gt;
			例子下载地址： &lt;a style=&quot;color: #337ab7;&quot; href=&quot;http://pan.baidu.com/s/1kTKTmZX&quot; target=&quot;_blank&quot;&gt;百度网盘&lt;/a&gt;</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=1385</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>调试 NSIS 插件</title>
		<link>https://www.softwareace.cn/?p=1320</link>
		<comments>https://www.softwareace.cn/?p=1320#comments</comments>
		<pubDate>Sat, 09 May 2015 08:37:12 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[nsis]]></category>
		<category><![CDATA[win32]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=1320</guid>
		<description><![CDATA[[crayon-69dc0a5dc4177100653797/] &#160;]]></description>
				<content:encoded><![CDATA[<p></p><pre class="crayon-plain-tag">1.dll 入口 写个 messagebox,下一行 设置个断点
2.编译debug 版本
3.复制dll 到 nsis 的plugin 目录
4.编译nsis 得到 exe
5.运行exe 弹出第一步的messagebox
6.vs 附加进程 到 此exe 进程
7.关闭messagebox ,即可进入调试</pre><p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=1320</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 下msvc2010编译 NSIS 2.46</title>
		<link>https://www.softwareace.cn/?p=1287</link>
		<comments>https://www.softwareace.cn/?p=1287#comments</comments>
		<pubDate>Wed, 01 Apr 2015 05:56:37 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[nsis]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=1287</guid>
		<description><![CDATA[按照 NSIS 帮助文档的说法，要构建 NSIS 首先安装 Python 和 SCons。 1、从NSIS 官 [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>按照 NSIS 帮助文档的说法，要构建 NSIS 首先安装 <a style="color: #ff8373;" href="http://www.python.org/" rel="nofollow">Python</a> 和 <a style="color: #ff8373;" href="http://www.scons.org/" rel="nofollow">SCons</a>。</p>
<p>1、从NSIS 官方网站 <a style="color: #ff8373;" href="http://sourceforge.net/projects/nsis/files/" rel="nofollow">http://sourceforge.net/projects/nsis/files/</a> 下载 NSIS 2.46 的源代码 zip 包，解压到 C:\nsis-2.46-src，此次我直接从NSIS的repository checkout源码包。</p>
<p>2、从Python 官方网站 <a style="color: #ff8373;" href="http://www.python.org/getit/" rel="nofollow">http://www.python.org/getit/</a> 下载 Python 2.7.6 安装到 C:\dev\Python27，将此路径添加到系统 PATH 环境变量。</p>
<p>3、从SCons 官方网站 <a style="color: #ff8373;" href="http://sourceforge.net/projects/scons/files/" rel="nofollow">http://sourceforge.net/projects/scons/files/</a> 下载 scons-2.3.0-setup 安装（自动默认到 Python 的子目录），将路径 C:\dev\Python27\Scripts 添加到系统 PATH 环境变量。</p>
<p>4、由于 NSIS 的 Menu 采用 wxWidgets 编写，因此去 wxWidgets 官方网站 <a style="color: #ff8373;" href="http://www.wxwidgets.org/downloads/" rel="nofollow">http://www.wxwidgets.org/downloads/</a> 下载 wxWidgets-2.9.5.zip解压到 C:\dev\wxWidgets。新建环境变量 WXWIN，值为该路径 C:\dev\wxWidgets</p>
<p>5、在进行下一步之前，确定你的系统有MSVC的编译环境，我此次编译使用的是msvc010。</p>
<p>6、进入 NSIS 的 Menu 目录，C:\nsis-2.46-src\Contrib\NSIS Menu\wx，Visual Studio Command Prompt (2010)<span style="color: #ff0000;">命令行</span>下启动 wxbuild.bat，先编译 wxWidgets程序，等待 10 分钟。</p>
<p>7、进入 NSIS 目录 C:\nsis-2.46-src\Contrib\NSIS Menu\，修改 SConscript文件,以下是这个文件的patch</p><pre class="crayon-plain-tag">--- C:/SConscript   星期三 四月 10 17:13:20 2013
+++ C:/nsis-2.46-src/Contrib/NSIS Menu/SConscript   星期四 十一月 28 18:29:30 2013
@@ -13,17 +13,27 @@ resources = Split("""
 rc = 'nsismenu/nsismenu.rc'
  
 libs = Split("""
-   advapi32
-   comctl32
+   kernel32
+   user32
    gdi32
+   comdlg32
+   winspool
+   winmm
    shell32
-   user32
+   comctl32
+   ole32
+   oleaut32
+   uuid
+   rpcrt4
+   advapi32
+   wsock32
+   wininet
 """)
  
 if env['UNICODE']:
-   libs.append(["wxbase29u", "wxmsw29u_core", "wxmsw29u_html"])
+   libs.append(["wxbase29u", "wxmsw29u_core", "wxmsw29u_html", "wxpng", "wxjpeg", "wxtiff", "wxzlib", "wxexpat"])
 else:
-   libs.append(["wxbase29", "wxmsw29_core", "wxmsw29_html"])
+   libs.append(["wxbase29", "wxmsw29_core", "wxmsw29_html", "wxpng", "wxjpeg", "wxtiff", "wxzlib", "wxexpat"])
  
 html = Split("""
    #Menu/index.html</pre><p>8、回到 NSIS 主目录 C:\nsis-2.46-src，撰写一个编译脚本build.bat:</p><pre class="crayon-plain-tag">set ZLIB_W32=C:\dev\zlib-1.2.8
set WXWIN=C:\devfolder\wxWidgets-2.9.5
 
set MSVS_VERSION = 10.0
scons NSIS_CONFIG_LOG=yes NSIS_MAX_STRLEN=8192 dist-zip
pause</pre><p>Visual Studio Command Prompt (2010)<span style="color: #ff0000;">命令行</span>下启动build.bat：等待 5-10 分钟。在 NSIS主目录下会躺着一个 zip 包，就是它了。</p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=1287</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NSIS 自定义安装界面准确获取安装进度完美解决方案,nsis,安装进度条,精准获取进度条</title>
		<link>https://www.softwareace.cn/?p=1266</link>
		<comments>https://www.softwareace.cn/?p=1266#comments</comments>
		<pubDate>Fri, 13 Mar 2015 05:23:34 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[nsis]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=1266</guid>
		<description><![CDATA[[crayon-69dc0a5dc45a9228207661/] &#160;]]></description>
				<content:encoded><![CDATA[<p><img src="http://www.pythonschool.com/uploads/image/201502/011422794669514401.jpg" alt="" /></p><pre class="crayon-plain-tag">几乎所有玩过nsis的人在制作安装进度页面时都会遇到一个比较棘手的问题,画出进度条容易,但准确掌握文件释放进度,同时再去配合进度条的进度在nsis看来几乎是个无法逾越的障碍,因为迄今为止NSIS尚无可直接使用的指令或者函数来获取相关数据。网络上解决这个问题大部分做法都是大约分为若干段,20%...40%...80%...100%这样大概做个进度的样子,其实与释放的文件几乎没什么联系,并且误差非常大,我这个办法可以尽最大可能的让进度条进度与文件释放进度相匹配,脚本里面使用到两个nsis插件:
官方下载:
NSIS7Z plug-in
http://nsis.sourceforge.net/Nsis7z_plug-in
BgWorker plug-in
http://nsis.sourceforge.net/BgWorker_plug-in
将你要封装的文件按照部署的结构用7zip压缩备用
原理:自定义界面设置计数器启动后台线程,然后获取7z插件的回调函数数据。
封装脚本:



Outfile "customProgressBar.exe"
!include nsDialogs.nsh
!define /math PBM_SETRANGE32 ${WM_USER} + 6 #定义nsis未包含的进度条相关常量
InstallDir "C:\test"
page custom custompage
Function custompage
nsDialogs::Create 1018
  Pop $0
  ${NSD_CreateLabel} 100 100 100% 30u "开始安装..."
  Pop $9
  SetCtlColors $9  0x000000 0xECE9D8
  ${NSD_CreateProgressBar} 0 50 100% 20 ""
  Pop $8
  ${NSD_CreateTimer} OnDialogTimer 50 
nsDialogs::Show
FunctionEnd
Function OnDialogTimer
  ${NSD_KillTimer} OnDialogTimer
  SendMessage $8 ${PBM_SETRANGE32} 1 100
  GetFunctionAddress $0 Extractfunc
  BgWorker::CallAndWait #启动一个低优先级的后台线程
FunctionEnd
Function Extractfunc
  SetOutPath $INSTDIR
  File "test.7z"
  GetFunctionAddress $R9 Callback
  Nsis7z::ExtractWithCallback "test.7z" $R9
  Delete "$OUTDIR\test.7z"
FunctionEnd
Function Callback
  Pop $R8
  Pop $R9
  System::Int64Op $R8 * 100
  Pop $R0
  System::Int64Op $R0 / $R9
  Pop $R3
  SendMessage $8 ${PBM_SETPOS} $R3 0
  ${NSD_SetText} $9 "已经安装$R3%"
  ${if} $R8 = $R9
  ${NSD_SetText} $9 "安装完成"
  #由于计算方式的四舍五入特性,进度条到安装完成时会有字节级别的误差,此处消除。
  SendMessage $8 ${PBM_SETPOS} 100 0
  System::Call "user32::InvalidateRect(i$hwndparent,i0,i 1)"
  ${endif}
FunctionEnd
Section
DetailPrint "..."
SectionEnd</pre><p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=1266</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NSIS获取当前屏幕分辨率,nsis,分辨率,屏幕分辨率</title>
		<link>https://www.softwareace.cn/?p=1264</link>
		<comments>https://www.softwareace.cn/?p=1264#comments</comments>
		<pubDate>Fri, 13 Mar 2015 05:21:48 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[nsis]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=1264</guid>
		<description><![CDATA[[crayon-69dc0a5dc4799726105446/] &#160;]]></description>
				<content:encoded><![CDATA[<p></p><pre class="crayon-plain-tag">OutFile "ScreenRes.exe"
Name "Get User Screen Resolution"
Caption "Get User Screen Resolution"
XPStyle "on"
Function ".onInit"
System::Call 'user32::GetSystemMetrics(i 0) i .r0'
System::Call 'user32::GetSystemMetrics(i 1) i .r1'
MessageBox MB_OK|MB_ICONINFORMATION "Screen Resolution: $\r$\n$0 X $1"
Quit
FunctionEnd
Section "-boo"
SectionEnd</pre><p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=1264</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
