请把轻狂志网址 www.flighty.cn 加入收藏夹,其他俱为假冒,谨防被骗!赞助请点 这里!找东东请用右边的搜索 ===>
08 2010-02

NSIS脚本:在卸载页面收集信息

作者:不详 | 发布:2010-02-08 | 更新:2010-02-08 | 分类:部署 | Disposition | 热度:
此功能用于在软件卸载时收集相关信息,以便进行后续改进。实现功能如图:



以下为实现代码:

OutFile "Test.EXE"
Name "Test"
!include "MUI2.nsh"
BrandingText "轻狂志www.flighty.cn"

Page custom ReportPageShow ReportPageLeave

!insertmacro MUI_LANGUAGE "SimpChinese"

Var Dialog
Var Label1
Var Label2
Var Checkbox1
Var Checkbox2
Var Checkbox3
Var Checkbox4
Var Checkbox5
Var Checkbox6
Var Text
Section
SectionEnd
Function ReportPageShow
nsDialogs::Create /NOUNLOAD 1018
Pop $Dialog

${NSD_Createlabel} 0u 0u -1u 20u "很遗憾您选择卸载傲游,请告诉我们您卸载的原因。这将帮助我们以后进行改进:"
Pop $Label1
SetCtlColors $Label1 0x0080FF transparent

${NSD_Createcheckbox} 0u 25u -1u 10u "它经常崩溃"
Pop $Checkbox1

${NSD_Createcheckbox} 0u 40u -1u 10u "它经常假死"
Pop $Checkbox2
${NSD_Createcheckbox} 0u 55u -1u 10u "它显示一些网页不正确"
Pop $Checkbox3
${NSD_Createcheckbox} 0u 70u -1u 10u "它缺少我需要的功能"
Pop $Checkbox4
${NSD_Createcheckbox} 0u 85u -1u 10u "我喜欢上其它浏览器了,请在下边注明"
Pop $Checkbox5
${NSD_Createcheckbox} 0u 100u -1u 10u "升级傲游[Maxthon]"
Pop $Checkbox6
${NSD_Createlabel} 0u 115u -1u 10u "其它原因, 请在下边写入:"
Pop $Label2
${NSD_Createtext} 0u 125u -1u -126u ""
Pop $Text
nsDialogs::Show

FunctionEnd

Function ReportPageLeave
    ${NSD_GetText} $Text $R0
    StrCpy $R1 ""
    ${NSD_GetState} $Checkbox1 $R2
    StrCpy $R1 "$R1$R2"
    ${NSD_GetState} $Checkbox2 $R2
    StrCpy $R1 "$R1$R2"
    ${NSD_GetState} $Checkbox3 $R2
    StrCpy $R1 "$R1$R2"
    ${NSD_GetState} $Checkbox4 $R2
    StrCpy $R1 "$R1$R2"
    ${NSD_GetState} $Checkbox5 $R2
    StrCpy $R1 "$R1$R2"
    ${NSD_GetState} $Checkbox6 $R2
    StrCpy $R1 "$R1$R2"
    MessageBox MB_OK '结果:勾选题:$R1;文本题:"$R0"'

;通过PHP获取$R1_$R0参数分析结果。
FunctionEnd

标签:卸载(16)NSIS(49)收集(1)信息(1)