程序:reg文件转换为nsi脚本

优质
小牛编辑
148浏览
2023-12-01
reg2nsi 是一个能把注册表文件转换为 NSIS 脚本文件的工具,使用非常简单,只需要一个 reg2nsi.exe 即可,并自动把 \\、\" 、$ 转换为 \、$\"、$$。

命令行
reg2nsi.exe /i:输入文件 [/o:输出文件]
/o 是一个可选项

引用reg2nsi.nsi的内容:

Name                 "Reg2nsi"           
OutFile              "reg2nsi.exe"
BrandingText         "Reg2nsi ${__DATE__}"
ShowInstDetails      show
SetCompressor        lzma
InstallButtonText    "$(INSTALL_BUTTON)"
Caption              "Reg2nsi"

!addplugindir        ".\"
ReserveFile          ".\io.ini"
ReserveFile          ".\InstallOptionsEx.dll"

!include             "MUI.nsh"
!include             "LogicLib.nsh"
!include             "Language.nsi"

	!define MUI_ICON icon.ico
  Page custom SetCustom LeaveCustom
	!define MUI_PAGE_HEADER_TEXT "$(INSTALLING_PAGE_TITLE)"
	!define MUI_PAGE_HEADER_SUBTEXT "$(INSTALLING_PAGE_SUBTITLE)"
  !insertmacro MUI_PAGE_INSTFILES
	
	!insertmacro MUI_LANGUAGE English
  !insertmacro MUI_LANGUAGE SimpChinese

Var HWND
Var IN
Var OUT
Var FE ;File encoding

Section
  GetDlgItem $0 $HWNDPARENT 2 ;允许取消按钮 (Enable cancel button)
	EnableWindow $0 1
	
	SetAutoClose false
	;$1: 文件指针 (File pointer)
	
	StrCmp $IN "" 0 +2
	ReadINIStr $IN $PLUGINSDIR\io.ini "Field 1" "State"
	StrCmp $FE "" 0 file_chk_done
	Push $IN
	Call CheckFileEncoding
	StrCmp $FE "Unicode" file_chk_done
	StrCmp $FE "ANSI" file_chk_done
		HideWindow
		MessageBox MB_OK|MB_ICONINFORMATION "$(FILE_CODING_ERROR1) $0 $(FILE_CODING_ERROR2)"
		Quit
	file_chk_done:
	
	StrCmp $OUT "" 0 +2
	ReadINIStr $OUT $PLUGINSDIR\io.ini "Field 2" "State"
	StrCmp $OUT "" 0 chk_ext
	Push $IN
	Call GetFileNameNoExt
	Pop $0
	StrCpy $OUT "$0.nsi"
	Goto in_out_done
	chk_ext:
	StrCpy $0 $OUT "" -4
	StrCmp $0 ".nsi" in_out_done
	StrCpy $OUT "$OUT.nsi"
	in_out_done:
	Push $OUT
	Call GetParent
	Pop $0
	IfFileExists $0 +2
	CreateDirectory $0
	;Delete $OUT
	
	ReadINIStr $0 $PLUGINSDIR\io.ini "Field 5" "State"
	StrCmp $0 1 0 +2
	StrCpy $6 "$\t"
	
	ReadINIStr $0 $PLUGINSDIR\io.ini "Field 6" "State"
	StrCmp $0 1 0 +2
	StrCpy $6 "  "
	
	StrCpy $1 0
	
	Call Main
SectionEnd

Function .onInit
  InitPluginsDir
	File "/oname=$PLUGINSDIR\io.ini" ".\io.ini"
	
	Call GetParameters
FunctionEnd	

Function SetCustom
	StrCmp $IN "" +2
	Abort
	
	WriteINIStr "$PLUGINSDIR\io.ini" "Field 3" Filter "$(CUSTOM_PAGE_FIELD3)"
	WriteINIStr "$PLUGINSDIR\io.ini" "Field 4" Filter "$(CUSTOM_PAGE_FIELD4)"
	WriteINIStr "$PLUGINSDIR\io.ini" "Field 5" Text "$(CUSTOM_PAGE_FIELD5)"
	WriteINIStr "$PLUGINSDIR\io.ini" "Field 6" Text "$(CUSTOM_PAGE_FIELD6)"
	WriteINIStr "$PLUGINSDIR\io.ini" "Field 7" Text "$(CUSTOM_PAGE_FIELD7)"
	WriteINIStr "$PLUGINSDIR\io.ini" "Field 8" Text "$(CUSTOM_PAGE_FIELD8)"
	
	ReadRegStr $0 HKCR .reg ""
	ReadRegStr $1 HKCR "$0\shell\convert" ""
	StrCmp $1 "" +3
  WriteINIStr "$PLUGINSDIR\io.ini" "Field 9" Text "$(UNREG_CONTEXT_MENU)"
	Goto +2
  WriteINIStr "$PLUGINSDIR\io.ini" "Field 9" Text "$(REG_CONTEXT_MENU)"
	
  InstallOptionsEx::initDialog /NOUNLOAD "$PLUGINSDIR\io.ini"
	Pop $HWND
	
  !insertmacro MUI_HEADER_TEXT "$(CUSTOM_PAGE_TITLE)" "$(CUSTOM_PAGE_SUBTITLE)"
	
 	InstallOptionsEx::show
FunctionEnd	

Function LeaveCustom	
	ReadINIStr $0 "$PLUGINSDIR\io.ini" Settings State
  ${Switch} $0
	${Default}
	Abort
	
  ${Case} 1
	ReadINIStr $0 "$PLUGINSDIR\io.ini" "Field 1" State
	Push $0
	Call GetFileNameNoExt
	Pop $0
  GetDlgItem $1 $HWND 1201
  SendMessage $1 ${WM_SETTEXT} 0 "STR:$0.nsi"
	Abort
	
  ${Case} 9
	ReadRegStr $0 HKCR .reg ""
	ReadRegStr $1 HKCR "$0\shell\convert" ""
	StrCmp $1 "" 0 unregistry
	
  WriteRegStr HKCR "$0\shell\convert" "" "$(CONTEXT_MENU)"
  WriteRegStr HKCR "$0\shell\convert\command" "" '"$EXEDIR\reg2nsi.exe" /i:%1'
  GetDlgItem $0 $HWND 1208
  SendMessage $0 ${WM_SETTEXT} 0 "STR:$(UNREG_CONTEXT_MENU)"
	Abort
	unregistry:
	DeleteRegKey HKCR "$0\shell\convert"
  GetDlgItem $0 $HWND 1208
  SendMessage $0 ${WM_SETTEXT} 0 "STR:$(REG_CONTEXT_MENU)"
	Abort
	
  ${Case} 0
	${EndSwitch}
	ReadINIStr $0 $PLUGINSDIR\io.ini "Field 1" "State"
	StrCmp $0 "" 0 +3
		MessageBox MB_OK|MB_ICONEXCLAMATION "$(NO_INPUT_FILE)"
		Abort
		
	ReadINIStr $IN $PLUGINSDIR\io.ini "Field 1" "State"
	Push $IN
	Call CheckFileEncoding
	StrCmp $FE "Unicode" file_chk_done
	StrCmp $FE "ANSI" file_chk_done
		MessageBox MB_OK|MB_ICONINFORMATION "$(FILE_CODING_ERROR1) $0 $(FILE_CODING_ERROR2)"
		Abort
	file_chk_done:	
FunctionEnd	

