- More strings translatable (K/M/G Byte, registering, unregistering)
- Language specific fonts - $\t now works too - More to do git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2475 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
526ecc097b
commit
cf01b06e62
43 changed files with 498 additions and 106 deletions
|
@ -2,6 +2,11 @@
|
||||||
NLF v2
|
NLF v2
|
||||||
# رقم اللغة
|
# رقم اللغة
|
||||||
1025
|
1025
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by asdfuae@msn.com
|
# Translation by asdfuae@msn.com
|
||||||
نظام التنصيب نلسوفت %s
|
نظام التنصيب نلسوفت %s
|
||||||
تنصيب %s
|
تنصيب %s
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v2
|
NLF v2
|
||||||
# Language ID
|
# Language ID
|
||||||
1026
|
1026
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by Asparouh Kalyandjiev <acnapyx@computers.bg>
|
# Translation by Asparouh Kalyandjiev <acnapyx@computers.bg>
|
||||||
Nullsoft èíñòàëàòîð %s
|
Nullsoft èíñòàëàòîð %s
|
||||||
%s Èíñòàëèðàíå
|
%s Èíñòàëèðàíå
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v3
|
NLF v3
|
||||||
# Language ID
|
# Language ID
|
||||||
1027
|
1027
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by falanko
|
# Translation by falanko
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
Instal·lació de %s
|
Instal·lació de %s
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v2
|
NLF v2
|
||||||
# Language ID
|
# Language ID
|
||||||
1050
|
1050
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by Vedran "RIV@NVX" Miletic
|
# Translation by Vedran "RIV@NVX" Miletic
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
%s Instalacija
|
%s Instalacija
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v2
|
NLF v2
|
||||||
# Language ID
|
# Language ID
|
||||||
1029
|
1029
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by T.V. Zuggy (http://zuggy.wz.cz/)
|
# Translation by T.V. Zuggy (http://zuggy.wz.cz/)
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
Instalace programu %s
|
Instalace programu %s
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v2
|
NLF v2
|
||||||
# Language ID
|
# Language ID
|
||||||
1030
|
1030
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by Casper Bergenstoff
|
# Translation by Casper Bergenstoff
|
||||||
Nullsoft Installerings System %s
|
Nullsoft Installerings System %s
|
||||||
%s Setup
|
%s Setup
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v3
|
NLF v3
|
||||||
# Language ID
|
# Language ID
|
||||||
1043
|
1043
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by Hendri Adriaens & Joost Verburg
|
# Translation by Hendri Adriaens & Joost Verburg
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
%s Installatie
|
%s Installatie
|
||||||
|
|
|
@ -1,7 +1,13 @@
|
||||||
# Header, don't edit
|
# Header, don't edit
|
||||||
NLF v3
|
NLF v4
|
||||||
|
# Start editing here
|
||||||
# Language ID
|
# Language ID
|
||||||
1033
|
1033
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by ..... (any credits should go here)
|
# Translation by ..... (any credits should go here)
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
%s Setup
|
%s Setup
|
||||||
|
@ -39,6 +45,8 @@ Error opening file for writing: \r\n\t"$0"\r\nHit abort to abort installation,\r
|
||||||
Can't write:
|
Can't write:
|
||||||
Copy failed
|
Copy failed
|
||||||
Copy to
|
Copy to
|
||||||
|
Registering:
|
||||||
|
Unregistering:
|
||||||
Could not find symbol:
|
Could not find symbol:
|
||||||
Could not load:
|
Could not load:
|
||||||
Create folder:
|
Create folder:
|
||||||
|
@ -61,4 +69,13 @@ Remove folder:
|
||||||
Rename on reboot:
|
Rename on reboot:
|
||||||
Rename:
|
Rename:
|
||||||
Skipped:
|
Skipped:
|
||||||
Copy Details To Clipboard
|
Copy Details To Clipboard
|
||||||
|
Log install process
|
||||||
|
# byte
|
||||||
|
B
|
||||||
|
# kilo
|
||||||
|
K
|
||||||
|
# mega
|
||||||
|
M
|
||||||
|
# giga
|
||||||
|
G
|
|
@ -2,7 +2,13 @@
|
||||||
NLF v3
|
NLF v3
|
||||||
# Language ID
|
# Language ID
|
||||||
1036
|
1036
|
||||||
# Translation by the French NSIS team <veekee@winampfr.com> - http://www.winampfr.com/nsis. Updated by Sébastien Delahaye <seb@delahaye.net>.
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
|
# Translation by the French NSIS team <veekee@winampfr.com> - http://www.winampfr.com/nsis
|
||||||
|
# Updated by Sébastien Delahaye <seb@delahaye.net>
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
Installation de %s
|
Installation de %s
|
||||||
Désinstallation de %s
|
Désinstallation de %s
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v3
|
NLF v3
|
||||||
# Language ID
|
# Language ID
|
||||||
1031
|
1031
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by L.King, changes by R. Bisswanger
|
# Translation by L.King, changes by R. Bisswanger
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
%s Installation
|
%s Installation
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v3
|
NLF v3
|
||||||
# Language ID
|
# Language ID
|
||||||
1032
|
1032
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by Makidis N. Mike
|
# Translation by Makidis N. Mike
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
ÅãêáôÜóôáóç ôïõ '%s'
|
ÅãêáôÜóôáóç ôïõ '%s'
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v3
|
NLF v3
|
||||||
# Language ID
|
# Language ID
|
||||||
1037
|
1037
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by Amir Szekely (aka KiCHiK)
|
# Translation by Amir Szekely (aka KiCHiK)
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
äú÷ðú %s
|
äú÷ðú %s
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v3
|
NLF v3
|
||||||
# Language ID
|
# Language ID
|
||||||
1038
|
1038
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by Soft-Trans Bt. (V2)
|
# Translation by Soft-Trans Bt. (V2)
|
||||||
# Translation by Orfanik Kft. (V3)
|
# Translation by Orfanik Kft. (V3)
|
||||||
Nullsoft Telepítõrendszer %s
|
Nullsoft Telepítõrendszer %s
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v2
|
NLF v2
|
||||||
# Language ID
|
# Language ID
|
||||||
1040
|
1040
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by Orfanik - http://www.orfanik.hu
|
# Translation by Orfanik - http://www.orfanik.hu
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
Installazione di %s
|
Installazione di %s
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v2
|
NLF v2
|
||||||
# Language ID
|
# Language ID
|
||||||
1041
|
1041
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by Dnanako
|
# Translation by Dnanako
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
%s セットアップ
|
%s セットアップ
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v3
|
NLF v3
|
||||||
# Language ID
|
# Language ID
|
||||||
1042
|
1042
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by dTomoyo <dtomoyo@empal.com> - http://user.chol.com/~ckgfx # Modified by koder@popdesk.co.kr
|
# Translation by dTomoyo <dtomoyo@empal.com> - http://user.chol.com/~ckgfx # Modified by koder@popdesk.co.kr
|
||||||
널소프트 설치 시스템 %s
|
널소프트 설치 시스템 %s
|
||||||
%s 설치
|
%s 설치
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v3
|
NLF v3
|
||||||
# Language ID
|
# Language ID
|
||||||
1063
|
1063
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by NorCis
|
# Translation by NorCis
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
%s Idiegimas
|
%s Idiegimas
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v2
|
NLF v2
|
||||||
# Language ID
|
# Language ID
|
||||||
1071
|
1071
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by Sasko Zdravkin [vardarce@mail.com]
|
# Translation by Sasko Zdravkin [vardarce@mail.com]
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
%s Èíñòàëèðàœå
|
%s Èíñòàëèðàœå
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v3
|
NLF v3
|
||||||
# Language ID
|
# Language ID
|
||||||
1045
|
1045
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by Piotr Murawski & Rafa³ Lampe <ppiter@skrzynka.pl> - www.lomsel.prv.pl
|
# Translation by Piotr Murawski & Rafa³ Lampe <ppiter@skrzynka.pl> - www.lomsel.prv.pl
|
||||||
# corrections, additions by cube cube(at)lp.net.pl
|
# corrections, additions by cube cube(at)lp.net.pl
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v2
|
NLF v2
|
||||||
# Language ID
|
# Language ID
|
||||||
2070
|
2070
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by DragonSoull <dragonsoull@madalien.tk> version 0.91
|
# Translation by DragonSoull <dragonsoull@madalien.tk> version 0.91
|
||||||
Sistema de Instalação Nullsoft %s
|
Sistema de Instalação Nullsoft %s
|
||||||
Instalação de %s
|
Instalação de %s
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v3
|
NLF v3
|
||||||
# Language ID
|
# Language ID
|
||||||
1046
|
1046
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by Diego Marcos <jump@osite.com.br>
|
# Translation by Diego Marcos <jump@osite.com.br>
|
||||||
Sistema de Instalação Nullsoft %s
|
Sistema de Instalação Nullsoft %s
|
||||||
Instalação do %s
|
Instalação do %s
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v3
|
NLF v3
|
||||||
# Language ID
|
# Language ID
|
||||||
1048
|
1048
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by Cristian Pirvu (pcristip@yahoo.com) v0.2 Updated by Sorin Sbarnea INTERSOL SRL (sorin@intersol.ro) v0.3
|
# Translation by Cristian Pirvu (pcristip@yahoo.com) v0.2 Updated by Sorin Sbarnea INTERSOL SRL (sorin@intersol.ro) v0.3
|
||||||
# v0.4 - small grammar corrections
|
# v0.4 - small grammar corrections
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v3
|
NLF v3
|
||||||
# Language ID
|
# Language ID
|
||||||
1049
|
1049
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by Sergey `Timon` Kusnetsov <tmn@hotbox.ru>
|
# Translation by Sergey `Timon` Kusnetsov <tmn@hotbox.ru>
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
%s Óñòàíîâêà
|
%s Óñòàíîâêà
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v3
|
NLF v3
|
||||||
# Language ID
|
# Language ID
|
||||||
2052
|
2052
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by Kii Ali <kiiali@cpatch.org>, Revision Date: 2003-03-29
|
# Translation by Kii Ali <kiiali@cpatch.org>, Revision Date: 2003-03-29
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
%s °²×°
|
%s °²×°
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v3
|
NLF v3
|
||||||
# Language ID
|
# Language ID
|
||||||
1051
|
1051
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by trace & Kypec
|
# Translation by trace & Kypec
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
Inštalácia %s
|
Inštalácia %s
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v3
|
NLF v3
|
||||||
# Language ID
|
# Language ID
|
||||||
1034
|
1034
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by MoNKi
|
# Translation by MoNKi
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
Instalación de %s
|
Instalación de %s
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v2
|
NLF v2
|
||||||
# Language ID
|
# Language ID
|
||||||
1053
|
1053
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by Peter Gustafsson <sm5tri@passagen.se>
|
# Translation by Peter Gustafsson <sm5tri@passagen.se>
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
%s Installation
|
%s Installation
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v2
|
NLF v2
|
||||||
# Language ID
|
# Language ID
|
||||||
1054
|
1054
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by TuW@nNu tuwannu@hotmail.com (asdfuae)
|
# Translation by TuW@nNu tuwannu@hotmail.com (asdfuae)
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
%s µÔ´µÑé§
|
%s µÔ´µÑé§
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v3
|
NLF v3
|
||||||
# Language ID
|
# Language ID
|
||||||
1028
|
1028
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by Kii Ali <kiiali@cpatch.org>, Revision Date: 2003-03-29
|
# Translation by Kii Ali <kiiali@cpatch.org>, Revision Date: 2003-03-29
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
%s ¦w¸Ë
|
%s ¦w¸Ë
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
# Turkish NSIS Language File
|
# Turkish NSIS Language File
|
||||||
NLF v2
|
NLF v3
|
||||||
# Language ID
|
# Language ID
|
||||||
1055
|
1055
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by Bertan Kodamanoglu (astoichen@soultrap.com)
|
# Translation by Bertan Kodamanoglu (astoichen@soultrap.com)
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
%s Kurulumu
|
%s Kurulumu
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
NLF v3
|
NLF v3
|
||||||
# Language ID
|
# Language ID
|
||||||
1058
|
1058
|
||||||
|
# Font and size - dash (-) means default
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# Codepage - dash (-) means ANSI code page
|
||||||
|
-
|
||||||
# Translation by Yuri Holubow, Our Soft <http://www.Nash-Soft.com/home>
|
# Translation by Yuri Holubow, Our Soft <http://www.Nash-Soft.com/home>
|
||||||
Nullsoft Install System %s
|
Nullsoft Install System %s
|
||||||
%s Óñòàíîâêà
|
%s Óñòàíîâêà
|
||||||
|
|
|
@ -36,7 +36,7 @@ inline DWORD WCStrLen(WCHAR* szwStr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reads a variany length array from seeker into readInto and advances seeker
|
// Reads a variany length array from seeker into readInto and advances seeker
|
||||||
void ReadVarLenArr(BYTE* &seeker, char* &readInto) {
|
void ReadVarLenArr(BYTE* &seeker, char* &readInto, unsigned int uCodePage) {
|
||||||
WORD* arr = (WORD*)seeker;
|
WORD* arr = (WORD*)seeker;
|
||||||
switch (arr[0]) {
|
switch (arr[0]) {
|
||||||
case 0x0000:
|
case 0x0000:
|
||||||
|
@ -49,9 +49,9 @@ void ReadVarLenArr(BYTE* &seeker, char* &readInto) {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
int iStrLen = WideCharToMultiByte(CP_ACP, 0, (WCHAR*)arr, -1, 0, 0, 0, 0);
|
int iStrLen = WideCharToMultiByte(uCodePage, 0, (WCHAR*)arr, -1, 0, 0, 0, 0);
|
||||||
readInto = new char[iStrLen];
|
readInto = new char[iStrLen];
|
||||||
WideCharToMultiByte(CP_ACP, 0, (WCHAR*)arr, -1, readInto, iStrLen, 0, 0);
|
WideCharToMultiByte(uCodePage, 0, (WCHAR*)arr, -1, readInto, iStrLen, 0, 0);
|
||||||
seeker += WCStrLen((WCHAR*)arr)*sizeof(WCHAR);
|
seeker += WCStrLen((WCHAR*)arr)*sizeof(WCHAR);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -68,7 +68,7 @@ void ReadVarLenArr(BYTE* &seeker, char* &readInto) {
|
||||||
seeker += sizeof(WORD); \
|
seeker += sizeof(WORD); \
|
||||||
} \
|
} \
|
||||||
else { \
|
else { \
|
||||||
int us = MultiByteToWideChar(CP_ACP, 0, x, -1, (WCHAR*)seeker, dwSize); \
|
int us = MultiByteToWideChar(m_uCodePage, 0, x, -1, (WCHAR*)seeker, dwSize); \
|
||||||
seeker += us*sizeof(WCHAR); \
|
seeker += us*sizeof(WCHAR); \
|
||||||
} \
|
} \
|
||||||
else \
|
else \
|
||||||
|
@ -81,7 +81,9 @@ void ReadVarLenArr(BYTE* &seeker, char* &readInto) {
|
||||||
// Construction/Destruction
|
// Construction/Destruction
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
CDialogTemplate::CDialogTemplate(BYTE* pbData) {
|
CDialogTemplate::CDialogTemplate(BYTE* pbData, unsigned int uCodePage) {
|
||||||
|
m_uCodePage = uCodePage;
|
||||||
|
|
||||||
m_szClass = 0;
|
m_szClass = 0;
|
||||||
m_szFont = 0;
|
m_szFont = 0;
|
||||||
m_szMenu = 0;
|
m_szMenu = 0;
|
||||||
|
@ -121,11 +123,11 @@ CDialogTemplate::CDialogTemplate(BYTE* pbData) {
|
||||||
BYTE* seeker = pbData + (m_bExtended ? sizeof(DLGTEMPLATEEX) : sizeof(DLGTEMPLATE));
|
BYTE* seeker = pbData + (m_bExtended ? sizeof(DLGTEMPLATEEX) : sizeof(DLGTEMPLATE));
|
||||||
|
|
||||||
// Read menu variant length array
|
// Read menu variant length array
|
||||||
ReadVarLenArr(seeker, m_szMenu);
|
ReadVarLenArr(seeker, m_szMenu, m_uCodePage);
|
||||||
// Read class variant length array
|
// Read class variant length array
|
||||||
ReadVarLenArr(seeker, m_szClass);
|
ReadVarLenArr(seeker, m_szClass, m_uCodePage);
|
||||||
// Read title variant length array
|
// Read title variant length array
|
||||||
ReadVarLenArr(seeker, m_szTitle);
|
ReadVarLenArr(seeker, m_szTitle, m_uCodePage);
|
||||||
// Read font size and variant length array (only if style DS_SETFONT is used!)
|
// Read font size and variant length array (only if style DS_SETFONT is used!)
|
||||||
if (m_dwStyle & DS_SETFONT) {
|
if (m_dwStyle & DS_SETFONT) {
|
||||||
m_sFontSize = *(short*)seeker;
|
m_sFontSize = *(short*)seeker;
|
||||||
|
@ -138,7 +140,7 @@ CDialogTemplate::CDialogTemplate(BYTE* pbData) {
|
||||||
m_bCharset = *(BYTE*)seeker;
|
m_bCharset = *(BYTE*)seeker;
|
||||||
seeker += sizeof(BYTE);
|
seeker += sizeof(BYTE);
|
||||||
}
|
}
|
||||||
ReadVarLenArr(seeker, m_szFont);
|
ReadVarLenArr(seeker, m_szFont, m_uCodePage);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read items
|
// Read items
|
||||||
|
@ -179,9 +181,9 @@ CDialogTemplate::CDialogTemplate(BYTE* pbData) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read class variant length array
|
// Read class variant length array
|
||||||
ReadVarLenArr(seeker, item->szClass);
|
ReadVarLenArr(seeker, item->szClass, m_uCodePage);
|
||||||
// Read title variant length array
|
// Read title variant length array
|
||||||
ReadVarLenArr(seeker, item->szTitle);
|
ReadVarLenArr(seeker, item->szTitle, m_uCodePage);
|
||||||
|
|
||||||
// Read creation data variant length array
|
// Read creation data variant length array
|
||||||
// First read the size of the array (no null termination)
|
// First read the size of the array (no null termination)
|
||||||
|
|
|
@ -89,7 +89,7 @@ typedef struct {
|
||||||
|
|
||||||
class CDialogTemplate {
|
class CDialogTemplate {
|
||||||
public:
|
public:
|
||||||
CDialogTemplate(BYTE* pbData);
|
CDialogTemplate(BYTE* pbData, unsigned int uCodePage=CP_ACP);
|
||||||
virtual ~CDialogTemplate();
|
virtual ~CDialogTemplate();
|
||||||
|
|
||||||
short GetWidth();
|
short GetWidth();
|
||||||
|
@ -135,6 +135,9 @@ private:
|
||||||
BYTE m_bCharset; // Extended only
|
BYTE m_bCharset; // Extended only
|
||||||
char* m_szFont;
|
char* m_szFont;
|
||||||
|
|
||||||
|
// For (en/de)coding Unicode
|
||||||
|
unsigned int m_uCodePage;
|
||||||
|
|
||||||
// Items vector
|
// Items vector
|
||||||
vector<DialogItemTemplate*> m_vItems;
|
vector<DialogItemTemplate*> m_vItems;
|
||||||
};
|
};
|
||||||
|
|
|
@ -17,11 +17,12 @@ void CEXEBuild::define(const char *p, const char *v)
|
||||||
definedlist.add(p,v);
|
definedlist.add(p,v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CEXEBuild::~CEXEBuild()
|
CEXEBuild::~CEXEBuild()
|
||||||
{
|
{
|
||||||
free(header_data_new);
|
free(header_data_new);
|
||||||
free(m_unicon_data);
|
free(m_unicon_data);
|
||||||
|
for (unsigned int i = 0; i < build_nlfs.size(); i++)
|
||||||
|
delete build_nlfs[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
CEXEBuild::CEXEBuild()
|
CEXEBuild::CEXEBuild()
|
||||||
|
@ -308,8 +309,12 @@ CEXEBuild::CEXEBuild()
|
||||||
install_used=false;
|
install_used=false;
|
||||||
comppage_used=false;
|
comppage_used=false;
|
||||||
license_force_radio_used=false;
|
license_force_radio_used=false;
|
||||||
|
register_used=false;
|
||||||
|
unregister_used=false;
|
||||||
|
|
||||||
notify_hwnd=0;
|
notify_hwnd=0;
|
||||||
|
|
||||||
|
uDefCodePage=CP_ACP;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CEXEBuild::getcurdbsize() { return cur_datablock->getlen(); }
|
int CEXEBuild::getcurdbsize() { return cur_datablock->getlen(); }
|
||||||
|
@ -1559,6 +1564,9 @@ int CEXEBuild::write_output(void)
|
||||||
}
|
}
|
||||||
#endif // NSIS_CONFIG_VISIBLE_SUPPORT
|
#endif // NSIS_CONFIG_VISIBLE_SUPPORT
|
||||||
|
|
||||||
|
// Generate language tables
|
||||||
|
if (WriteStringTables() == PS_ERROR) return PS_ERROR;
|
||||||
|
|
||||||
// Save all changes to the exe header
|
// Save all changes to the exe header
|
||||||
try {
|
try {
|
||||||
close_res_editor();
|
close_res_editor();
|
||||||
|
@ -1568,9 +1576,6 @@ int CEXEBuild::write_output(void)
|
||||||
return PS_ERROR;
|
return PS_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate language tables
|
|
||||||
if (WriteStringTables() == PS_ERROR) return PS_ERROR;
|
|
||||||
|
|
||||||
// Pack exe header if asked for
|
// Pack exe header if asked for
|
||||||
if (build_packname[0] && build_packcmd[0])
|
if (build_packname[0] && build_packcmd[0])
|
||||||
{
|
{
|
||||||
|
|
|
@ -154,13 +154,15 @@ class CEXEBuild {
|
||||||
int GetUserString(char *name);
|
int GetUserString(char *name);
|
||||||
int SetUserString(char *name, LANGID lang, char *string, int process=1);
|
int SetUserString(char *name, LANGID lang, char *string, int process=1);
|
||||||
int WriteStringTables();
|
int WriteStringTables();
|
||||||
void FillDefaultsIfNeeded(StringTable *table, NLF *nlf=0);
|
void FillStringTable(StringTable *table, NLF *nlf=0);
|
||||||
#define IsNotSet(s) _IsNotSet(string_tables.size()?&(string_tables[0]->s):0)
|
#define IsNotSet(s) _IsNotSet(string_tables.size()?&(string_tables[0]->s):0)
|
||||||
bool _IsNotSet(int *str); // Checks if a string is not set in all of the string tables
|
bool _IsNotSet(int *str); // Checks if a string is not set in all of the string tables
|
||||||
#define IsSet(s,lang) _IsSet(string_tables.size()?&(string_tables[0]->s):0,lang)
|
#define IsSet(s,lang) _IsSet(string_tables.size()?&(string_tables[0]->s):0,lang)
|
||||||
bool _IsSet(int *str, LANGID lang); // Checks if a string is set in a given string table
|
bool _IsSet(int *str, LANGID lang); // Checks if a string is set in a given string table
|
||||||
|
|
||||||
bool next_used, install_used, comppage_used, license_force_radio_used;
|
unsigned int uDefCodePage;
|
||||||
|
|
||||||
|
bool next_used, install_used, comppage_used, license_force_radio_used, register_used, unregister_used;
|
||||||
|
|
||||||
// a whole bunch O data.
|
// a whole bunch O data.
|
||||||
|
|
||||||
|
@ -205,21 +207,21 @@ class CEXEBuild {
|
||||||
db_comp_save_u, db_full_size_u;
|
db_comp_save_u, db_full_size_u;
|
||||||
int build_sections_req,build_sections_div;
|
int build_sections_req,build_sections_div;
|
||||||
|
|
||||||
StringList include_dirs;
|
FastStringList include_dirs;
|
||||||
|
|
||||||
StringList ns_func; // function namespace
|
StringList ns_func; // function namespace
|
||||||
StringList ns_label; // label namespace
|
StringList ns_label; // label namespace
|
||||||
|
|
||||||
int build_cursection_isfunc;
|
int build_cursection_isfunc;
|
||||||
section *build_cursection;
|
section *build_cursection;
|
||||||
GrowBuf build_sections;
|
TinyGrowBuf build_sections;
|
||||||
GrowBuf build_entries,ubuild_entries, *cur_entries;
|
GrowBuf build_entries,ubuild_entries, *cur_entries;
|
||||||
GrowBuf build_functions, ubuild_functions, *cur_functions;
|
TinyGrowBuf build_functions, ubuild_functions, *cur_functions;
|
||||||
GrowBuf build_labels, ubuild_labels, *cur_labels;
|
TinyGrowBuf build_labels, ubuild_labels, *cur_labels;
|
||||||
StringList build_strlist, ubuild_strlist;
|
StringList build_strlist, ubuild_strlist;
|
||||||
GrowBuf build_langtables, ubuild_langtables;
|
GrowBuf build_langtables, ubuild_langtables;
|
||||||
LangStringList build_userlangstrings, ubuild_userlangstrings;
|
LangStringList build_userlangstrings, ubuild_userlangstrings;
|
||||||
GrowBuf build_pages, ubuild_pages;
|
TinyGrowBuf build_pages, ubuild_pages;
|
||||||
|
|
||||||
char build_last_page_define[1024], ubuild_last_page_define[1024];
|
char build_last_page_define[1024], ubuild_last_page_define[1024];
|
||||||
int build_custom_used, ubuild_custom_used;
|
int build_custom_used, ubuild_custom_used;
|
||||||
|
|
|
@ -43,6 +43,7 @@ HICON g_hIcon;
|
||||||
// Added by Amir Szekely 3rd August 2002
|
// Added by Amir Szekely 3rd August 2002
|
||||||
char *language_tables;
|
char *language_tables;
|
||||||
int *cur_language_table;
|
int *cur_language_table;
|
||||||
|
int dlg_offset;
|
||||||
|
|
||||||
int g_quit_flag; // set when Quit has been called (meaning bail out ASAP)
|
int g_quit_flag; // set when Quit has been called (meaning bail out ASAP)
|
||||||
|
|
||||||
|
@ -170,7 +171,8 @@ lang_again:
|
||||||
for (i = 0; i < lang_num; i++) {
|
for (i = 0; i < lang_num; i++) {
|
||||||
language_table=language_tables+i*g_inst_cmnheader->language_table_size;
|
language_table=language_tables+i*g_inst_cmnheader->language_table_size;
|
||||||
if (!((lang ^ *(LANGID*)language_table) & lang_mask)) {
|
if (!((lang ^ *(LANGID*)language_table) & lang_mask)) {
|
||||||
cur_language_table=(int*)(language_table+sizeof(LANGID));
|
dlg_offset=*(int*)(language_table+sizeof(LANGID));
|
||||||
|
cur_language_table=(int*)(language_table+sizeof(LANGID)+sizeof(int));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -323,7 +325,7 @@ int NSISCALL ui_doinstall(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return DialogBox(g_hInstance,MAKEINTRESOURCE(IDD_INST),0,DialogProc);
|
return DialogBox(g_hInstance,MAKEINTRESOURCE(IDD_INST+dlg_offset),0,DialogProc);
|
||||||
}
|
}
|
||||||
#endif//NSIS_CONFIG_VISIBLE_SUPPORT
|
#endif//NSIS_CONFIG_VISIBLE_SUPPORT
|
||||||
#ifdef NSIS_CONFIG_SILENT_SUPPORT
|
#ifdef NSIS_CONFIG_SILENT_SUPPORT
|
||||||
|
@ -371,22 +373,22 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
page *this_page;
|
page *this_page;
|
||||||
static struct
|
static struct
|
||||||
{
|
{
|
||||||
char *id;
|
unsigned int id;
|
||||||
DLGPROC proc;
|
DLGPROC proc;
|
||||||
}
|
}
|
||||||
windows[]=
|
windows[]=
|
||||||
{
|
{
|
||||||
#ifdef NSIS_CONFIG_LICENSEPAGE
|
#ifdef NSIS_CONFIG_LICENSEPAGE
|
||||||
{MAKEINTRESOURCE(IDD_LICENSE),LicenseProc},
|
{IDD_LICENSE,LicenseProc},
|
||||||
#endif
|
#endif
|
||||||
#ifdef NSIS_CONFIG_COMPONENTPAGE
|
#ifdef NSIS_CONFIG_COMPONENTPAGE
|
||||||
{MAKEINTRESOURCE(IDD_SELCOM),SelProc},
|
{IDD_SELCOM,SelProc},
|
||||||
#endif
|
#endif
|
||||||
{MAKEINTRESOURCE(IDD_DIR),DirProc},
|
{IDD_DIR,DirProc},
|
||||||
{MAKEINTRESOURCE(IDD_INSTFILES),InstProc},
|
{IDD_INSTFILES,InstProc},
|
||||||
{NULL,NULL}, // imaginary completed page
|
{0,NULL}, // imaginary completed page
|
||||||
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
|
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
|
||||||
{MAKEINTRESOURCE(IDD_UNINST),UninstProc}
|
{IDD_UNINST,UninstProc}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -400,9 +402,8 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
SetDlgItemTextFromLang(hwndDlg,IDCANCEL,LANG_BTN_CANCEL);
|
SetDlgItemTextFromLang(hwndDlg,IDCANCEL,LANG_BTN_CANCEL);
|
||||||
SetDlgItemTextFromLang(hwndDlg,IDC_BACK,LANG_BTN_BACK);
|
SetDlgItemTextFromLang(hwndDlg,IDC_BACK,LANG_BTN_BACK);
|
||||||
#if defined(NSIS_SUPPORT_CODECALLBACKS) && defined(NSIS_CONFIG_ENHANCEDUI_SUPPORT)
|
#if defined(NSIS_SUPPORT_CODECALLBACKS) && defined(NSIS_CONFIG_ENHANCEDUI_SUPPORT)
|
||||||
if (!(g_quit_flag = ExecuteCodeSegment(g_inst_cmnheader->code_onGUIInit,NULL)))
|
g_quit_flag = ExecuteCodeSegment(g_inst_cmnheader->code_onGUIInit,NULL);
|
||||||
#endif
|
#endif
|
||||||
ShowWindow(hwndDlg,SW_SHOW);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this_page=g_inst_page+m_page;
|
this_page=g_inst_page+m_page;
|
||||||
|
@ -470,7 +471,11 @@ nextPage:
|
||||||
|
|
||||||
if (this_page->id>=0) // NSIS page
|
if (this_page->id>=0) // NSIS page
|
||||||
{
|
{
|
||||||
m_curwnd=CreateDialog(g_hInstance,windows[this_page->id].id,hwndDlg,windows[this_page->id].proc);
|
m_curwnd=CreateDialog(
|
||||||
|
g_hInstance,
|
||||||
|
MAKEINTRESOURCE(windows[this_page->id].id+dlg_offset),
|
||||||
|
hwndDlg,windows[this_page->id].proc
|
||||||
|
);
|
||||||
if (m_curwnd)
|
if (m_curwnd)
|
||||||
{
|
{
|
||||||
RECT r;
|
RECT r;
|
||||||
|
@ -669,12 +674,12 @@ static BOOL CALLBACK UninstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
||||||
static char * NSISCALL inttosizestr(int kb, char *str)
|
static char * NSISCALL inttosizestr(int kb, char *str)
|
||||||
{
|
{
|
||||||
char sh=20;
|
char sh=20;
|
||||||
char c='G';
|
char s=0;
|
||||||
char s=0;;
|
int scale=LANG_GIGA;
|
||||||
if (kb < 1024) { sh=0; c='K'; }
|
if (kb < 1024) { sh=0; scale=LANG_KILO; }
|
||||||
else if (kb < 1024*1024) { sh=10; c='M'; }
|
else if (kb < 1024*1024) { sh=10; scale=LANG_MEGA; }
|
||||||
else if (GetVersion()&0x80000000) s='+';//only display the + on GB shown on win9x.
|
else if (GetVersion()&0x80000000) s='+';//only display the + on GB shown on win9x.
|
||||||
wsprintf(str+mystrlen(str),"%d.%d%cB%c",kb>>sh,((kb*10)>>sh)%10,c,s);
|
wsprintf(str+mystrlen(str),"%d.%d%s%s%c",kb>>sh,((kb*10)>>sh)%10,LANG_STR(scale),LANG_STR(LANG_BYTE),s);
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -695,7 +700,7 @@ static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
||||||
if (GetAsyncKeyState(VK_SHIFT)&0x8000)
|
if (GetAsyncKeyState(VK_SHIFT)&0x8000)
|
||||||
{
|
{
|
||||||
HWND h=GetUIItem(IDC_CHECK1);
|
HWND h=GetUIItem(IDC_CHECK1);
|
||||||
my_SetWindowText(h,"Log install process");
|
my_SetWindowText(h,LANG_STR(LANG_LOG_INSTALL_PROCESS));
|
||||||
ShowWindow(h,SW_SHOWNA);
|
ShowWindow(h,SW_SHOWNA);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -938,8 +938,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
||||||
g_flags.exec_error--;
|
g_flags.exec_error--;
|
||||||
if (parm2)
|
if (parm2)
|
||||||
{
|
{
|
||||||
char *buf2=process_string_fromparm_tobuf(0x22);
|
update_status_text_from_lang(parm2,buf1);
|
||||||
update_status_text(buf2,buf1);
|
|
||||||
if (funke()) g_flags.exec_error++;
|
if (funke()) g_flags.exec_error++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -233,6 +233,13 @@ typedef struct
|
||||||
int closebutton; // "Close"
|
int closebutton; // "Close"
|
||||||
int completed;
|
int completed;
|
||||||
|
|
||||||
|
int copy_details;
|
||||||
|
|
||||||
|
int byte;
|
||||||
|
int kilo;
|
||||||
|
int mega;
|
||||||
|
int giga;
|
||||||
|
|
||||||
// processed strings
|
// processed strings
|
||||||
int subcaptions[5];
|
int subcaptions[5];
|
||||||
#endif
|
#endif
|
||||||
|
@ -253,6 +260,8 @@ typedef struct
|
||||||
int copy_to;
|
int copy_to;
|
||||||
#endif
|
#endif
|
||||||
#ifdef NSIS_SUPPORT_ACTIVEXREG
|
#ifdef NSIS_SUPPORT_ACTIVEXREG
|
||||||
|
int registering;
|
||||||
|
int unregistering;
|
||||||
int symbol_not_found;
|
int symbol_not_found;
|
||||||
int could_not_load;
|
int could_not_load;
|
||||||
int no_ole;
|
int no_ole;
|
||||||
|
@ -293,7 +302,9 @@ typedef struct
|
||||||
int inst_corrupted;
|
int inst_corrupted;
|
||||||
int output_dir;
|
int output_dir;
|
||||||
int create_dir;
|
int create_dir;
|
||||||
int copy_details;
|
#ifdef NSIS_CONFIG_LOG
|
||||||
|
int log_install_process;
|
||||||
|
#endif
|
||||||
} common_strings;
|
} common_strings;
|
||||||
|
|
||||||
// Flags for common_header.flags
|
// Flags for common_header.flags
|
||||||
|
|
|
@ -81,6 +81,13 @@
|
||||||
#define LANG_NAME (COMMON_STR(name))
|
#define LANG_NAME (COMMON_STR(name))
|
||||||
#define LANG_CAPTION (COMMON_STR(caption))
|
#define LANG_CAPTION (COMMON_STR(caption))
|
||||||
#define LANG_SUBCAPTION(x) (COMMON_STR(subcaptions[x]))
|
#define LANG_SUBCAPTION(x) (COMMON_STR(subcaptions[x]))
|
||||||
|
#define LANG_INSTCORRUPTED (COMMON_STR(inst_corrupted))
|
||||||
|
#define LANG_COPYDETAILS (COMMON_STR(copy_details))
|
||||||
|
#define LANG_LOG_INSTALL_PROCESS (COMMON_STR(log_install_process))
|
||||||
|
#define LANG_BYTE (COMMON_STR(byte))
|
||||||
|
#define LANG_KILO (COMMON_STR(kilo))
|
||||||
|
#define LANG_MEGA (COMMON_STR(mega))
|
||||||
|
#define LANG_GIGA (COMMON_STR(giga))
|
||||||
|
|
||||||
// instruction strings
|
// instruction strings
|
||||||
#define LANG_FILEERR (COMMON_STR(fileerrtext))
|
#define LANG_FILEERR (COMMON_STR(fileerrtext))
|
||||||
|
@ -108,7 +115,7 @@
|
||||||
#define LANG_COPYFAILED (COMMON_STR(copy_failed))
|
#define LANG_COPYFAILED (COMMON_STR(copy_failed))
|
||||||
#define LANG_ERRORCREATING (COMMON_STR(err_creating))
|
#define LANG_ERRORCREATING (COMMON_STR(err_creating))
|
||||||
#define LANG_CREATEDUNINST (COMMON_STR(created_uninst))
|
#define LANG_CREATEDUNINST (COMMON_STR(created_uninst))
|
||||||
#define LANG_INSTCORRUPTED (COMMON_STR(inst_corrupted))
|
#define LANG_REGISTERING (COMMON_STR(registering))
|
||||||
#define LANG_COPYDETAILS (COMMON_STR(copy_details))
|
#define LANG_UNREGISTERING (COMMON_STR(unregistering))
|
||||||
|
|
||||||
#endif//_NSIS_LANG_H_
|
#endif//_NSIS_LANG_H_
|
||||||
|
|
207
Source/lang.cpp
207
Source/lang.cpp
|
@ -4,6 +4,8 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "build.h"
|
#include "build.h"
|
||||||
|
#include "DialogTemplate.h"
|
||||||
|
#include "exehead\resource.h"
|
||||||
|
|
||||||
extern const char *NSIS_VERSION;
|
extern const char *NSIS_VERSION;
|
||||||
|
|
||||||
|
@ -44,6 +46,8 @@ char *english_strings[] = {
|
||||||
"Can't write: ",
|
"Can't write: ",
|
||||||
"Copy failed",
|
"Copy failed",
|
||||||
"Copy to ",
|
"Copy to ",
|
||||||
|
"Registering: ",
|
||||||
|
"Unregistering: ",
|
||||||
"Could not find symbol: ",
|
"Could not find symbol: ",
|
||||||
"Could not load: ",
|
"Could not load: ",
|
||||||
"Create folder: ",
|
"Create folder: ",
|
||||||
|
@ -66,7 +70,12 @@ char *english_strings[] = {
|
||||||
"Rename on reboot: ",
|
"Rename on reboot: ",
|
||||||
"Rename: ",
|
"Rename: ",
|
||||||
"Skipped: ",
|
"Skipped: ",
|
||||||
"Copy Details To Clipboard"
|
"Copy Details To Clipboard",
|
||||||
|
"Log install process",
|
||||||
|
"B",
|
||||||
|
"K",
|
||||||
|
"M",
|
||||||
|
"G"
|
||||||
};
|
};
|
||||||
|
|
||||||
StringTable* CEXEBuild::GetTable(LANGID &lang) {
|
StringTable* CEXEBuild::GetTable(LANGID &lang) {
|
||||||
|
@ -85,13 +94,15 @@ StringTable* CEXEBuild::GetTable(LANGID &lang) {
|
||||||
ERROR_MSG("Internal compiler error #12345: malloc(%d) failed\n",sizeof(StringTable));
|
ERROR_MSG("Internal compiler error #12345: malloc(%d) failed\n",sizeof(StringTable));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
memset(table, 0, sizeof(StringTable)-sizeof(GrowBuf)*2);
|
memset(table, 0, sizeof(LANGID) + sizeof(int) + sizeof(common_strings)*2 + sizeof(installer_strings) + sizeof(uninstall_strings));
|
||||||
|
table->nlf = 0;
|
||||||
|
|
||||||
table->lang_id = lang;
|
table->lang_id = lang;
|
||||||
|
|
||||||
table->user_strings.set_zeroing(1);
|
table->user_strings.set_zeroing(1);
|
||||||
table->user_ustrings.set_zeroing(1);
|
|
||||||
|
|
||||||
table->user_strings.resize(build_userlangstrings.getnum()*sizeof(int));
|
table->user_strings.resize(build_userlangstrings.getnum()*sizeof(int));
|
||||||
|
|
||||||
|
table->user_ustrings.set_zeroing(1);
|
||||||
table->user_ustrings.resize(ubuild_userlangstrings.getnum()*sizeof(int));
|
table->user_ustrings.resize(ubuild_userlangstrings.getnum()*sizeof(int));
|
||||||
|
|
||||||
string_tables.push_back(table);
|
string_tables.push_back(table);
|
||||||
|
@ -205,7 +216,7 @@ int CEXEBuild::SetUserString(char *name, LANGID lang, char *string, int process/
|
||||||
if (!table) return PS_ERROR;
|
if (!table) return PS_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
GrowBuf *user_strings = 0;
|
TinyGrowBuf *user_strings = 0;
|
||||||
LangStringList *user_strings_list = 0;
|
LangStringList *user_strings_list = 0;
|
||||||
bool uninst;
|
bool uninst;
|
||||||
if (!(uninst = !strnicmp(name,"un.",3))) {
|
if (!(uninst = !strnicmp(name,"un.",3))) {
|
||||||
|
@ -236,7 +247,7 @@ int CEXEBuild::SetUserString(char *name, LANGID lang, char *string, int process/
|
||||||
|
|
||||||
bool CEXEBuild::_IsSet(int *str, LANGID lang) {
|
bool CEXEBuild::_IsSet(int *str, LANGID lang) {
|
||||||
if (!str) return false;
|
if (!str) return false;
|
||||||
lang = lang?lang:build_nlfs.size()?build_nlfs[build_nlfs.size()-1]->GetLang():0;
|
lang = lang?lang:build_nlfs.size()?build_nlfs[build_nlfs.size()-1]->m_wLangId:0;
|
||||||
lang = lang?lang:string_tables.size()?string_tables[0]->lang_id:1033; // Default is English (1033)
|
lang = lang?lang:string_tables.size()?string_tables[0]->lang_id:1033; // Default is English (1033)
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
for (i = 0; i < string_tables.size(); i++) {
|
for (i = 0; i < string_tables.size(); i++) {
|
||||||
|
@ -262,9 +273,58 @@ int CEXEBuild::WriteStringTables() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fill tables with defaults (if needed) and with instruction strings
|
// Fill tables with defaults (if needed) and with instruction strings
|
||||||
|
// Create language specific resources (currently only dialogs with different fonts)
|
||||||
int st_num = string_tables.size();
|
int st_num = string_tables.size();
|
||||||
|
// if there is one string table then there is no need for two sets of dialogs
|
||||||
|
int cur_offset = st_num == 1 ? 0 : 100;
|
||||||
for (i = 0; i < st_num; i++)
|
for (i = 0; i < st_num; i++)
|
||||||
FillDefaultsIfNeeded(string_tables[i]);
|
{
|
||||||
|
FillStringTable(string_tables[i]);
|
||||||
|
if (string_tables[i]->nlf && string_tables[i]->nlf->m_szFont)
|
||||||
|
{
|
||||||
|
string_tables[i]->dlg_offset = cur_offset;
|
||||||
|
|
||||||
|
try {
|
||||||
|
init_res_editor();
|
||||||
|
|
||||||
|
#define ADD_FONT(id) { \
|
||||||
|
BYTE* dlg = res_editor->GetResource(RT_DIALOG, MAKEINTRESOURCE(id), MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)); \
|
||||||
|
if (dlg) { \
|
||||||
|
CDialogTemplate td(dlg,string_tables[i]->nlf->m_uCodePage); \
|
||||||
|
free(dlg); \
|
||||||
|
td.SetFont(string_tables[i]->nlf->m_szFont, string_tables[i]->nlf->m_iFontSize); \
|
||||||
|
DWORD dwSize; \
|
||||||
|
dlg = td.Save(dwSize); \
|
||||||
|
res_editor->UpdateResource(RT_DIALOG, MAKEINTRESOURCE(id+cur_offset), string_tables[i]->lang_id, dlg, dwSize); \
|
||||||
|
free(dlg); \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef NSIS_CONFIG_LICENSEPAGE
|
||||||
|
ADD_FONT(IDD_LICENSE);
|
||||||
|
#endif
|
||||||
|
ADD_FONT(IDD_DIR);
|
||||||
|
#ifdef NSIS_CONFIG_COMPONENTPAGE
|
||||||
|
ADD_FONT(IDD_SELCOM);
|
||||||
|
#endif
|
||||||
|
ADD_FONT(IDD_INST);
|
||||||
|
ADD_FONT(IDD_INSTFILES);
|
||||||
|
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
|
||||||
|
ADD_FONT(IDD_UNINST);
|
||||||
|
#endif
|
||||||
|
#ifdef NSIS_CONFIG_CRC_SUPPORT
|
||||||
|
ADD_FONT(IDD_VERIFY);
|
||||||
|
#endif
|
||||||
|
#undef SET_FONT
|
||||||
|
}
|
||||||
|
catch (exception& err) {
|
||||||
|
ERROR_MSG("Error while applying NLF font for %s: %s\n", err.what());
|
||||||
|
return PS_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
cur_offset += 100;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// check for missing LangStrings
|
// check for missing LangStrings
|
||||||
int userstrings_num = build_userlangstrings.getnum();
|
int userstrings_num = build_userlangstrings.getnum();
|
||||||
|
@ -296,6 +356,7 @@ int CEXEBuild::WriteStringTables() {
|
||||||
// Add string tables into their datablock
|
// Add string tables into their datablock
|
||||||
for (i = 0; i < st_num; i++) {
|
for (i = 0; i < st_num; i++) {
|
||||||
build_langtables.add(&string_tables[i]->lang_id, sizeof(LANGID));
|
build_langtables.add(&string_tables[i]->lang_id, sizeof(LANGID));
|
||||||
|
build_langtables.add(&string_tables[i]->dlg_offset, sizeof(int));
|
||||||
build_langtables.add(&string_tables[i]->common, sizeof(common_strings));
|
build_langtables.add(&string_tables[i]->common, sizeof(common_strings));
|
||||||
build_langtables.add(&string_tables[i]->installer, sizeof(installer_strings));
|
build_langtables.add(&string_tables[i]->installer, sizeof(installer_strings));
|
||||||
if (build_userlangstrings.getnum())
|
if (build_userlangstrings.getnum())
|
||||||
|
@ -306,6 +367,7 @@ int CEXEBuild::WriteStringTables() {
|
||||||
|
|
||||||
for (i = 0; i < st_num; i++) {
|
for (i = 0; i < st_num; i++) {
|
||||||
ubuild_langtables.add(&string_tables[i]->lang_id, sizeof(LANGID));
|
ubuild_langtables.add(&string_tables[i]->lang_id, sizeof(LANGID));
|
||||||
|
ubuild_langtables.add(&string_tables[i]->dlg_offset, sizeof(int));
|
||||||
ubuild_langtables.add(&string_tables[i]->ucommon, sizeof(common_strings));
|
ubuild_langtables.add(&string_tables[i]->ucommon, sizeof(common_strings));
|
||||||
ubuild_langtables.add(&string_tables[i]->uninstall, sizeof(uninstall_strings));
|
ubuild_langtables.add(&string_tables[i]->uninstall, sizeof(uninstall_strings));
|
||||||
if (ubuild_userlangstrings.getnum())
|
if (ubuild_userlangstrings.getnum())
|
||||||
|
@ -318,12 +380,12 @@ int CEXEBuild::WriteStringTables() {
|
||||||
return PS_OK;
|
return PS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEXEBuild::FillDefaultsIfNeeded(StringTable *table, NLF *nlf/*=0*/) {
|
void CEXEBuild::FillStringTable(StringTable *table, NLF *nlf/*=0*/) {
|
||||||
if (!nlf) {
|
if (!nlf) {
|
||||||
for (unsigned int i = 0; i < build_nlfs.size(); i++) {
|
for (unsigned int i = 0; i < build_nlfs.size(); i++) {
|
||||||
if (build_nlfs[i]->GetLang() == table->lang_id) {
|
if (build_nlfs[i]->m_wLangId == table->lang_id) {
|
||||||
nlf = build_nlfs[i];
|
nlf = table->nlf = build_nlfs[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -378,6 +440,22 @@ void CEXEBuild::FillDefaultsIfNeeded(StringTable *table, NLF *nlf/*=0*/) {
|
||||||
table->ucommon.name=add_string_uninst(str(NLF_DEF_NAME),0);
|
table->ucommon.name=add_string_uninst(str(NLF_DEF_NAME),0);
|
||||||
}
|
}
|
||||||
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
||||||
|
table->common.byte=add_string_main(str(NLF_BYTE));
|
||||||
|
table->common.kilo=add_string_main(str(NLF_KILO));
|
||||||
|
table->common.mega=add_string_main(str(NLF_MEGA));
|
||||||
|
table->common.giga=add_string_main(str(NLF_GIGA));
|
||||||
|
|
||||||
|
/* not yet needed
|
||||||
|
|
||||||
|
table->ucommon.byte=add_string_uninst(str(NLF_BYTE));
|
||||||
|
table->ucommon.kilo=add_string_uninst(str(NLF_KILO));
|
||||||
|
table->ucommon.mega=add_string_uninst(str(NLF_MEGA));
|
||||||
|
table->ucommon.giga=add_string_uninst(str(NLF_GIGA));*/
|
||||||
|
|
||||||
|
#ifdef NSIS_CONFIG_LOG
|
||||||
|
table->common.log_install_process=add_string_main(str(NLF_LOG_INSTALL_PROCESS));
|
||||||
|
table->ucommon.log_install_process=add_string_uninst(str(NLF_LOG_INSTALL_PROCESS));
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef NSIS_CONFIG_LICENSEPAGE
|
#ifdef NSIS_CONFIG_LICENSEPAGE
|
||||||
if (!table->installer.licensedata || !table->installer.licensetext)
|
if (!table->installer.licensedata || !table->installer.licensetext)
|
||||||
|
@ -522,6 +600,14 @@ void CEXEBuild::FillDefaultsIfNeeded(StringTable *table, NLF *nlf/*=0*/) {
|
||||||
SET_INSTRUCTION(NLF_COPY_TO, copy_to);
|
SET_INSTRUCTION(NLF_COPY_TO, copy_to);
|
||||||
#endif
|
#endif
|
||||||
#ifdef NSIS_SUPPORT_ACTIVEXREG
|
#ifdef NSIS_SUPPORT_ACTIVEXREG
|
||||||
|
if (register_used)
|
||||||
|
{
|
||||||
|
SET_INSTRUCTION(NLF_REGISTERING, registering);
|
||||||
|
}
|
||||||
|
if (unregister_used)
|
||||||
|
{
|
||||||
|
SET_INSTRUCTION(NLF_UNREGISTERING, unregistering);
|
||||||
|
}
|
||||||
SET_INSTRUCTION(NLF_SYMBOL_NOT_FOUND, symbol_not_found);
|
SET_INSTRUCTION(NLF_SYMBOL_NOT_FOUND, symbol_not_found);
|
||||||
SET_INSTRUCTION(NLF_COULD_NOT_LOAD, could_not_load);
|
SET_INSTRUCTION(NLF_COULD_NOT_LOAD, could_not_load);
|
||||||
SET_INSTRUCTION(NLF_NO_OLE, no_ole);
|
SET_INSTRUCTION(NLF_NO_OLE, no_ole);
|
||||||
|
@ -601,15 +687,38 @@ NLF::NLF(char *filename) {
|
||||||
FILE *f = fopen(filename, "r");
|
FILE *f = fopen(filename, "r");
|
||||||
if (!f) throw runtime_error("Can't open language file!");
|
if (!f) throw runtime_error("Can't open language file!");
|
||||||
|
|
||||||
|
// Generate language name
|
||||||
|
char *p, *p2, t;
|
||||||
|
|
||||||
|
p = strrchr(filename, '.');
|
||||||
|
if (p)
|
||||||
|
{
|
||||||
|
t = *p;
|
||||||
|
*p = 0;
|
||||||
|
}
|
||||||
|
p2 = strrchr(filename, '\\');
|
||||||
|
if (p2)
|
||||||
|
{
|
||||||
|
p2++;
|
||||||
|
m_szName = new char[strlen(p2)+1];
|
||||||
|
strcpy(m_szName, p2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_szName = new char[strlen(filename)+1];
|
||||||
|
strcpy(m_szName, filename);
|
||||||
|
}
|
||||||
|
if (p) *p = t;
|
||||||
|
|
||||||
|
// Check header
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
buf[0] = SkipComments(f);
|
buf[0] = SkipComments(f);
|
||||||
fgets(buf+1, 1024, f);
|
fgets(buf+1, 1024, f);
|
||||||
|
|
||||||
// Check header
|
|
||||||
if (strncmp(buf, "NLF v", 5)) throw runtime_error("Invalid language file!");
|
if (strncmp(buf, "NLF v", 5)) throw runtime_error("Invalid language file!");
|
||||||
int nlf_version = atoi(buf+5);
|
int nlf_version = atoi(buf+5);
|
||||||
if (nlf_version != NLF_VERSION) {
|
if (nlf_version != NLF_VERSION) {
|
||||||
if (nlf_version != 2)
|
if (nlf_version != 2 && nlf_version != 3)
|
||||||
throw runtime_error("Language file version doesn't match NSIS version!");
|
throw runtime_error("Language file version doesn't match NSIS version!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -618,25 +727,77 @@ NLF::NLF(char *filename) {
|
||||||
fgets(buf+1, 1024, f);
|
fgets(buf+1, 1024, f);
|
||||||
m_wLangId = atoi(buf);
|
m_wLangId = atoi(buf);
|
||||||
|
|
||||||
|
int temp;
|
||||||
|
|
||||||
|
// Get font
|
||||||
|
m_szFont = NULL;
|
||||||
|
m_iFontSize = 0;
|
||||||
|
|
||||||
|
buf[0] = SkipComments(f);
|
||||||
|
fgets(buf+1, 1024, f);
|
||||||
|
temp=strlen(buf);
|
||||||
|
while (buf[temp-1] == '\n' || buf[temp-1] == '\r') {
|
||||||
|
buf[temp-1] = 0;
|
||||||
|
temp--;
|
||||||
|
}
|
||||||
|
if (buf[0] != '-' && buf [1] != 0) {
|
||||||
|
m_szFont = new char[strlen(buf) + 1];
|
||||||
|
strcpy(m_szFont, buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
buf[0] = SkipComments(f);
|
||||||
|
fgets(buf+1, 1024, f);
|
||||||
|
if (buf[0] != '-' && buf [1] != 0) {
|
||||||
|
m_iFontSize = atoi(buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get code page
|
||||||
|
m_uCodePage = CP_ACP;
|
||||||
|
buf[0] = SkipComments(f);
|
||||||
|
fgets(buf+1, 1024, f);
|
||||||
|
if (buf[0] != '-' && buf [1] != 0) {
|
||||||
|
m_uCodePage = atoi(buf);
|
||||||
|
if (!IsValidCodePage(m_uCodePage))
|
||||||
|
m_uCodePage = CP_ACP;
|
||||||
|
}
|
||||||
|
|
||||||
// Read strings
|
// Read strings
|
||||||
for (int i = 0; i < NLF_STRINGS; i++) {
|
for (int i = 0; i < NLF_STRINGS; i++) {
|
||||||
buf[0] = SkipComments(f);
|
if (nlf_version < 3 && (i == NLF_BTN_LICENSE_AGREE || i == NLF_BTN_LICENSE_DISAGREE)) {
|
||||||
|
|
||||||
if ((i == NLF_BTN_LICENSE_AGREE || i == NLF_BTN_LICENSE_DISAGREE) && nlf_version == 2) {
|
|
||||||
m_szStrings[i] = new char[1];
|
m_szStrings[i] = new char[1];
|
||||||
m_szStrings[i][0] = 0;
|
m_szStrings[i][0] = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nlf_version < 4) {
|
||||||
|
switch (i) {
|
||||||
|
case NLF_LOG_INSTALL_PROCESS:
|
||||||
|
case NLF_BYTE:
|
||||||
|
case NLF_KILO:
|
||||||
|
case NLF_MEGA:
|
||||||
|
case NLF_GIGA:
|
||||||
|
case NLF_REGISTERING:
|
||||||
|
case NLF_UNREGISTERING:
|
||||||
|
m_szStrings[i] = new char[strlen(english_strings[i]) + 1];
|
||||||
|
strcpy(m_szStrings[i], english_strings[i]);
|
||||||
|
continue;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buf[0] = SkipComments(f);
|
||||||
|
|
||||||
fgets(buf+1, NSIS_MAX_STRLEN, f);
|
fgets(buf+1, NSIS_MAX_STRLEN, f);
|
||||||
if (lstrlen(buf) == NSIS_MAX_STRLEN-1) {
|
if (strlen(buf) == NSIS_MAX_STRLEN-1) {
|
||||||
wsprintf(buf, "String too long (string #%d)!", i);
|
wsprintf(buf, "String too long (string #%d)!", i);
|
||||||
throw runtime_error(buf);
|
throw runtime_error(buf);
|
||||||
}
|
}
|
||||||
while (buf[lstrlen(buf)-1] == '\n' || buf[lstrlen(buf)-1] == '\r') {
|
temp=strlen(buf);
|
||||||
buf[lstrlen(buf)-1] = 0;
|
while (buf[temp-1] == '\n' || buf[temp-1] == '\r') {
|
||||||
|
buf[temp-1] = 0;
|
||||||
|
temp--;
|
||||||
}
|
}
|
||||||
m_szStrings[i] = new char[lstrlen(buf)+1];
|
m_szStrings[i] = new char[strlen(buf)+1];
|
||||||
for (char *out = m_szStrings[i], *in = buf; *in; in++, out++) {
|
for (char *out = m_szStrings[i], *in = buf; *in; in++, out++) {
|
||||||
if (*in == '\\') {
|
if (*in == '\\') {
|
||||||
in++;
|
in++;
|
||||||
|
@ -663,15 +824,13 @@ NLF::NLF(char *filename) {
|
||||||
}
|
}
|
||||||
|
|
||||||
NLF::~NLF() {
|
NLF::~NLF() {
|
||||||
|
delete [] m_szName;
|
||||||
|
delete [] m_szFont;
|
||||||
for (int i = 0; i < NLF_STRINGS; i++) {
|
for (int i = 0; i < NLF_STRINGS; i++) {
|
||||||
delete [] m_szStrings[i];
|
delete [] m_szStrings[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LANGID NLF::GetLang() {
|
|
||||||
return m_wLangId;
|
|
||||||
}
|
|
||||||
|
|
||||||
char* NLF::GetString(int idx) {
|
char* NLF::GetString(int idx) {
|
||||||
if (idx < 0 || idx >= NLF_STRINGS) return 0;
|
if (idx < 0 || idx >= NLF_STRINGS) return 0;
|
||||||
return m_szStrings[idx];
|
return m_szStrings[idx];
|
||||||
|
|
|
@ -65,18 +65,22 @@ class LangStringList : public SortedStringListND<struct langstring>
|
||||||
int index;
|
int index;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class NLF;
|
||||||
|
|
||||||
struct StringTable {
|
struct StringTable {
|
||||||
LANGID lang_id;
|
LANGID lang_id;
|
||||||
|
int dlg_offset;
|
||||||
common_strings common;
|
common_strings common;
|
||||||
common_strings ucommon;
|
common_strings ucommon;
|
||||||
installer_strings installer;
|
installer_strings installer;
|
||||||
uninstall_strings uninstall;
|
uninstall_strings uninstall;
|
||||||
GrowBuf user_strings;
|
TinyGrowBuf user_strings;
|
||||||
GrowBuf user_ustrings;
|
TinyGrowBuf user_ustrings;
|
||||||
|
|
||||||
|
NLF *nlf;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NLF_VERSION 3
|
#define NLF_VERSION 4
|
||||||
#define NLF_STRINGS 59
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
NLF_BRANDING,
|
NLF_BRANDING,
|
||||||
|
@ -115,6 +119,8 @@ enum {
|
||||||
NLF_CANT_WRITE,
|
NLF_CANT_WRITE,
|
||||||
NLF_COPY_FAILED,
|
NLF_COPY_FAILED,
|
||||||
NLF_COPY_TO,
|
NLF_COPY_TO,
|
||||||
|
NLF_REGISTERING,
|
||||||
|
NLF_UNREGISTERING,
|
||||||
NLF_SYMBOL_NOT_FOUND,
|
NLF_SYMBOL_NOT_FOUND,
|
||||||
NLF_COULD_NOT_LOAD,
|
NLF_COULD_NOT_LOAD,
|
||||||
NLF_CREATE_DIR,
|
NLF_CREATE_DIR,
|
||||||
|
@ -138,6 +144,13 @@ enum {
|
||||||
NLF_RENAME,
|
NLF_RENAME,
|
||||||
NLF_SKIPPED,
|
NLF_SKIPPED,
|
||||||
NLF_COPY_DETAILS,
|
NLF_COPY_DETAILS,
|
||||||
|
NLF_LOG_INSTALL_PROCESS,
|
||||||
|
NLF_BYTE,
|
||||||
|
NLF_KILO,
|
||||||
|
NLF_MEGA,
|
||||||
|
NLF_GIGA,
|
||||||
|
|
||||||
|
NLF_STRINGS,
|
||||||
|
|
||||||
SLANG_NAME,
|
SLANG_NAME,
|
||||||
SLANG_COMP_TEXT,
|
SLANG_COMP_TEXT,
|
||||||
|
@ -155,12 +168,17 @@ class NLF {
|
||||||
NLF(char *filename);
|
NLF(char *filename);
|
||||||
~NLF();
|
~NLF();
|
||||||
|
|
||||||
LANGID GetLang();
|
char *GetString(int idx);
|
||||||
char* GetString(int idx);
|
|
||||||
|
|
||||||
|
char *m_szName;
|
||||||
|
|
||||||
|
LANGID m_wLangId;
|
||||||
|
char *m_szFont;
|
||||||
|
int m_iFontSize;
|
||||||
|
unsigned int m_uCodePage;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LANGID m_wLangId;
|
char *m_szStrings[NLF_STRINGS];
|
||||||
char *m_szStrings[NLF_STRINGS];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -255,6 +255,11 @@ void CEXEBuild::ps_addtoline(const char *str, GrowBuf &linedata, StringList &his
|
||||||
in+=2;
|
in+=2;
|
||||||
c='\n';
|
c='\n';
|
||||||
}
|
}
|
||||||
|
else if (in[1] == 't')
|
||||||
|
{
|
||||||
|
in+=2;
|
||||||
|
c='\t';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (in[0] == '{')
|
else if (in[0] == '{')
|
||||||
{
|
{
|
||||||
|
@ -1089,7 +1094,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
||||||
|
|
||||||
BYTE* dlg = res_editor->GetResource(RT_DIALOG, MAKEINTRESOURCE(IDD_LICENSE), MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
BYTE* dlg = res_editor->GetResource(RT_DIALOG, MAKEINTRESOURCE(IDD_LICENSE), MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
||||||
if (!dlg) throw runtime_error("IDD_LICENSE doesn't exist!");
|
if (!dlg) throw runtime_error("IDD_LICENSE doesn't exist!");
|
||||||
CDialogTemplate dt(dlg);
|
CDialogTemplate dt(dlg,uDefCodePage);
|
||||||
free(dlg);
|
free(dlg);
|
||||||
|
|
||||||
switch (k) {
|
switch (k) {
|
||||||
|
@ -1292,7 +1297,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
||||||
|
|
||||||
BYTE* dlg = res_editor->GetResource(RT_DIALOG, MAKEINTRESOURCE(IDD_INSTFILES), MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
BYTE* dlg = res_editor->GetResource(RT_DIALOG, MAKEINTRESOURCE(IDD_INSTFILES), MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
||||||
if (!dlg) throw runtime_error("IDD_INSTFILES doesn't exist!");
|
if (!dlg) throw runtime_error("IDD_INSTFILES doesn't exist!");
|
||||||
CDialogTemplate dt(dlg);
|
CDialogTemplate dt(dlg,uDefCodePage);
|
||||||
free(dlg);
|
free(dlg);
|
||||||
DialogItemTemplate* progress = dt.GetItem(IDC_PROGRESS);
|
DialogItemTemplate* progress = dt.GetItem(IDC_PROGRESS);
|
||||||
if (!progress) {
|
if (!progress) {
|
||||||
|
@ -1343,7 +1348,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
||||||
#define REMOVE_ICON(id) { \
|
#define REMOVE_ICON(id) { \
|
||||||
BYTE* dlg = res_editor->GetResource(RT_DIALOG, MAKEINTRESOURCE(id), MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)); \
|
BYTE* dlg = res_editor->GetResource(RT_DIALOG, MAKEINTRESOURCE(id), MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)); \
|
||||||
if (!dlg) throw runtime_error(#id " doesn't exist!"); \
|
if (!dlg) throw runtime_error(#id " doesn't exist!"); \
|
||||||
CDialogTemplate dt(dlg); \
|
CDialogTemplate dt(dlg,uDefCodePage); \
|
||||||
free(dlg); \
|
free(dlg); \
|
||||||
dt.RemoveItem(IDC_ULICON); \
|
dt.RemoveItem(IDC_ULICON); \
|
||||||
DialogItemTemplate* text = dt.GetItem(IDC_INTROTEXT); \
|
DialogItemTemplate* text = dt.GetItem(IDC_INTROTEXT); \
|
||||||
|
@ -1560,7 +1565,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
||||||
if (k == 0 || k == 1) {
|
if (k == 0 || k == 1) {
|
||||||
dlg = get_dlg(hUIFile, IDD_LICENSE, line.gettoken_str(2));
|
dlg = get_dlg(hUIFile, IDD_LICENSE, line.gettoken_str(2));
|
||||||
if (!dlg) return PS_ERROR;
|
if (!dlg) return PS_ERROR;
|
||||||
CDialogTemplate UIDlg(dlg);
|
CDialogTemplate UIDlg(dlg,uDefCodePage);
|
||||||
SEARCH(IDC_EDIT1);
|
SEARCH(IDC_EDIT1);
|
||||||
SAVE(IDD_LICENSE);
|
SAVE(IDD_LICENSE);
|
||||||
}
|
}
|
||||||
|
@ -1568,7 +1573,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
||||||
if (k == 0 || k == 2) {
|
if (k == 0 || k == 2) {
|
||||||
dlg = get_dlg(hUIFile, IDD_DIR, line.gettoken_str(2));
|
dlg = get_dlg(hUIFile, IDD_DIR, line.gettoken_str(2));
|
||||||
if (!dlg) return PS_ERROR;
|
if (!dlg) return PS_ERROR;
|
||||||
CDialogTemplate UIDlg(dlg);
|
CDialogTemplate UIDlg(dlg,uDefCodePage);
|
||||||
SEARCH(IDC_DIR);
|
SEARCH(IDC_DIR);
|
||||||
SEARCH(IDC_BROWSE);
|
SEARCH(IDC_BROWSE);
|
||||||
#ifdef NSIS_CONFIG_LOG
|
#ifdef NSIS_CONFIG_LOG
|
||||||
|
@ -1580,7 +1585,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
||||||
if (k == 0 || k == 3) {
|
if (k == 0 || k == 3) {
|
||||||
dlg = get_dlg(hUIFile, IDD_SELCOM, line.gettoken_str(2));
|
dlg = get_dlg(hUIFile, IDD_SELCOM, line.gettoken_str(2));
|
||||||
if (!dlg) return PS_ERROR;
|
if (!dlg) return PS_ERROR;
|
||||||
CDialogTemplate UIDlg(dlg);
|
CDialogTemplate UIDlg(dlg,uDefCodePage);
|
||||||
SEARCH(IDC_TREE1);
|
SEARCH(IDC_TREE1);
|
||||||
SEARCH(IDC_COMBO1);
|
SEARCH(IDC_COMBO1);
|
||||||
SAVE(IDD_SELCOM);
|
SAVE(IDD_SELCOM);
|
||||||
|
@ -1589,7 +1594,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
||||||
if (k == 0 || k == 4) {
|
if (k == 0 || k == 4) {
|
||||||
dlg = get_dlg(hUIFile, IDD_INST, line.gettoken_str(2));
|
dlg = get_dlg(hUIFile, IDD_INST, line.gettoken_str(2));
|
||||||
if (!dlg) return PS_ERROR;
|
if (!dlg) return PS_ERROR;
|
||||||
CDialogTemplate UIDlg(dlg);
|
CDialogTemplate UIDlg(dlg,uDefCodePage);
|
||||||
SEARCH(IDC_BACK);
|
SEARCH(IDC_BACK);
|
||||||
SEARCH(IDC_CHILDRECT);
|
SEARCH(IDC_CHILDRECT);
|
||||||
SEARCH(IDC_VERSTR);
|
SEARCH(IDC_VERSTR);
|
||||||
|
@ -1617,7 +1622,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
||||||
if (k == 0 || k == 5) {
|
if (k == 0 || k == 5) {
|
||||||
dlg = get_dlg(hUIFile, IDD_INSTFILES, line.gettoken_str(2));
|
dlg = get_dlg(hUIFile, IDD_INSTFILES, line.gettoken_str(2));
|
||||||
if (!dlg) return PS_ERROR;
|
if (!dlg) return PS_ERROR;
|
||||||
CDialogTemplate UIDlg(dlg);
|
CDialogTemplate UIDlg(dlg,uDefCodePage);
|
||||||
SEARCH(IDC_LIST1);
|
SEARCH(IDC_LIST1);
|
||||||
SEARCH(IDC_PROGRESS);
|
SEARCH(IDC_PROGRESS);
|
||||||
SEARCH(IDC_SHOWDETAILS);
|
SEARCH(IDC_SHOWDETAILS);
|
||||||
|
@ -1627,7 +1632,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
||||||
if (k == 0 || k == 6) {
|
if (k == 0 || k == 6) {
|
||||||
dlg = get_dlg(hUIFile, IDD_UNINST, line.gettoken_str(2));
|
dlg = get_dlg(hUIFile, IDD_UNINST, line.gettoken_str(2));
|
||||||
if (!dlg) return PS_ERROR;
|
if (!dlg) return PS_ERROR;
|
||||||
CDialogTemplate UIDlg(dlg);
|
CDialogTemplate UIDlg(dlg,uDefCodePage);
|
||||||
SEARCH(IDC_EDIT1);
|
SEARCH(IDC_EDIT1);
|
||||||
SAVE(IDD_UNINST);
|
SAVE(IDD_UNINST);
|
||||||
}
|
}
|
||||||
|
@ -1635,7 +1640,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
||||||
if (k == 0 || k == 7) {
|
if (k == 0 || k == 7) {
|
||||||
dlg = get_dlg(hUIFile, IDD_VERIFY, line.gettoken_str(2));
|
dlg = get_dlg(hUIFile, IDD_VERIFY, line.gettoken_str(2));
|
||||||
if (!dlg) return PS_ERROR;
|
if (!dlg) return PS_ERROR;
|
||||||
CDialogTemplate UIDlg(dlg);
|
CDialogTemplate UIDlg(dlg,uDefCodePage);
|
||||||
SEARCH(IDC_STR);
|
SEARCH(IDC_STR);
|
||||||
// No RTL here, pure English goes here.
|
// No RTL here, pure English goes here.
|
||||||
//SAVE(IDD_VERIFY);
|
//SAVE(IDD_VERIFY);
|
||||||
|
@ -1711,7 +1716,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
||||||
init_res_editor();
|
init_res_editor();
|
||||||
BYTE* dlg = res_editor->GetResource(RT_DIALOG, MAKEINTRESOURCE(IDD_INST), MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
BYTE* dlg = res_editor->GetResource(RT_DIALOG, MAKEINTRESOURCE(IDD_INST), MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
||||||
|
|
||||||
CDialogTemplate dt(dlg);
|
CDialogTemplate dt(dlg,uDefCodePage);
|
||||||
delete [] dlg;
|
delete [] dlg;
|
||||||
|
|
||||||
DialogItemTemplate *childRect = dt.GetItem(IDC_CHILDRECT);
|
DialogItemTemplate *childRect = dt.GetItem(IDC_CHILDRECT);
|
||||||
|
@ -1785,7 +1790,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
||||||
#define SET_FONT(id) { \
|
#define SET_FONT(id) { \
|
||||||
BYTE* dlg = res_editor->GetResource(RT_DIALOG, MAKEINTRESOURCE(id), MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)); \
|
BYTE* dlg = res_editor->GetResource(RT_DIALOG, MAKEINTRESOURCE(id), MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)); \
|
||||||
if (!dlg) throw runtime_error(#id " doesn't exist!"); \
|
if (!dlg) throw runtime_error(#id " doesn't exist!"); \
|
||||||
CDialogTemplate td(dlg); \
|
CDialogTemplate td(dlg,uDefCodePage); \
|
||||||
free(dlg); \
|
free(dlg); \
|
||||||
td.SetFont(line.gettoken_str(1), line.gettoken_int(2)); \
|
td.SetFont(line.gettoken_str(1), line.gettoken_int(2)); \
|
||||||
DWORD dwSize; \
|
DWORD dwSize; \
|
||||||
|
@ -1809,6 +1814,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
||||||
#ifdef NSIS_CONFIG_CRC_SUPPORT
|
#ifdef NSIS_CONFIG_CRC_SUPPORT
|
||||||
SET_FONT(IDD_VERIFY);
|
SET_FONT(IDD_VERIFY);
|
||||||
#endif
|
#endif
|
||||||
|
#undef SET_FONT
|
||||||
}
|
}
|
||||||
catch (exception& err) {
|
catch (exception& err) {
|
||||||
ERROR_MSG("Error while changing font: %s\n", err.what());
|
ERROR_MSG("Error while changing font: %s\n", err.what());
|
||||||
|
@ -1887,24 +1893,27 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
||||||
NLF *newNLF = new NLF(line.gettoken_str(1));
|
NLF *newNLF = new NLF(line.gettoken_str(1));
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
for (i = 0; i < build_nlfs.size(); i++)
|
for (i = 0; i < build_nlfs.size(); i++)
|
||||||
if (build_nlfs[i]->GetLang() == newNLF->GetLang()) {
|
{
|
||||||
|
if (build_nlfs[i]->m_wLangId == newNLF->m_wLangId)
|
||||||
|
{
|
||||||
ERROR_MSG("Error: Can't add same language twice!\n");
|
ERROR_MSG("Error: Can't add same language twice!\n");
|
||||||
return PS_ERROR;
|
return PS_ERROR;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (!build_nlfs.size())
|
||||||
|
{
|
||||||
|
uDefCodePage = newNLF->m_uCodePage;
|
||||||
|
}
|
||||||
build_nlfs.push_back(newNLF);
|
build_nlfs.push_back(newNLF);
|
||||||
LANGID lang = newNLF->GetLang();
|
LANGID lang = newNLF->m_wLangId;
|
||||||
GetTable(lang);
|
GetTable(lang);
|
||||||
last_used_lang=newNLF->GetLang();
|
last_used_lang = newNLF->m_wLangId;
|
||||||
// define LANG_LangName as "####" (lang id)
|
// define LANG_LangName as "####" (lang id)
|
||||||
// for example ${LANG_ENGLISH} = 1033
|
// for example ${LANG_ENGLISH} = 1033
|
||||||
char lang_id[16];
|
char lang_id[16];
|
||||||
char lang_name[128];
|
char lang_name[128];
|
||||||
char *nlf = line.gettoken_str(1);
|
wsprintf(lang_name, "LANG_%s", newNLF->m_szName);
|
||||||
char *tmp = strrchr(nlf, '.');
|
wsprintf(lang_id, "%u", newNLF->m_wLangId);
|
||||||
if (tmp) *tmp = 0;
|
|
||||||
tmp = strrchr(nlf, '\\');
|
|
||||||
wsprintf(lang_name, "LANG_%s", tmp?tmp+1:nlf);
|
|
||||||
wsprintf(lang_id, "%u", newNLF->GetLang());
|
|
||||||
definedlist.add(lang_name,lang_id);
|
definedlist.add(lang_name,lang_id);
|
||||||
}
|
}
|
||||||
catch (exception &err) {
|
catch (exception &err) {
|
||||||
|
@ -2352,7 +2361,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
||||||
init_res_editor();
|
init_res_editor();
|
||||||
|
|
||||||
BYTE* dlg = res_editor->GetResource(RT_DIALOG, MAKEINTRESOURCE(IDD_INST), MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
BYTE* dlg = res_editor->GetResource(RT_DIALOG, MAKEINTRESOURCE(IDD_INST), MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
||||||
CDialogTemplate td(dlg);
|
CDialogTemplate td(dlg,uDefCodePage);
|
||||||
free(dlg);
|
free(dlg);
|
||||||
|
|
||||||
if (trim) {
|
if (trim) {
|
||||||
|
@ -2603,7 +2612,8 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
||||||
if (which_token == TOK_UNREGDLL)
|
if (which_token == TOK_UNREGDLL)
|
||||||
{
|
{
|
||||||
ent.offsets[1]=add_string("DllUnregisterServer");
|
ent.offsets[1]=add_string("DllUnregisterServer");
|
||||||
ent.offsets[2]=add_string("Unregistering: ");
|
ent.offsets[2]=LANG_UNREGISTERING;
|
||||||
|
unregister_used=true;
|
||||||
}
|
}
|
||||||
else if (which_token == TOK_CALLINSTDLL)
|
else if (which_token == TOK_CALLINSTDLL)
|
||||||
{
|
{
|
||||||
|
@ -2621,7 +2631,8 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
||||||
{
|
{
|
||||||
ent.offsets[1] = add_string(line.gettoken_str(2));
|
ent.offsets[1] = add_string(line.gettoken_str(2));
|
||||||
if (!ent.offsets[1]) ent.offsets[1]=add_string("DllRegisterServer");
|
if (!ent.offsets[1]) ent.offsets[1]=add_string("DllRegisterServer");
|
||||||
ent.offsets[2]=add_string("Registering: ");
|
ent.offsets[2]=LANG_REGISTERING;
|
||||||
|
register_used=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
SCRIPT_MSG("%s: \"%s\" %s\n",line.gettoken_str(0),line.gettoken_str(1), line.gettoken_str(ent.offsets[3]?3:2));
|
SCRIPT_MSG("%s: \"%s\" %s\n",line.gettoken_str(0),line.gettoken_str(1), line.gettoken_str(ent.offsets[3]?3:2));
|
||||||
|
|
2
TODO.txt
2
TODO.txt
|
@ -6,6 +6,8 @@ NSIS
|
||||||
|
|
||||||
* Section switch for defaulting to unselected mode
|
* Section switch for defaulting to unselected mode
|
||||||
|
|
||||||
|
* DATE, FILE, TIME, etc. defines
|
||||||
|
|
||||||
* different font and code page for every language
|
* different font and code page for every language
|
||||||
|
|
||||||
* MB and friends translatable
|
* MB and friends translatable
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue