/*
http://download.videolan.org/pub/videolan/vlc/
http://download.videolan.org/pub/videolan/vlc/2.1.5/win64/vlc-2.1.5-win64.7z
http://download.videolan.org/pub/videolan/vlc/2.1.4/win64/vlc-2.1.4-win64.7z

http://download.videolan.org/pub/videolan/vlc/2.1.5/win32/vlc-2.1.5-win32.7z

*/
!define RELEASURL	"http://download.videolan.org/pub/videolan/vlc"
!define DLVER	"2.x.x"
!define APPSIZE	"71000" # kB
!define APPVER 	"0.0.0.0"
!define APPNAME "VLC media player"
!define APP 	"VLC"
!define DLNAME	"VLC"
!define APPLANG	"32-64-bit_Multilingual_Online"
!define FOLDER	"VLCPortable"
!define MULTILANG ; Delete if not MultiLang
!define FINISHRUN
!define OPTIONS
!define SOURCES
; !define DESCRIPTION	"Free cross-platform media player"
!define INPUTBOX

SetCompressor /SOLID lzma
SetCompressorDictSize 32

!include "..\_Include\Installer.nsh"
!include "LogicLib.nsh"
!include "x64.nsh"

!insertmacro MUI_LANGUAGE "Afrikaans"
!insertmacro MUI_LANGUAGE "Arabic"
!insertmacro MUI_LANGUAGE "Bulgarian"
!insertmacro MUI_LANGUAGE "Catalan"
!insertmacro MUI_LANGUAGE "Czech"
!insertmacro MUI_LANGUAGE "Danish"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Greek"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "Basque"
!insertmacro MUI_LANGUAGE "Finnish"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "Galician"
!insertmacro MUI_LANGUAGE "Hebrew"
!insertmacro MUI_LANGUAGE "Hungarian"
!insertmacro MUI_LANGUAGE "Italian"
!insertmacro MUI_LANGUAGE "Japanese"
!insertmacro MUI_LANGUAGE "Korean"
!insertmacro MUI_LANGUAGE "Lithuanian"
!insertmacro MUI_LANGUAGE "Malay"
!insertmacro MUI_LANGUAGE "Norwegian"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "Portuguese"
!insertmacro MUI_LANGUAGE "PortugueseBR"
!insertmacro MUI_LANGUAGE "Romanian"
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "Slovak"
!insertmacro MUI_LANGUAGE "Slovenian"
!insertmacro MUI_LANGUAGE "Albanian"
!insertmacro MUI_LANGUAGE "Serbian"
!insertmacro MUI_LANGUAGE "Swedish"
!insertmacro MUI_LANGUAGE "Thai"
!insertmacro MUI_LANGUAGE "Turkish"
!insertmacro MUI_LANGUAGE "Ukrainian"
!insertmacro MUI_LANGUAGE "SimpChinese"
!insertmacro MUI_LANGUAGE "TradChinese"

Var InputVer
Var VER
Var WIN
Function nsDialogsPage
	nsDialogs::Create 1018
	Pop $0
	${NSD_CreateLabel} 0 0 100% 12u "Enter Version Number:"
	Pop $0
	${NSD_CreateText} 0 13u 100% 12u ""
	Pop $InputVer
	nsDialogs::Show
FunctionEnd
Function nsDialogsPageLeave
	${NSD_GetText} $InputVer $R0
StrCmp $R0 "" 0 +3
	MessageBox MB_ICONEXCLAMATION `You must enter a version number!`
Abort
	StrCpy $VER "$R0"
FunctionEnd

Section "${APPNAME} Portable English" main
SectionIn RO
File "/oname=$TEMP\${APP}PortableTemp\7z.dll" "..\_Include\7-Zip\7z.dll"
File "/oname=$TEMP\${APP}PortableTemp\7z.exe" "..\_Include\7-Zip\7z.exe"

DetailPrint "Installing ${APPNAME} Portable $WIN"
${If} ${FileExists} "$EXEDIR\vlc-$VER-$WIN.7z"
nsExec::Exec `"$TEMP\${APP}PortableTemp\7z.exe" x "$EXEDIR\vlc-$VER-$WIN.7z" -aoa -o"$TEMP\${APP}PortableTemp\${APP}"`
${Else}
Call CheckConnected
inetc::get "${RELEASURL}/$VER/$WIN/vlc-$VER-$WIN.7z" "$TEMP\${APP}PortableTemp\vlc-$VER-$WIN.7z"
Pop $0
StrCmp $0 "OK" +3
MessageBox MB_USERICON "Download of vlc-$VER-$WIN.7z: $0"
	Abort