Function Main
	Push $0
	Push $1
	Push $2
	Push $3
	Push $4
	
	;$9 ROOT_KEY
	;$8 SUB_KEY
	;$7 ENTRY
	;$6 Padding
	;$1 handle of input
	;$3 handle of output
	
	FileOpen $1 $IN r
	StrCmp $FE "Unicode" 0 +2
	FileSeek $1 2
	
	ClearErrors
	FileOpen $3 $OUT w
	IfErrors 0 +3
		MessageBox MB_OK|MB_ICONSTOP "$(WRITE_FILE_ERROR)"
		Quit
	
	
	loop:
	Call ReadFile
	Pop $0
	
	StrCmp $0 "" loop_quit
	
	Push $0
	Call TrimLine
	Pop $0
	
	StrCmp $0 "" loop   ;空行则跳过 (jump if empty line)
	
	loop_trim_line:     ;检测是否有断行 (check if trim line)
	StrCpy $2 $0 1 -1   
	StrCmp $2 "\" 0 no_trim_line
	Call ReadFile
	Pop $2
	StrCmp $2 "" loop_quit
	Push $2
	Call TrimLine
	Pop $2
	StrCpy $0 $0 -1
	StrCpy $0 $0$2
	Goto loop_trim_line
	no_trim_line:
	
	StrCpy $2 $0 1      ;检测是否是健 (check if is a reg key)
	StrCpy $4 $0 1 -1 
	StrCpy $2 $2$4
	StrCmp $2 "[]" 0 +4
	Push $0
	Call GetKey
	Goto loop
	
	StrCpy $2 $0 1
	StrCmp $2 "@" 0 not_default
	Push $0
	Call WriteDefaultValue
	Goto loop
	
	not_default:
	Push $0
	Call GetEntry
	Pop $7 ;项 (entry)
	Pop $2 ;值 (value)
	
	Push $7
	Call ConvertSpecailCharacter
	Pop $7
	
	Push $2
	Call ConvertSpecailCharacter
	Pop $2
	
	Push $2
	Call WriteValue
	
	Goto loop
	loop_quit:
	
	FileClose $3
	FileClose $1
	
	Pop $4
	Pop $3
	Pop $2
	Pop $1
	Pop $0
FunctionEnd	

Function TrimLine
	Exch $R0
	Push $R1
	
	StrCpy $R1 $R0 1 -1  ;去除回车、换行 (Cut the Carriage Return / Line Feed)
	StrCmp $R1 $\r 0 +3
	StrCpy $R0 $R0 -1
	Goto -3
	StrCmp $R1 $\n 0 +3
	StrCpy $R0 $R0 -1
	Goto -6
	
	StrCpy $R1 $R0 1 -1  ;去除行尾空格 (Cut space in line end)
	StrCmp $R1 " " 0 +3
	StrCpy $R0 $R0 -1
	Goto -3
	
	StrCpy $R1 $R0 1     ;去除行首空格 (Cut space in line header)
	StrCmp $R1 " " 0 +3
	StrCpy $R0 $R0 "" 1
	Goto -3
	
	Pop $R1
	Exch $R0
FunctionEnd	
	
Function WriteDefaultValue
	Exch $R0
	Push $R1
	Push $R2
	
	StrCpy $R1 0
	StrLen $R2 $R0
	loop:
		StrCpy $R3 $R0 1 $R1
		StrCmp $R3 "=" loop_quit
		IntCmp $R1 $R2 end
		IntOp $R1 $R1 + 1
		Goto loop
	loop_quit:
	IntOp $R1 $R1 + 1
	StrCpy $R0 $R0 "" $R1
	
	StrCpy $R2 $R0 1     ;去除行首空格 (cut space in line header)
	StrCmp $R2 " " 0 +3
	StrCpy $R0 $R0 "" 1
	Goto -3
	
	StrCpy $R1 $R0 1     ;检测值是否以引号开头及结尾 (check if value begin with quote and end with quote)
	StrCpy $R2 $R0 1 -1
	StrCpy $R1 $R1$R2
	StrCmp $R1 '""' 0 end
	
	StrCpy $R0 $R0 "" 1
	StrCpy $R0 $R0 -1
	
	Push $R0
	Call ConvertSpecailCharacter
	Pop $R0
	
	StrCpy $R0 'WriteRegStr $9 "$8" "" "$R0"'
	Push $R0
	Call WriteFile
	
	end:
	
	Pop $R2
	Pop $R1
	Exch $R0
FunctionEnd	

