Skip to content

Commit 8e96a0f

Browse files
committed
add support Ukrainian and Russian languages
1 parent be9fa95 commit 8e96a0f

File tree

1 file changed

+72
-41
lines changed

1 file changed

+72
-41
lines changed

setup/DirectPrintServer.iss

Lines changed: 72 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; Script generated by the Inno Setup Script Wizard.
1+
; Script generated by the Inno Setup Script Wizard.
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

44
#define MyAppName "Direct Print Server"
@@ -25,24 +25,54 @@ OutputDir=Output
2525
OutputBaseFilename=DirectPrintServerSetup
2626
Compression=lzma
2727
SolidCompression=yes
28+
DisableWelcomePage=no
2829

2930
[Languages]
3031
Name: "en"; MessagesFile: "compiler:Default.isl"
3132
Name: "ru"; MessagesFile: "compiler:Languages\Russian.isl"
3233
Name: "uk"; MessagesFile: "compiler:Languages\Ukrainian.isl"
3334

3435
[CustomMessages]
35-
en.ServiceAccountInformation=Log on Service as:
36-
ru.ServiceAccountInformation=Çàïóñêàòü ñåðâèñ îò èìåíè:
37-
uk.ServiceAccountInformation=Log on Service as:
36+
en.InstallingService=Installing service "Direct Print Service"
37+
en.UninstallingService=Uninstalling service "Direct Print Service"
38+
en.ServiceAccountInformation=Log on "Direct Print Service" as:
39+
en.EnterAccountInformation=Please enter account information
40+
en.LocalSystemAccount=Local system account (shared printers not available)
41+
en.User=User
42+
en.Password=Password
43+
en.ConfirmPassword=Confirm password
44+
en.PleaseEnterUser=Please enter User
45+
en.PasswordNotMatch=Password does not match the confirm password
46+
47+
ru.InstallingService=Установка службы "Direct Print Service"
48+
ru.UninstallingService=Удаление службы "Direct Print Service"
49+
ru.ServiceAccountInformation=Запускать сервис "Direct Print Service" от имени:
50+
ru.EnterAccountInformation=Пожалуйста, введите данные учетной записи
51+
ru.LocalSystemAccount=С системной учетной записью (общие принтеры не доступны)
52+
ru.User=Пользователь
53+
ru.Password=Пароль
54+
ru.ConfirmPassword=Подтвердите пароль
55+
ru.PleaseEnterUser=Введите имя пользователя
56+
ru.PasswordNotMatch=Несовпадение паролей
57+
58+
uk.InstallingService=Встановлення служби "Direct Print Service"
59+
uk.UninstallingService=Видалення служби "Direct Print Service"
60+
uk.ServiceAccountInformation=Запускати сервіс "Direct Print Service" від імені:
61+
uk.EnterAccountInformation=Будь ласка, введіть дані облікового запису
62+
uk.LocalSystemAccount=З системним обліковим записом (загальні принтери не доступні)
63+
uk.User=Користувач
64+
uk.Password=Пароль
65+
uk.ConfirmPassword=Підтвердіть пароль
66+
uk.PleaseEnterUser=Введіть ім'я користувача
67+
uk.PasswordNotMatch=Неспівпадіння паролів
3868
3969
[Files]
4070
Source: "Files\prunsrv.exe"; DestDir: "{app}"; Flags: ignoreversion
4171
Source: "Files\gsdll32.dll"; DestDir: "{app}"; Flags: ignoreversion
4272
Source: "Files\gswin32c.exe"; DestDir: "{app}"; Flags: ignoreversion
43-
Source: "Files\install.cmd"; DestDir: "{app}"; Flags: ignoreversion
73+
Source: "Files\install.cmd"; DestDir: "{app}"; Flags: ignoreversion
4474
Source: "Files\install_ex.cmd"; DestDir: "{app}"; Flags: ignoreversion
45-
Source: "Files\LICENSE.txt"; DestDir: "{app}"; Flags: ignoreversion
75+
Source: "Files\LICENSE.txt"; DestDir: "{app}"; Flags: ignoreversion
4676
Source: "Files\PrintServer.jar"; DestDir: "{app}"; Flags: ignoreversion
4777
Source: "Files\prunmgr.exe"; DestDir: "{app}"; Flags: ignoreversion
4878
Source: "Files\prunsrv.exe"; DestDir: "{app}"; Flags: ignoreversion
@@ -53,22 +83,21 @@ Source: "Files\uninstall.cmd"; DestDir: "{app}"; Flags: ignoreversion
5383
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
5484

