程序:多引擎注册表文件转换工具

优质
小牛编辑
134浏览
2023-12-01

把reg2all 用nsDialogs重写了界面,nsDialogs使自定义页面的互动性更强了。

Function nsDialogsPage

        nsDialogs::Create /NOUNLOAD 1018
        Pop $Dialog

        ${If} $Dialog == error
                Abort
        ${EndIf}
;--------------------------------------------
Var /GLOBAL _NS_FR1
Var /GLOBAL _NS_FRB1
Var /GLOBAL _NS_FR2
Var /GLOBAL _NS_FRB2
Var /GLOBAL _NS_RNSI
Var /GLOBAL _NS_RCMD
Var /GLOBAL _NS_RINF1
Var /GLOBAL _NS_RINF2
Var /GLOBAL _NS_CINFT
Var /GLOBAL _NS_CINFW
Var /GLOBAL _NS_RALL
Var /GLOBAL _NS_BREG



Var /GLOBAL _FILEIN
        ${NSD_CreateLabel}                                0        0 100%  9u `输入文件: ` 
        ${NSD_CreateFileRequest}                0 10u 277u 11u ``
                Pop $_NS_FR1
        ${NSD_CreateBrowseButton}         -20u 10u  20u 12u `...`
                Pop $_NS_FRB1
                ${NSD_OnClick} $_NS_FRB1 _GetFile1



        ${NSD_CreateLabel}                                0 25u 100%  9u `输出文件: ` 
        ${NSD_CreateFileRequest}                0 35u 277u 11u ``
                Pop $_NS_FR2
        ${NSD_CreateBrowseButton}         -20u 35u  20u 12u `...`
                Pop $_NS_FRB2


        ${NSD_CreateRadioButton}                0 54u 100% 10u `转换为 .nsi  >> 引擎: reg2nsi (2004-09-29) 作者: 蓝色网际`
                Pop $_NS_RNSI
        ${NSD_CreateRadioButton}                0 65u 100% 10u `转换为 .cmd  >> 引擎: reg2cmd (2007-12-07) 作者: lyh728`
                Pop $_NS_RCMD
        ${NSD_CreateRadioButton}                0 76u 100% 10u `转换为 .inf  >> 引擎: reg2inf (2002-04-24) 作者: kajaa`
                Pop $_NS_RINF1
        ${NSD_CreateRadioButton}                0 87u 100% 10u `转换为 .inf  >> 引擎: reg2inf (2004-07-20) 作者: lyh728改kajaa`
                Pop $_NS_RINF2

        ${NSD_CreateLabel}                          24u 101u  74u  9u `Inf 格式选项:` 

        ${NSD_CreateCheckbox}                 100u 100u  58u 10u "(T)无注释"
                Pop $_NS_CINFT
        ${NSD_CreateCheckbox}                 158u 100u 120u 10u "(W)完整键名(不使用变量)"
                Pop $_NS_CINFW

        ${NSD_CreateLabel}                          24u 112u 100%  9u `lyh728 改 kajaa 版支持 ExpandSZ/MultiSZ,但是对 Hex 转换不是很好` 

        ${NSD_CreateRadioButton}                0 126u 180u 10u `同时转换为四种格式,放到同一目录下`
                Pop $_NS_RALL
                ${NSD_SetState} $_NS_RALL 1
        ${NSD_CreateBrowseButton}        -100u 125u 100u 14u `(R)注册右键菜单`
                Pop $_NS_BREG



        !insertmacro MUI_HEADER_TEXT \
                `Reg2all: a multi engine reg file transform tool. GUI powered by dGBGG.` \
                `多引擎注册表文件转换工具`


        ${If} $Checkbox_State == ${BST_CHECKED}
                ${NSD_Check} $Checkbox
        ${EndIf}
        
        # alternative for the above ${If}:
        #${NSD_SetState} $Checkbox_State

        nsDialogs::Show

FunctionEnd