Function WriteValue
	Exch $R0
	Push $R1
	Push $R2
	
	StrCpy $R1 $R0 1
	StrCpy $R2 $R0 1 -1
	StrCpy $R1 $R1$R2
	StrCmp $R1 '""' str
	
	StrCpy $R1 $R0 6
	StrCmp $R1 "dword:" dword
	
	StrCpy $R1 $R0 4
	StrCmp $R1 "hex:" bin end
	
	str:
	StrCpy $R0 $R0 "" 1
	StrCpy $R0 $R0 -1
	StrCpy $R0 'WriteRegStr $9 "$8" "$7" "$R0"'
	Goto done
	
	dword:
	StrCpy $R0 $R0 "" 6
	StrCmp $R0 "" 0 +3
	StrCpy $R0 'WriteRegDWORD $9 "$8" "$7" ""'
	Goto +2
	StrCpy $R0 'WriteRegDWORD $9 "$8" "$7" 0x$R0'
	Goto done
	
	bin:
	StrCpy $R0 $R0 "" 4
	StrCmp $R0 "" 0 +3
	StrCpy $R0 'WriteRegBin $9 "$8" "$7" ""'
	Goto done
	StrCpy $R1 0
	loop:
		StrCpy $R2 $R0 1 $R1
		StrCmp $R2 "," convert
		StrCmp $R2 "" loop_quit
		IntOp $R1 $R1 + 1
		Goto loop
	convert:
	StrCpy $R2 $R0 $R1
	IntOp $R1 $R1 + 1
	StrCpy $R0 $R0 "" $R1
	StrCpy $R0 $R2$R0
	Goto loop
	loop_quit:
	StrCpy $R0 'WriteRegBin $9 "$8" "$7" $R0'
	
	done:
	Push $R0
	Call WriteFile	
	
	end:
	
	Pop $R2
	Pop $R1
	Exch $R0
FunctionEnd	

Function GetEntry
	Exch $R0
	Push $R1
	Push $R2
	Push $R3
	
	StrCpy $R1 $R0 1
	StrCmp $R1 '"' 0 end
	StrCpy $R1 1
	StrLen $R2 $R0
	loop:
		StrCpy $R3 $R0 2 $R1
		StrCmp $R3 '\"' jump
		StrCpy $R3 $R0 1 $R1
		StrCmp $R3 '"' loop_quit
		IntCmp $R1 $R2 end 0 end
		IntOp $R1 $R1 + 1
		Goto loop
	jump:
	IntOp $R1 $R1 + 2
	Goto loop
	loop_quit:
	StrCpy $R2 $R0 $R1
	StrCpy $R2 $R2 "" 1 ;项 (entry)
	
	IntOp $R1 $R1 + 1
	StrCpy $R1 $R0 "" $R1
	
	StrCpy $R3 $R1 1     ;去除行首空格 (cut space in header)
	StrCmp $R3 " " 0 +3
	StrCpy $R1 $R1 "" 1
	Goto -3
	
	StrCpy $R3 $R1 1
	StrCmp $R3 "=" 0 end
	StrCpy $R1 $R1 "" 1
	
	StrCpy $R3 $R1 1     ;去除行首空格 (cut space in end)
	StrCmp $R3 " " 0 +3
	StrCpy $R1 $R1 "" 1
	Goto -3
	
	StrCpy $R0 $R2
	
	end:
	
	Pop $R3
	Pop $R2
	Exch $R1 ;值 (value)
	Exch
	Exch $R0 ;项 (entry)
FunctionEnd	

Function ConvertSpecailCharacter  ;转换 \" \\ $ 为 $\" \ $$ (Convert \" \\ $ to $\" \ $$)
	Exch $R0
	Push $R1
	Push $R2
	Push $R3
	Push $R4
	
	StrCpy $R1 0
	StrLen $R2 $R0
	loop:
		StrCpy $R3 $R0 2 $R1
		StrCmp $R3 "\\" double_slash
		StrCmp $R3 '\"' quote
		StrCpy $R3 $R0 1 $R1
		StrCmp $R3 $$ dollar
		IntCmp $R1 $R2 loop_quit
		IntOp $R1 $R1 + 1
		Goto loop
		
	double_slash:
	StrCpy $R3 $R0 $R1
	IntOp $R1 $R1 + 1
	StrCpy $R4 $R0 "" $R1
	StrCpy $R0 $R3$R4
	StrLen $R2 $R0
	Goto loop
	
	quote:
	StrCpy $R3 $R0 $R1
	StrCpy $R4 $R0 "" $R1
	StrCpy $R0 "$R3$$$R4"
	StrLen $R2 $R0
	IntOp $R1 $R1 + 3
	Goto loop
	
	dollar:
	StrCpy $R3 $R0 $R1
	StrCpy $R4 $R0 "" $R1
	StrCpy $R0 "$R3$$$R4"
	StrLen $R2 $R0
	IntOp $R1 $R1 + 2
	Goto loop
	
	loop_quit:	
	
	Pop $R4
	Pop $R3
	Pop $R2
	Pop $R1
	Exch $R0
FunctionEnd	

Function GetKey
	Exch $R0
	Push $R1
	Push $R2
	Push $R3
	
	StrCpy $R0 $R0 "" 1
	StrCpy $R0 $R0 -1
	
	StrCpy $R1 0
	StrLen $R2 $R0
	loop:
		StrCpy $R3 $R0 1 $R1
		StrCmp $R3 "\" loop_quit
		IntCmp $R1 $R2 end
		IntOp $R1 $R1 + 1
		Goto loop
	loop_quit:
	StrCpy $R2 $R0 $R1
	StrCmp $R2 HKEY_CLASSES_ROOT 0 +3
	StrCpy $9 HKCR
	Goto sub_key
	StrCmp $R2 HKEY_LOCAL_MACHINE 0 +3
	StrCpy $9 HKLM
	Goto sub_key
	StrCmp $R2 HKEY_CURRENT_USER 0 +3
	StrCpy $9 HKCU
	Goto sub_key
	StrCmp $R2 HKEY_USERS 0 +3
	StrCpy $9 HKU
	Goto sub_key
	StrCmp $R2 HKEY_CURRENT_CONFIG 0 +3
	StrCpy $9 HKCC
	Goto sub_key
	StrCmp $R2 HKEY_DYN_DATA 0 +3
	StrCpy $9 HKDD
	Goto sub_key
	StrCmp $R2 HKEY_PERFORMANCE_DATA 0 end
	StrCpy $9 HKPD
	
	sub_key:
	IntOp $R1 $R1 + 1
	StrCpy $8 $R0 "" $R1
	
	Push $8
	Call ConvertSpecailCharacter
	Pop $8
	
	end:
	
	Pop $R3
	Pop $R2
	Pop $R1
	Pop $R0
FunctionEnd	

Function ReadFile
	Push $R0
	Push $R1
	Push $R2
	
	StrCmp $FE "Unicode" 0 ansi
	
	loop:
		FileReadByte $1 $R2        ;Read Unicode file code thanks kichik
		FileReadByte $1 $R1
		StrCmp $R2$R1 "" end
		IntOp $R1 $R1 << 8
		IntOp $R1 $R1 | $R2
		IntFmt $R1 %lc $R1
		StrCmp $R1 "$\r" loop_quit
		StrCmp $R1 "$\n" loop_quit
		StrCpy $R0 $R0$R1
		Goto loop
	loop_quit:
	StrCpy $R0 "$R0$\r$\n"
	FileSeek $1 2 CUR
	Goto end
	
	ansi:
	FileRead $1 $R0
	
	end:
	
	Pop $R2
	Pop $R1
	Exch $R0
FunctionEnd	

Function WriteFile
	Exch $R0
	Push $R1
	
	ClearErrors
	FileWrite $3 "$6$R0$\r$\n"
	IfErrors 0 +2
	StrCpy $R0 "$(WRITE_FILE_ERROR)"
	DetailPrint $R0
	
	Pop $R1
	Pop $R0
FunctionEnd	

Function CheckFileEncoding
	Exch $R4
	Push $R0
	Push $R1
	Push $R2
	Push $R3
	
	FileOpen $R0 $R4 r
	FileReadByte $R0 $R1
	FileSeek $R0 1
	FileReadByte $R0 $R2
	FileSeek $R0 2
	FileReadByte $R0 $R3
	FileClose $R0
	
	StrCpy $R0 $R1$R2
	StrCmp $R0 255254 0 +3
	StrCpy $FE "Unicode"
	Goto end
	StrCmp $R0 254255 0 +3
	StrCpy $FE "Unicode (big endian)"
	Goto end
	StrCpy $R0 $R1$R2$R3
	StrCmp $R0 239187191 0 +3
	StrCpy $FE "UTF-8"
	Goto end
	
	StrCpy $FE "ANSI"
	end:
	
	Pop $R3
	Pop $R2
	Pop $R1
	Pop $R0
	Pop $R4
FunctionEnd	