nsExec::Exec `"$TEMP\${APP}PortableTemp\7z.exe" x "$TEMP\${APP}PortableTemp\vlc-$VER-$WIN.7z" -aoa -o"$TEMP\${APP}PortableTemp\${APP}"`
${EndIf}
DetailPrint "Installing ${APPNAME} Portable $WIN"
SetOutPath "$INSTDIR"
File "..\..\..\${FOLDER}\${APP}Portable.exe"

Rename "$TEMP\${APP}PortableTemp\${APP}\vlc-$VER\locale" "$TEMP\${APP}PortableTemp\locale"
RMDir /r "$TEMP\${APP}PortableTemp\${APP}\vlc-$VER\languages"
RMDir /r "$TEMP\${APP}PortableTemp\${APP}\vlc-$VER\NSIS"
Delete "$TEMP\${APP}PortableTemp\${APP}\vlc-$VER\*.nsi"
SetOutPath "$INSTDIR\App\${APP}$WIN"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\${APP}\vlc-$VER\*.*" "$INSTDIR\App\${APP}$WIN\"

!ifdef DESCRIPTION
Call AppInfo
!endif
!ifdef SOURCES
Call Sources
	SetOutPath "$INSTDIR\Other\_Include\7-Zip"
	File "..\_Include\7-Zip\7z.dll"
	File "..\_Include\7-Zip\7z.exe"
!endif
!ifdef SOURCES & DESCRIPTION
Call SourceInfo
!endif

SectionEnd

/*
Section /o "${APPNAME} Portable 64 bit English" x64
DetailPrint "Installing ${APPNAME} Portable 64 bit"
${If} ${FileExists} "$EXEDIR\vlc-$VER-win64.7z"
nsExec::Exec `"$TEMP\${APP}PortableTemp\7z.exe" x "$EXEDIR\vlc-$VER-win64.7z" -aoa -o"$TEMP\${APP}PortableTemp\${APP}64"`
${Else}
Call CheckConnected
inetc::get "${RELEASURL}/$VER/win64/vlc-$VER-win64.7z" "$TEMP\${APP}PortableTemp\vlc-$VER-win64.7z"
Pop $0
StrCmp $0 "OK" +3
MessageBox MB_USERICON "Download of vlc-$VER-win64.7z: $0"
	Abort
nsExec::Exec `"$TEMP\${APP}PortableTemp\7z.exe" x "$TEMP\${APP}PortableTemp\vlc-$VER-win64.7z" -aoa -o"$TEMP\${APP}PortableTemp\${APP}64"`
${EndIf}
DetailPrint "Installing ${APPNAME} Portable 32 bit"
RMDir /r "$TEMP\${APP}PortableTemp\${APP}64\vlc-$VER\locale"
RMDir /r "$TEMP\${APP}PortableTemp\${APP}64\vlc-$VER\languages"
RMDir /r "$TEMP\${APP}PortableTemp\${APP}64\vlc-$VER\NSIS"
Delete "$TEMP\${APP}PortableTemp\${APP}64\vlc-$VER\*.nsi"
SetOutPath "$INSTDIR\App\${APP}_64"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\${APP}64\vlc-$VER\*.*" "$INSTDIR\App\${APP}_64\"
SectionEnd
*/

SectionGroup "Language"

Section /o "af" af
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\af"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\af\*.*" "$INSTDIR\App\${APP}$WIN\locale\af"
SectionEnd

Section /o "ar" ar
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\ar"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\ar\*.*" "$INSTDIR\App\${APP}$WIN\locale\ar"
SectionEnd

Section /o "bg" bg
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\bg"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\bg\*.*" "$INSTDIR\App\${APP}$WIN\locale\bg"
SectionEnd

Section /o "bn" bn
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\bn"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\bn\*.*" "$INSTDIR\App\${APP}$WIN\locale\bn"
SectionEnd

Section /o "ca" ca
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\ca"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\ca\*.*" "$INSTDIR\App\${APP}$WIN\locale\ca"
SectionEnd

Section /o "co" co
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\co"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\co\*.*" "$INSTDIR\App\${APP}$WIN\locale\co"
SectionEnd

Section /o "cs" cs
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\cs"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\cs\*.*" "$INSTDIR\App\${APP}$WIN\locale\cs"
SectionEnd

Section /o "da" da
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\da"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\da\*.*" "$INSTDIR\App\${APP}$WIN\locale\da"
SectionEnd

Section /o "de" de
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\de"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\de\*.*" "$INSTDIR\App\${APP}$WIN\locale\de"
SectionEnd

Section /o "el" el
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\el"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\el\*.*" "$INSTDIR\App\${APP}$WIN\locale\el"
SectionEnd

Section /o "en_GB" en_GB
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\en_GB"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\en_GB\*.*" "$INSTDIR\App\${APP}$WIN\locale\en_GB"
SectionEnd

Section /o "es" es
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\es"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\es\*.*" "$INSTDIR\App\${APP}$WIN\locale\es"
SectionEnd

Section /o "eu" eu
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\eu"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\eu\*.*" "$INSTDIR\App\${APP}$WIN\locale\eu"
SectionEnd

Section /o "fa" fa
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\fa"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\fa\*.*" "$INSTDIR\App\${APP}$WIN\locale\fa"
SectionEnd

Section /o "fi" fi
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\fi"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\fi\*.*" "$INSTDIR\App\${APP}$WIN\locale\fi"
SectionEnd

Section /o "fr" fr
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\fr"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\fr\*.*" "$INSTDIR\App\${APP}$WIN\locale\fr"
SectionEnd

Section /o "fur" fur
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\fur"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\fur\*.*" "$INSTDIR\App\${APP}$WIN\locale\fur"
SectionEnd

Section /o "gl" gl
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\gl"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\gl\*.*" "$INSTDIR\App\${APP}$WIN\locale\gl"
SectionEnd

Section /o "he" he
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\he"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\he\*.*" "$INSTDIR\App\${APP}$WIN\locale\he"
SectionEnd

Section /o "hi" hi
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\hi"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\hi\*.*" "$INSTDIR\App\${APP}$WIN\locale\hi"
SectionEnd

Section /o "hu" hu
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\hu"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\hu\*.*" "$INSTDIR\App\${APP}$WIN\locale\hu"
SectionEnd

Section /o "it" it
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\it"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\it\*.*" "$INSTDIR\App\${APP}$WIN\locale\it"
SectionEnd

Section /o "ja" ja
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\ja"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\ja\*.*" "$INSTDIR\App\${APP}$WIN\locale\ja"
SectionEnd

Section /o "ka" ka
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\ka"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\ka\*.*" "$INSTDIR\App\${APP}$WIN\locale\ka"
SectionEnd

Section /o "ko" ko
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\ko"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\ko\*.*" "$INSTDIR\App\${APP}$WIN\locale\ko"
SectionEnd

Section /o "lt" lt
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\lt"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\lt\*.*" "$INSTDIR\App\${APP}$WIN\locale\lt"
SectionEnd

Section /o "lv" lv
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\lv"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\lv\*.*" "$INSTDIR\App\${APP}$WIN\locale\lv"
SectionEnd

Section /o "ms" ms
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\ms"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\ms\*.*" "$INSTDIR\App\${APP}$WIN\locale\ms"
SectionEnd

Section /o "my" my
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\my"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\my\*.*" "$INSTDIR\App\${APP}$WIN\locale\my"
SectionEnd

Section /o "nb" nb
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\nb"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\nb\*.*" "$INSTDIR\App\${APP}$WIN\locale\nb"
SectionEnd

Section /o "ne" ne
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\ne"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\ne\*.*" "$INSTDIR\App\${APP}$WIN\locale\ne"
SectionEnd

Section /o "nl" nl
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\nl"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\nl\*.*" "$INSTDIR\App\${APP}$WIN\locale\nl"
SectionEnd

Section /o "oc" oc
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\oc"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\oc\*.*" "$INSTDIR\App\${APP}$WIN\locale\oc"
SectionEnd

Section /o "pa" pa
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\pa"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\pa\*.*" "$INSTDIR\App\${APP}$WIN\locale\pa"
SectionEnd

Section /o "pl" pl
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\pl"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\pl\*.*" "$INSTDIR\App\${APP}$WIN\locale\pl"
SectionEnd

Section /o "ps" ps
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\ps"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\ps\*.*" "$INSTDIR\App\${APP}$WIN\locale\ps"
SectionEnd

Section /o "pt_BR" pt_BR
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\pt_BR"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\pt_BR\*.*" "$INSTDIR\App\${APP}$WIN\locale\pt_BR"
SectionEnd