5585
[Run]
56-
Filename: "{app}\install.cmd"; Parameters: "{code:GetUserName} {code:GetPassword}"; WorkingDir: "{app}"; Flags: runhidden; StatusMsg: "Installing service"
86+
Filename: "{app}\install.cmd"; Parameters: "{code:GetUserName} {code:GetPassword}"; WorkingDir: "{app}"; Flags: runhidden; StatusMsg: "{cm:InstallingService}"
5787

58-
[UninstallRun]
59-
Filename: "{app}\uninstall.cmd"; WorkingDir: "{app}"; Flags: runhidden; StatusMsg: "Uninstalling service"
88+
[UninstallRun]
89+
Filename: "{app}\uninstall.cmd"; WorkingDir: "{app}"; Flags: runhidden; StatusMsg: "{cm:UninstallingService}"
6090

6191
[Code]
6292
var
6393
Page: TInputQueryWizardPage;
6494
LocalSystemAccountCheckBox: TNewCheckBox;
65-
LabelFolder: TLabel;
66-
// MainPage: TWizardPage;
67-
UserEdit: TNewEdit;
68-
PassEdit: TNewEdit;
69-
ConfPassEdit: TNewEdit;
70-
UserStaticText: TNewStaticText;
71-
PassStaticText: TNewStaticText;
95+
LabelFolder: TLabel;
96+
UserEdit: TNewEdit;
97+
PassEdit: TNewEdit;
98+
ConfPassEdit: TNewEdit;
99+
UserStaticText: TNewStaticText;
100+
PassStaticText: TNewStaticText;
72101
ConfPassStaticText: TNewStaticText;
73102
74103
procedure LocalSystemAccountCheckBoxOnClick(Sender: TObject);
@@ -93,34 +122,33 @@ end;
93122
94123
procedure InitializeWizard;
95124
begin
96-
Page := CreateInputQueryPage(wpWelcome, //wpSelectComponents,
97-
CustomMessage('ServiceAccountInformation'), 'Please enter account information',
98-
'');
125+
Page := CreateInputQueryPage(wpSelectComponents, //,wpWelcome
126+
CustomMessage('ServiceAccountInformation'), CustomMessage('EnterAccountInformation'), '');
99127
100128
LocalSystemAccountCheckBox := TNewCheckBox.Create(Page);
101129
LocalSystemAccountCheckBox.Parent := Page.Surface;
102-
LocalSystemAccountCheckBox.Width := ScaleX(200);
103-
LocalSystemAccountCheckBox.Caption := 'Local system account';
130+
LocalSystemAccountCheckBox.Width := Page.SurfaceWidth - ScaleX(8);
131+
LocalSystemAccountCheckBox.Caption := CustomMessage('LocalSystemAccount');
104132
LocalSystemAccountCheckBox.Checked := true;
105133
LocalSystemAccountCheckBox.OnClick := @LocalSystemAccountCheckBoxOnClick;
106-
134+
107135
UserStaticText := TNewStaticText.Create(Page);
108136
UserStaticText.Top := LocalSystemAccountCheckBox.Top + LocalSystemAccountCheckBox.Height + ScaleY(12);
109-
UserStaticText.Caption := 'User';
137+
UserStaticText.Caption := CustomMessage('User');
110138
UserStaticText.AutoSize := True;
111-
UserStaticText.Parent := Page.Surface;
139+
UserStaticText.Parent := Page.Surface;
112140
UserStaticText.Enabled := false;
113141
114142
UserEdit := TNewEdit.Create(Page);
115143
UserEdit.Parent := Page.Surface;
116144
UserEdit.Top := LocalSystemAccountCheckBox.Top + LocalSystemAccountCheckBox.Height + ScaleY(8);
117-
UserEdit.Left := ScaleX(100);
118-
UserEdit.Width := ScaleX(150);
145+
UserEdit.Left := ScaleX(130);
146+
UserEdit.Width := ScaleX(200);
119147
UserEdit.Enabled := false;
120148
121149
PassStaticText := TNewStaticText.Create(Page);
122150
PassStaticText.Top := UserEdit.Top + UserEdit.Height + ScaleY(12);
123-
PassStaticText.Caption := 'Password';
151+
PassStaticText.Caption := CustomMessage('Password');
124152
PassStaticText.AutoSize := True;
125153
PassStaticText.Parent := Page.Surface;
126154
PassStaticText.Enabled := false;
@@ -129,13 +157,13 @@ begin
129157
PassEdit.Parent := Page.Surface;
130158
PassEdit.Top := UserEdit.Top + UserEdit.Height + ScaleY(8);
131159
PassEdit.Left := UserEdit.Left;
132-
PassEdit.Width := UserEdit.Width;
160+
PassEdit.Width := UserEdit.Width;
133161
PassEdit.PasswordChar := '*';
134162
PassEdit.Enabled := false;
135163
136164
ConfPassStaticText := TNewStaticText.Create(Page);
137165
ConfPassStaticText.Top := PassEdit.Top + PassEdit.Height + ScaleY(12);
138-
ConfPassStaticText.Caption := 'Confirm password';
166+
ConfPassStaticText.Caption := CustomMessage('ConfirmPassword');
139167
ConfPassStaticText.AutoSize := True;
140168
ConfPassStaticText.Parent := Page.Surface;
141169
ConfPassStaticText.Enabled := false;
@@ -144,38 +172,41 @@ begin
144172
ConfPassEdit.Parent := Page.Surface;
145173
ConfPassEdit.Top := PassEdit.Top + PassEdit.Height + ScaleY(8);
146174
ConfPassEdit.Left := UserEdit.Left;
147-
ConfPassEdit.Width := UserEdit.Width;
175+
ConfPassEdit.Width := UserEdit.Width;
148176
ConfPassEdit.PasswordChar := '*';
149177
ConfPassEdit.Enabled := false;
150178
end;
151179
152180
function NextButtonClick(CurPageID: Integer): Boolean;
153181
var
154182
ResultCode: Integer;
155-
begin
183+
begin
156184
Result := true;
157-
Log('NextButtonClick(' + IntToStr(CurPageID) + ') called');
185+
// Log('NextButtonClick(' + IntToStr(CurPageID) + ') called');
158186
case CurPageID of
159187
Page.ID: begin
160188
if not LocalSystemAccountCheckBox.Checked then begin
161-
if UserEdit.Text = '' then begin
189+
if UserEdit.Text = '' then begin
162190
Result := false;
163-
MsgBox('Pleas enter User', mbInformation, MB_OK);
164-
exit;
191+
MsgBox(CustomMessage('PleaseEnterUser'), mbInformation, MB_OK);
192+
exit;
165193
end;
166194
if not (ConfPassEdit.Text = PassEdit.Text) then begin
167-
Result := false;
168-
MsgBox('Password does not match the confirm password', mbInformation, MB_OK);
169-
exit;
195+
Result := false;
196+
MsgBox(CustomMessage('PasswordNotMatch'), mbInformation, MB_OK);
197+
exit;
170198
end;
171-
end;
199+
end;
172200
end;
173201
end;
174202
end;
175203
176204
function GetUserName(Param: String): string;
177205
begin
178-
result := '.\' + UserEdit.Text;
206+
if not (UserEdit.Text = '') then
207+
result := '.\' + UserEdit.Text
208+
else
209+
result := '';
179210
end;
180211
181212
function GetPassword(Param: String): string;
@@ -194,6 +225,6 @@ begin
194225
// mres := MsgBox('Do you want to delete saved files?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2)
195226
// if mres = IDYES then
196227
DelTree(ExpandConstant('{userappdata}\DirectPrintServiceLogs'), True, True, True);
197-
end;
228+
end;
198229
end;
199230
end;

0 commit comments

Comments
 (0)