Function GetFileNameNoExt
	Exch $R0
	Push $R1
	Push $R2
	Push $R3
	
	StrCpy $R1 0
	StrLen $R3 $R0
	loop:
		StrCpy $R2 $R0 1 -$R1
		StrCmp $R2 . loop_quit
		StrCmp $R2 "\" loop_quit
		IntCmp $R1 $R3 end 0 end
		IntOp $R1 $R1 + 1
		Goto loop
	loop_quit:
	IntOp $R1 $R3 - $R1
	StrCpy $R0 $R0 $R1
	end:
	
	Pop $R3
	Pop $R2
	Pop $R1
	Exch $R0
FunctionEnd	
	
Function GetParameters
	Push $R0
	Push $R1 ;指针 (pointer)
	Push $R2 ;字串长度 (string len)
	Push $R3 ;临时变量 (temp var)
	Push $R4 ;参数起始偏移 (start of parameter)
	Push $R5 ;参数结束偏移 (end of parameter)
	Push $R6 ;参数 (the parameter)
	
	StrCpy $R0 "$CMDLINE /"
	
	StrCpy $R1 0
	StrCpy $R4 ""
	StrCpy $R5 ""
	StrLen $R2 $R0
	loop:
		IntOp $R1 $R1 + 1
	  StrCpy $R3 $R0 2 $R1
		StrCmp $R3 ' /' get ;以 " /" 作为分隔符 (separate by " /")
		IntCmp $R1 $R2 loop_quit 0 loop_quit
		Goto loop
		
		get:
		StrCmp $R4 "" 0 +3
		StrCpy $R4 $R1
		Goto loop
		StrCmp $R5 "" 0 reset
		StrCpy $R5 $R1
	
		IntOp $R4 $R4 + 2
		IntOp $R3 $R5 - $R4
		StrCpy $R6 $R0 $R3 $R4
	
		;检测参数后面是否有空格  (check if space in parameter end)
		StrCpy $R3 $R6 "" -1
		StrCmp $R3 " " 0 +3
		StrCpy $R6 $R6 -1
		Goto -3
	
		StrCmp $R6 "" loop ;检测参数是否为空值 (check if parameter is empty)
		
		reset:
		StrCpy $R4 $R5 ;重置 (reset)
		StrCpy $R5 ""  ;重置 (reset)
		
		;-----------------------------------
		StrCpy $R3 $R6 2
		StrCmp $R3 "i:" input
		StrCmp $R3 "o:" output
		
		input:
		StrCpy $IN $R6 "" 2
		Goto loop
		
		output:
		StrCpy $OUT $R6 "" 2
		Goto loop
		;-----------------------------------
		
	loop_quit:
	
	Pop $R5
	Pop $R4
	Pop $R3
	Pop $R2
	Pop $R1
	Pop $R0
FunctionEnd	

Function GetParent
	Exch $R0
	Push $R1
	Push $R2
	Push $R3
	
	StrCpy $R1 1
	StrLen $R2 $R0
	loop:
		StrCpy $R3 $R0 1 -$R1
		StrCmp $R3 "\" loop_quit
		IntCmp $R1 $R2 loop_quit 0 loop_quit
		IntOp $R1 $R1 + 1
		Goto loop
	loop_quit:
	IntOp $R1 $R2 - $R1
	StrCpy $R0 $R0 $R1
	
	Pop $R3
	Pop $R2
	Pop $R1
	Exch $R0
FunctionEnd

引用Language.nsi的内容:

!define ENG 1033
!define CHS 2052
!define CHT 1028

LangString INSTALL_BUTTON ${ENG} "Con&vert"
LangString INSTALL_BUTTON ${CHS} "转换(&V)"

LangString INSTALLING_PAGE_TITLE ${ENG} "Converting"
LangString INSTALLING_PAGE_TITLE ${CHS} "正在转换"

LangString INSTALLING_PAGE_SUBTITLE ${ENG} "$(^NameDA) is converting"
LangString INSTALLING_PAGE_SUBTITLE ${CHS} "$(^NameDA) 正在转换"

LangString FILE_CODING_ERROR1 ${ENG} "The file you convert encoding by"
LangString FILE_CODING_ERROR1 ${CHS} "你要转换的文档使用了"