Section /o "pt_PT" pt_PT
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\pt_PT"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\pt_PT\*.*" "$INSTDIR\App\${APP}$WIN\locale\pt_PT"
SectionEnd

Section /o "ro" ro
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\ro"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\ro\*.*" "$INSTDIR\App\${APP}$WIN\locale\ro"
SectionEnd

Section /o "ru" ru
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\ru"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\ru\*.*" "$INSTDIR\App\${APP}$WIN\locale\ru"
SectionEnd

Section /o "sk" sk
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\sk"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\sk\*.*" "$INSTDIR\App\${APP}$WIN\locale\sk"
SectionEnd

Section /o "sl" sl
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\sl"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\sl\*.*" "$INSTDIR\App\${APP}$WIN\locale\sl"
SectionEnd

Section /o "sq" sq
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\sq"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\sq\*.*" "$INSTDIR\App\${APP}$WIN\locale\sq"
SectionEnd

Section /o "sr" sr
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\sr"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\sr\*.*" "$INSTDIR\App\${APP}$WIN\locale\sr"
SectionEnd

Section /o "sv" sv
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\sv"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\sv\*.*" "$INSTDIR\App\${APP}$WIN\locale\sv"
SectionEnd

Section /o "tet" tet
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\tet"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\tet\*.*" "$INSTDIR\App\${APP}$WIN\locale\tet"
SectionEnd

Section /o "th" th
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\th"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\th\*.*" "$INSTDIR\App\${APP}$WIN\locale\th"
SectionEnd

Section /o "tl" tl
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\tl"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\tl\*.*" "$INSTDIR\App\${APP}$WIN\locale\tl"
SectionEnd

Section /o "tr" tr
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\tr"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\tr\*.*" "$INSTDIR\App\${APP}$WIN\locale\tr"
SectionEnd

Section /o "uk" uk
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\uk"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\uk\*.*" "$INSTDIR\App\${APP}$WIN\locale\uk"
SectionEnd

Section /o "zh_CN" zh_CN
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\zh_CN"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\zh_CN\*.*" "$INSTDIR\App\${APP}$WIN\locale\zh_CN"
SectionEnd

Section /o "zh_TW" zh_TW
SetOutPath "$INSTDIR\App\${APP}$WIN\locale\zh_TW"
CopyFiles /SILENT "$TEMP\${APP}PortableTemp\locale\zh_TW\*.*" "$INSTDIR\App\${APP}$WIN\locale\zh_TW"
SectionEnd

SectionGroupEnd

Function MultiLang
Push ""
Push win32
Push "32 bit"
Push win64
Push "64 bit"
Push A
LangDLL::LangDialog "${APPNAME} Portable Version" "Please select architecture."
Pop $WIN
StrCmp $WIN "cancel" 0 +2
Abort
FunctionEnd

Function .onGUIEnd

; ${If} ${FileExists} "$INSTDIR\App\${APP}_64\vlc.exe"
; ${AndIf} ${FileExists} "$INSTDIR\App\${APP}\vlc.exe"
; SetOutPath "$INSTDIR\App\${APP}_64\locale"
; CopyFiles /SILENT "$INSTDIR\App\${APP}\locale\*.*" "$INSTDIR\App\${APP}_64\locale\"
; ${Else}

; ${EndIf}

RMDir "/r" "$TEMP\${APP}PortableTemp"
FunctionEnd

Function Init
SectionSetSize ${x64} 83000 # kB
${If} ${RunningX64}
SectionSetFlags ${x64} 1
${Else}
${EndIf}

SectionSetSize ${af} 580 # kB
SectionSetSize ${ar} 580 # kB
SectionSetSize ${bg} 580 # kB
SectionSetSize ${ca} 580 # kB
SectionSetSize ${ca} 580 # kB
SectionSetSize ${cs} 580 # kB
SectionSetSize ${da} 580 # kB
SectionSetSize ${de} 580 # kB
SectionSetSize ${el} 580 # kB
SectionSetSize ${es} 580 # kB
SectionSetSize ${eu} 580 # kB
SectionSetSize ${eu} 580 # kB
SectionSetSize ${fi} 580 # kB
SectionSetSize ${fr} 580 # kB
SectionSetSize ${gl} 580 # kB
SectionSetSize ${he} 580 # kB
SectionSetSize ${hu} 580 # kB
SectionSetSize ${it} 580 # kB
SectionSetSize ${ja} 580 # kB
SectionSetSize ${ko} 580 # kB
SectionSetSize ${lt} 580 # kB
SectionSetSize ${ms} 580 # kB
SectionSetSize ${nb} 580 # kB
SectionSetSize ${nl} 580 # kB
SectionSetSize ${oc} 580 # kB
SectionSetSize ${pl} 580 # kB
SectionSetSize ${pt_BR} 580 # kB
SectionSetSize ${pt_PT} 580 # kB
SectionSetSize ${ro} 580 # kB
SectionSetSize ${ru} 580 # kB
SectionSetSize ${sk} 580 # kB
SectionSetSize ${sl} 580 # kB
SectionSetSize ${sq} 580 # kB
SectionSetSize ${sr} 580 # kB
SectionSetSize ${sv} 580 # kB
SectionSetSize ${th} 580 # kB
SectionSetSize ${tr} 580 # kB
SectionSetSize ${uk} 580 # kB
SectionSetSize ${zh_CN} 580 # kB
SectionSetSize ${zh_TW} 580 # kB

System::Call 'kernel32::GetUserDefaultLangID() i .r0'
StrCmp $0 "1078" 0 +2
SectionSetFlags ${af} 1
StrCmp $0 "1025" 0 +2
SectionSetFlags ${ar} 1
StrCmp $0 "1026" 0 +2
SectionSetFlags ${bg} 1
StrCmp $0 "1027" 0 +2
SectionSetFlags ${ca} 1
StrCmp $0 "1029" 0 +2
SectionSetFlags ${cs} 1
StrCmp $0 "1030" 0 +2
SectionSetFlags ${da} 1
StrCmp $0 "1031" 0 +2
SectionSetFlags ${de} 1
StrCmp $0 "1032" 0 +2
SectionSetFlags ${el} 1
StrCmp $0 "1034" 0 +2
SectionSetFlags ${es} 1
StrCmp $0 "1069" 0 +2
SectionSetFlags ${eu} 1
StrCmp $0 "1035" 0 +2
SectionSetFlags ${fi} 1
StrCmp $0 "1036" 0 +5
SectionSetFlags ${fr} 1
SectionSetFlags ${oc} 1
SectionSetFlags ${eu} 1
SectionSetFlags ${ca} 1
StrCmp $0 "1110" 0 +2
SectionSetFlags ${gl} 1
StrCmp $0 "1037" 0 +2
SectionSetFlags ${he} 1
StrCmp $0 "1038" 0 +2
SectionSetFlags ${hu} 1
StrCmp $0 "1040" 0 +2
SectionSetFlags ${it} 1
StrCmp $0 "1041" 0 +2
SectionSetFlags ${ja} 1
StrCmp $0 "1042" 0 +2
SectionSetFlags ${ko} 1
StrCmp $0 "1063" 0 +2
SectionSetFlags ${lt} 1
StrCmp $0 "1086" 0 +2
SectionSetFlags ${ms} 1
StrCmp $0 "1044" 0 +2
SectionSetFlags ${nb} 1
StrCmp $0 "1043" 0 +2
SectionSetFlags ${nl} 1
StrCmp $0 "1045" 0 +2
SectionSetFlags ${pl} 1
StrCmp $0 "2070" 0 +2
SectionSetFlags ${pt_PT} 1
StrCmp $0 "1046" 0 +2
SectionSetFlags ${pt_BR} 1
StrCmp $0 "1048" 0 +2
SectionSetFlags ${ro} 1
StrCmp $0 "1049" 0 +2
SectionSetFlags ${ru} 1
StrCmp $0 "1051" 0 +2
SectionSetFlags ${sk} 1
StrCmp $0 "1060" 0 +2
SectionSetFlags ${sl} 1
StrCmp $0 "1052" 0 +2
SectionSetFlags ${sq} 1
StrCmp $0 "3098" 0 +2
SectionSetFlags ${sr} 1
StrCmp $0 "1053" 0 +2
SectionSetFlags ${sv} 1
StrCmp $0 "1054" 0 +2
SectionSetFlags ${th} 1
StrCmp $0 "1055" 0 +2
SectionSetFlags ${tr} 1
StrCmp $0 "1058" 0 +2
SectionSetFlags ${uk} 1
StrCmp $0 "2052" 0 +2
SectionSetFlags ${zh_CN} 1
StrCmp $0 "1028" 0 +2
SectionSetFlags ${zh_TW} 1
FunctionEnd
