# INFO #
!addincludedir "."
!addplugindir "."
Name "Flag Combobox"
OutFile "Flag Combobox.exe"
InstallDir "$TEMP\Flag Combobox"
# COMPRESSOR #
SetCompressor /SOLID /FINAL lzma
# RUNTIME #
RequestExecutionLevel USER
# HIDE # SHOW #
ShowInstDetails nevershow
ShowUninstDetails NeverShow
# INCLUDES #
!include "MUI2.nsh"
!include "WordFunc.nsh"
!include "FileFunc.nsh"
!include "nsDialogs.nsh"
!include "LogicLib.nsh"
!include "WinCore.nsh"
!include "WinMessages.nsh"
# ICON & STYLE #
BrandingText /TRIMRIGHT " "
# PAGE #
Page custom "Welcome.Page" ""
Page instfiles ""
# LANGUAGES #
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Romanian"
!insertmacro MUI_LANGUAGE "simpChinese"
!insertmacro MUI_LANGUAGE "TradChinese"
# INIT #
Function .onInit
FunctionEnd
# PAGE #
Function "Welcome.Page"
# VARIABLES #
var /GLOBAL DIALOG
var /GLOBAL Lbl.Welcome
var /GLOBAL Lbl.Sub.Welcome
var /GLOBAL Lbl.Language
var /GLOBAL LANNAME
var /GLOBAL DropList
var /GLOBAL Path_User
var /GLOBAL Lbl_User
var /GLOBAL Lbl_Show_User
var /GLOBAL Path_Pass
var /GLOBAL Lbl_Pass
var /GLOBAL Lbl_Show_Pass
GetDlgItem $0 $HWNDPARENT 1
ShowWindow $0 ${SW_HIDE}
GetDlgItem $0 $HWNDPARENT 2
ShowWindow $0 ${SW_HIDE}
GetDlgItem $0 $HWNDPARENT 3
ShowWindow $0 ${SW_HIDE}
GetDlgItem $0 $HWNDPARENT 1990
ShowWindow $0 ${SW_HIDE}
GetDlgItem $0 $HWNDPARENT 1991
ShowWindow $0 ${SW_HIDE}
GetDlgItem $0 $HWNDPARENT 1992
ShowWindow $0 ${SW_HIDE}
nsDialogs::Create /NOUNLOAD 1044
Pop $DIALOG
${If} $DIALOG == error
Abort
${EndIf}
# WELCOME #
nsDialogs::CreateControl /NOUNLOAD STATIC 0x40000000|0x10000000|0x04000000|0x00000100 0x00000020 3% 5% 30% 8% "My Name Setup"
Pop $Lbl.Welcome
CreateFont $0 "$(^Font)" 14 300
SendMessage $Lbl.Welcome ${WM_SETFONT} $0 0
nsDialogs::CreateControl /NOUNLOAD STATIC 0x40000000|0x10000000|0x04000000|0x00000100 0x00000020 3% 15% 60% 4% "This installer will help you to install $(^Name) ..."
pop $Lbl.Sub.Welcome
# Language #
nsDialogs::CreateControl /NOUNLOAD STATIC 0x40000000|0x10000000|0x04000000|0x00000100 0x00000020 70% 84% 20% 4% "Language:"
pop $Lbl.Language
nsDialogs::CreateControl /NOUNLOAD COMBOBOX 0x40000000|0x10000000|0x04000000|0x00010000|0x00200000|0x02000000|0x0040|0x0200|0x0002 0x00000100|0x00000200 70% 90% 25% 5% ""
Pop $DropList
StrCpy $1 $DropList
GetFunctionAddress $3 "GetSelectedLang"
nsDialogs::OnChange /NOUNLOAD $1 $3
SendMessage $DropList ${CB_GETCOUNT} 0 0 $0
IntCmp $0 0 0 0 next
${NSD_CB_AddString} $DropList English
${NSD_CB_AddString} $DropList French
${NSD_CB_AddString} $DropList Germen
${NSD_CB_AddString} $DropList Romanian
${NSD_CB_AddString} $DropList SimpChinese
${NSD_CB_AddString} $DropList TradChinese
next:
; To remember the selection of combobox
${Unless} $LANNAME == ""
SendMessage $DropList ${CB_FINDSTRING} -1 "STR:$LANNAME" $0
${If} $0 = -1
SendMessage $DropList ${CB_SETCURSEL} 0 0
${Else}
SendMessage $DropList ${CB_SETCURSEL} $0 0
${EndIf}
${Else}
SendMessage $DropList ${CB_SETCURSEL} 0 0
${EndUnless}
# User
nsDialogs::CreateControl /NOUNLOAD EDIT 0x40000000|0x10000000|0x04000000|0x00010000|0x00000080 0 20% 28% 25% 4% "" ; Username
Pop $Path_User
Strcpy $1 $Path_User
GetFunctionAddress $3 ".onClick.User"
nsDialogs::OnChange $1 $3
nsDialogs::CreateControl /NOUNLOAD STATIC 0x40000000|0x10000000|0x04000000|0x00000100 0x00000020 5%% 29% 12% 4% "Username"
Pop $Lbl_User
nsDialogs::CreateControl /NOUNLOAD STATIC 0x40000000|0x10000000|0x04000000|0x00000100 0x00000020 50% 29% 45% 4% ""
Pop $Lbl_Show_User
# Password
nsDialogs::CreateControl /NOUNLOAD EDIT 0x40000000|0x10000000|0x04000000|0x00010000|0x00000080 0 20% 35% 25% 4% "" ; Password
Pop $Path_Pass
Strcpy $1 $Path_Pass
SendMessage $Path_Pass 0x00CC 149 0
GetFunctionAddress $3 ".onClick.Pass"
nsDialogs::OnChange $1 $3
nsDialogs::CreateControl /NOUNLOAD STATIC 0x40000000|0x10000000|0x04000000|0x00000100 0x00000020 5%% 36% 12% 4% "Password"
Pop $Lbl_Pass
nsDialogs::CreateControl /NOUNLOAD STATIC 0x40000000|0x10000000|0x04000000|0x00000100 0x00000020 50% 36% 45% 4% ""
Pop $Lbl_Show_Pass
nsDialogs::Show
FunctionEnd
var /Global USERNAME
var /Global PASSWORD
Function ".onClick.User"
Pop $Path_User
${NSD_GetText} $Path_User $0
StrCpy $USERNAME "$0"
SendMessage $Lbl_Show_User ${WM_SETTEXT} 0 "STR:$USERNAME"
FunctionEnd
Function ".onClick.Pass"
Pop $Path_Pass
${NSD_GetText} $Path_Pass $0
StrCpy $PASSWORD "$0"
SendMessage $Lbl_Show_Pass ${WM_SETTEXT} 0 "STR:$PASSWORD"
FunctionEnd
# ENGLISH #
!define LANGSTRING_SUBTITLE_1033 "This installer will help you to install $(^Name) ..."
!define LANGSTRING_LANGUAGE_1033 "Language:"
!define LANGSTRING_USERNAME_1033 "Username:"
!define LANGSTRING_PASSWORD_1033 "Password:"
# FRENCH #
!define LANGSTRING_SUBTITLE_1036 "Ce programme d'installation vous aidera à installer $(^Name) ..."
!define LANGSTRING_LANGUAGE_1036 "Langue:"
!define LANGSTRING_USERNAME_1036 "Nom d'utilisateur:"
!define LANGSTRING_PASSWORD_1036 "Mot de passe:"
# GERMAN #
!define LANGSTRING_SUBTITLE_1031 "Dieser Installateur hilft Ihnen bei der Installation von $(^Name) ..."
!define LANGSTRING_LANGUAGE_1031 "Sprache:"
!define LANGSTRING_USERNAME_1031 "Benutzername:"
!define LANGSTRING_PASSWORD_1031 "Passwort:"
# ROMANIAN #
!define LANGSTRING_SUBTITLE_1048 "Acest instalator te va ajuta să instalezi $(^Name) ..."
!define LANGSTRING_LANGUAGE_1048 "Limbă:"
!define LANGSTRING_USERNAME_1048 "Utilizator:"
!define LANGSTRING_PASSWORD_1048 "Parolă:"
# SIMPCHINESE #
!define LANGSTRING_SUBTITLE_2052 "此安装程序将帮助您安装 $(^Name) ..."
!define LANGSTRING_LANGUAGE_2052 "语言:"
!define LANGSTRING_USERNAME_2052 "用户名:"
!define LANGSTRING_PASSWORD_2052 "密码:"
# TRADCHINESE #
!define LANGSTRING_SUBTITLE_1028 "此安裝程序將幫助您安裝 $(^Name) ..."
!define LANGSTRING_LANGUAGE_1028 "語言:"
!define LANGSTRING_USERNAME_1028 "用戶名:"
!define LANGSTRING_PASSWORD_1028 "密碼:"
!macro __NSD_CB_GetSelection CONTROL VAR
Push $0
SendMessage ${CONTROL} ${CB_GETCURSEL} 0 0 $0
System::Alloc ${NSIS_MAX_STRLEN}
System::Call 'user32::SendMessage(i ${CONTROL}, i ${CB_GETLBTEXT}, i r0, i ss)'
Pop $0
System::Call '*$0(&t${NSIS_MAX_STRLEN}.s)'
System::Free $0
Exch
Pop $0
Pop ${VAR}
!macroend
!define NSD_CB_GetSelection `!insertmacro __NSD_CB_GetSelection`
var /GLOBAL LANGSTRING_SUBTITLE
var /GLOBAL LANGSTRING_LANGUAGE
var /GLOBAL LANGSTRING_USERNAME
var /GLOBAL LANGSTRING_PASSWORD
Function GetSelectedLang
!macro SetPageStrings LANGID
StrCpy $LANGSTRING_SUBTITLE "${LANGSTRING_SUBTITLE_${LANGID}}"
StrCpy $LANGSTRING_LANGUAGE "${LANGSTRING_LANGUAGE_${LANGID}}"
StrCpy $LANGSTRING_USERNAME "${LANGSTRING_USERNAME_${LANGID}}"
StrCpy $LANGSTRING_PASSWORD "${LANGSTRING_PASSWORD_${LANGID}}"
!macroend
${NSD_CB_GetSelection} $DropList $LANNAME
${Select} $LANNAME
${Case} English
!insertmacro SetPageStrings 1033
SendMessage $Lbl.Language ${WM_SETTEXT} 0 "STR:$LANGSTRING_LANGUAGE"
SendMessage $Lbl.Sub.Welcome ${WM_SETTEXT} 0 "STR:$LANGSTRING_SUBTITLE"
SendMessage $Lbl_User ${WM_SETTEXT} 0 "STR:$LANGSTRING_USERNAME"
SendMessage $Lbl_Pass ${WM_SETTEXT} 0 "STR:$LANGSTRING_PASSWORD"
${Case} French
!insertmacro SetPageStrings 1036
SendMessage $Lbl.Language ${WM_SETTEXT} 0 "STR:$LANGSTRING_LANGUAGE"
SendMessage $Lbl.Sub.Welcome ${WM_SETTEXT} 0 "STR:$LANGSTRING_SUBTITLE"
SendMessage $Lbl_User ${WM_SETTEXT} 0 "STR:$LANGSTRING_USERNAME"
SendMessage $Lbl_Pass ${WM_SETTEXT} 0 "STR:$LANGSTRING_PASSWORD"
${Case} Germen
!insertmacro SetPageStrings 1031
SendMessage $Lbl.Language ${WM_SETTEXT} 0 "STR:$LANGSTRING_LANGUAGE"
SendMessage $Lbl.Sub.Welcome ${WM_SETTEXT} 0 "STR:$LANGSTRING_SUBTITLE"
SendMessage $Lbl_User ${WM_SETTEXT} 0 "STR:$LANGSTRING_USERNAME"
SendMessage $Lbl_Pass ${WM_SETTEXT} 0 "STR:$LANGSTRING_PASSWORD"
${Case} Romanian
!insertmacro SetPageStrings 1048
SendMessage $Lbl.Language ${WM_SETTEXT} 0 "STR:$LANGSTRING_LANGUAGE"
SendMessage $Lbl.Sub.Welcome ${WM_SETTEXT} 0 "STR:$LANGSTRING_SUBTITLE"
SendMessage $Lbl_User ${WM_SETTEXT} 0 "STR:$LANGSTRING_USERNAME"
SendMessage $Lbl_Pass ${WM_SETTEXT} 0 "STR:$LANGSTRING_PASSWORD"
${Case} SimpChinese
!insertmacro SetPageStrings 2052
SendMessage $Lbl.Language ${WM_SETTEXT} 0 "STR:$LANGSTRING_LANGUAGE"
SendMessage $Lbl.Sub.Welcome ${WM_SETTEXT} 0 "STR:$LANGSTRING_SUBTITLE"
SendMessage $Lbl_User ${WM_SETTEXT} 0 "STR:$LANGSTRING_USERNAME"
SendMessage $Lbl_Pass ${WM_SETTEXT} 0 "STR:$LANGSTRING_PASSWORD"
${Case} TradChinese
!insertmacro SetPageStrings 1028
SendMessage $Lbl.Language ${WM_SETTEXT} 0 "STR:$LANGSTRING_LANGUAGE"
SendMessage $Lbl.Sub.Welcome ${WM_SETTEXT} 0 "STR:$LANGSTRING_SUBTITLE"
SendMessage $Lbl_User ${WM_SETTEXT} 0 "STR:$LANGSTRING_USERNAME"
SendMessage $Lbl_Pass ${WM_SETTEXT} 0 "STR:$LANGSTRING_PASSWORD"
${CaseElse}
!insertmacro SetPageStrings 1033
${EndSelect}
FunctionEnd
# END #
Function .onGUIEnd
FunctionEnd
# SECTION #
Section "MAIN" SEC01
SectionEnd
THE END
暂无评论内容