LangString FILE_CODING_ERROR2 ${ENG} ", to use it, you must convert to ANSI or Unicode coding. $\r$\nYou can convert by notepad $\"Save as$\" feature"
LangString FILE_CODING_ERROR2 ${CHS} "编码,你需要转换为 ANSI 或 Unicode 编码方可使用。$\r$\n你可以使用记事本的 $\"另存为$\" 功能来转换。"

LangString REG_CONTEXT_MENU ${ENG} "Registry context menu"
LangString REG_CONTEXT_MENU ${CHS} "注册右键菜单"

LangString UNREG_CONTEXT_MENU ${ENG} "Unregistry context menu"
LangString UNREG_CONTEXT_MENU ${CHS} "解注册右键菜单"

LangString CUSTOM_PAGE_TITLE ${ENG} "Registry converter"
LangString CUSTOM_PAGE_TITLE ${CHS} "注册表转换"

LangString CUSTOM_PAGE_SUBTITLE ${ENG} "Please enter a registry file and then press convert button"
LangString CUSTOM_PAGE_SUBTITLE ${CHS} "请输入要转换的注册表文件后按转换按钮"

LangString CONTEXT_MENU ${ENG} "Convert to NSI file"
LangString CONTEXT_MENU ${CHS} "转换为 NSI 文件"

LangString NO_INPUT_FILE ${ENG} "Please open a input file"
LangString NO_INPUT_FILE ${CHS} "请打开输入文件"

LangString WRITE_FILE_ERROR ${ENG} "Write file error"
LangString WRITE_FILE_ERROR ${CHS} "写入文件错误"

LangString CUSTOM_PAGE_FIELD3 ${ENG} "REG file(.reg)|*.reg|All file|*.*"
LangString CUSTOM_PAGE_FIELD3 ${CHS} "REG 文件(.reg)|*.reg|所有文件|*.*"

LangString CUSTOM_PAGE_FIELD4 ${ENG} "NSI file(.nsi)|*.nsi"
LangString CUSTOM_PAGE_FIELD4 ${CHS} "NSI 文件(.nsi)|*.nsi"

LangString CUSTOM_PAGE_FIELD5 ${ENG} "Auto and Tab in line header"
LangString CUSTOM_PAGE_FIELD5 ${CHS} "行首自动加 Tab"

LangString CUSTOM_PAGE_FIELD6 ${ENG} "Auto and Space in line header"
LangString CUSTOM_PAGE_FIELD6 ${CHS} "行首自动加空格"

LangString CUSTOM_PAGE_FIELD7 ${ENG} "Input file:"
LangString CUSTOM_PAGE_FIELD7 ${CHS} "输入文件:"

LangString CUSTOM_PAGE_FIELD8 ${ENG} "Output file:"
LangString CUSTOM_PAGE_FIELD8 ${CHS} "输出文件:"

引用io.ini的内容:

[Settings]

[Field 1]
Type=Text
Notify=ONTEXTCHANGE
Left=13
Right=267
Top=19
Bottom=32

[Field 2]
Type=Text
Left=14
Right=267
Top=59
Bottom=72

[Field 3]
Type=Button
Text=...
State=1
Flags=FILEREQUEST|FILE_MUST_EXIST
Filter=REG file(.reg)|*.reg|All file|*.*
Notify=ONCLICK
Left=270
Right=295
Top=20
Bottom=32

[Field 4]
Type=Button
Text=...
State=2
Flags=FILEREQUEST|FILE_MUST_EXIST|REQ_SAVE
Filter=NSI file(.nsi)|*.nsi
Notify=ONCLICK
Left=270
Right=295
Top=60
Bottom=72

[Field 5]
Type=Checkbox
Text=Auto and Tab in line header
State=1
Left=14
Right=200
Top=86
Bottom=96

[Field 6]
Type=Checkbox
Text=Auto and Space in line header
Left=14
Right=200
Top=104
Bottom=115

[Field 7]
Type=Label
Text=Input file
Left=14
Right=90
Top=11
Bottom=19

[Field 8]
Type=Label
Text=Output file
Left=14
Right=86
Top=51
Bottom=59

[Field 9]
Type=Button
Text=
Notify=ONCLICK
Left=205
Right=295
Top=100
Bottom=116

全部的源文件可以点击这里另存