-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript_6.4.3.iss
More file actions
403 lines (360 loc) · 14.1 KB
/
Copy pathscript_6.4.3.iss
File metadata and controls
403 lines (360 loc) · 14.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
#define MyAppName "Русификатор для Wanderstop"
#define MyAppVersion "1.06 [20260128]"
#define MyAppPublisher "Dontaz"
#define MyAppURL "https://steamcommunity.com/sharedfiles/filedetails/?id=3479356545"
#define MyAppBoosty "https://boosty.to/dontaz"
#define MyAppDonationAlerts "https://www.donationalerts.com/r/dontaz"
#define GameName "Wanderstop"
[Setup]
AppId={{E2A8C1B4-473C-4321-AFFD-5D6E06F4WNDR}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={code:GetGamePath}
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
PrivilegesRequired=lowest
OutputDir=C:\Users\user\Desktop\Programs\Unreal Engine Modding\UnrealPak\Русификатор Wanderstop
OutputBaseFilename=Русификатор для Wanderstop
SolidCompression=yes
WizardStyle=modern
UsePreviousAppDir=no
DisableDirPage=no
DirExistsWarning=no
AppendDefaultDirName=no
UninstallDisplayName=Удаление русификатора Wanderstop
UninstallFilesDir={app}\Удаление русификатора
WizardImageFile=sidebar_new.bmp
WizardSmallImageFile=small.bmp
DisableWelcomePage=no
[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
[Files]
Source: "C:\Users\user\Desktop\Programs\Unreal Engine Modding\UnrealPak\Русификатор Wanderstop\Установщик\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
[CustomMessages]
WelcomeTitle=Вас приветствует мастер установки русификатора Wanderstop
WelcomeText=Данный мастер установки поможет вам установить русификатор (версия {#MyAppVersion}) для игры {#GameName}.%n%nАвтор перевода: {#MyAppPublisher}.%nПри публикации на сторонних ресурсах просьба указывать авторство.%n%nНажимая «Далее», вы соглашаетесь с условиями использования.
VisitLink=🌐 Найти самую актуальную версию (Steam Руководство)
BoostyLink=🧡 Поддержать автора перевода
DisclaimerLink=⚠️ Условия использования (Читать)
DisclaimerFullText=УСЛОВИЯ ИСПОЛЬЗОВАНИЯ:%n%n1. Данный перевод является неофициальным и фанатским. Он создан исключительно в ознакомительных целях и распространяется бесплатно. Автор не преследует коммерческих целей.%n%n2. Все права на игру принадлежат её компании-разработчику и издателю. Пожалуйста, поддержите разработчиков покупкой лицензионной копии.%n%n3. Установка, использование или модификация файлов осуществляется пользователем добровольно, по собственной инициативе и под его личную ответственность.%n%n4. Автор перевода не несёт ответственности за возможные последствия, технические неполадки или утрату данных. Используя данный материал, вы подтверждаете, что принимаете на себя все риски.
[Code]
var
VisitLabel: TNewStaticText;
BoostyLabel: TNewStaticText;
DisclaimerLabel: TNewStaticText;
SupportForm: TSetupForm;
procedure OpenUrl(Url: String);
var
ErrorCode: Integer;
begin
ShellExec('open', Url, '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;
procedure BoostyBtnClick(Sender: TObject);
begin
OpenUrl(ExpandConstant('{#MyAppBoosty}'));
if SupportForm <> nil then SupportForm.Close;
end;
procedure DABtnClick(Sender: TObject);
begin
OpenUrl(ExpandConstant('{#MyAppDonationAlerts}'));
if SupportForm <> nil then SupportForm.Close;
end;
procedure CloseSupportClick(Sender: TObject);
begin
if SupportForm <> nil then SupportForm.Close;
end;
procedure ShowSupportWindow;
var
TitleLabel: TLabel;
DescLabel: TLabel;
BtnBoosty, BtnDA, DummyBtn: TNewButton;
CloseLabel: TLabel;
begin
SupportForm := TSetupForm.Create(WizardForm);
try
SupportForm.ClientWidth := ScaleX(340);
SupportForm.ClientHeight := ScaleY(260);
SupportForm.Caption := 'Поддержать автора';
SupportForm.Position := poMainFormCenter;
SupportForm.BorderStyle := bsDialog;
SupportForm.Color := clWhite;
DummyBtn := TNewButton.Create(SupportForm);
DummyBtn.Parent := SupportForm;
DummyBtn.Width := 0;
DummyBtn.Height := 0;
DummyBtn.Left := -100;
DummyBtn.Default := True;
TitleLabel := TLabel.Create(SupportForm);
TitleLabel.Parent := SupportForm;
TitleLabel.Caption := 'Вам нравится перевод?';
TitleLabel.Font.Name := 'Segoe UI';
TitleLabel.Font.Size := 15;
TitleLabel.Font.Style := [fsBold];
TitleLabel.Font.Color := $333333;
TitleLabel.AutoSize := False;
TitleLabel.Alignment := taCenter;
TitleLabel.Left := 0;
TitleLabel.Width := SupportForm.ClientWidth;
TitleLabel.Top := ScaleY(25);
DescLabel := TLabel.Create(SupportForm);
DescLabel.Parent := SupportForm;
DescLabel.Caption := 'Выберите удобный способ поддержки:';
DescLabel.Font.Color := $666666;
DescLabel.Font.Size := 9;
DescLabel.WordWrap := True;
DescLabel.AutoSize := False;
DescLabel.Alignment := taCenter;
DescLabel.Left := ScaleX(10);
DescLabel.Width := SupportForm.ClientWidth - ScaleX(20);
DescLabel.Top := ScaleY(60);
DescLabel.Height := ScaleY(40);
BtnBoosty := TNewButton.Create(SupportForm);
BtnBoosty.Parent := SupportForm;
BtnBoosty.Width := ScaleX(280);
BtnBoosty.Height := ScaleY(40);
BtnBoosty.Left := (SupportForm.ClientWidth - BtnBoosty.Width) div 2;
BtnBoosty.Top := ScaleY(110);
BtnBoosty.Caption := '🟠 Поддержать на Boosty';
BtnBoosty.Cursor := crHandPoint;
BtnBoosty.Font.Style := [fsBold];
BtnBoosty.Font.Size := 10;
BtnBoosty.OnClick := @BoostyBtnClick;
BtnBoosty.TabOrder := 1;
BtnDA := TNewButton.Create(SupportForm);
BtnDA.Parent := SupportForm;
BtnDA.Width := ScaleX(280);
BtnDA.Height := ScaleY(40);
BtnDA.Left := (SupportForm.ClientWidth - BtnDA.Width) div 2;
BtnDA.Top := ScaleY(160);
BtnDA.Caption := '🟠 Поддержать на DonationAlerts';
BtnDA.Cursor := crHandPoint;
BtnDA.Font.Style := [fsBold];
BtnDA.Font.Size := 10;
BtnDA.OnClick := @DABtnClick;
BtnDA.TabOrder := 2;
CloseLabel := TLabel.Create(SupportForm);
CloseLabel.Parent := SupportForm;
CloseLabel.Caption := 'Спасибо, но в другой раз';
CloseLabel.Cursor := crHandPoint;
CloseLabel.Font.Color := $999999;
CloseLabel.Font.Style := [fsUnderline];
CloseLabel.Font.Size := 9;
CloseLabel.OnClick := @CloseSupportClick;
CloseLabel.AutoSize := False;
CloseLabel.Alignment := taCenter;
CloseLabel.Left := 0;
CloseLabel.Width := SupportForm.ClientWidth;
CloseLabel.Top := ScaleY(225);
SupportForm.ShowModal;
finally
SupportForm.Free;
SupportForm := nil;
end;
end;
procedure LinkLabelClick(Sender: TObject);
begin
OpenUrl(ExpandConstant('{#MyAppURL}'));
end;
procedure BoostyLabelClick(Sender: TObject);
begin
ShowSupportWindow();
end;
procedure ShowDisclaimerBox(Sender: TObject);
begin
MsgBox(CustomMessage('DisclaimerFullText'), mbInformation, MB_OK);
end;
procedure DisclaimerLabelClick(Sender: TObject);
begin
ShowDisclaimerBox(Sender);
end;
procedure InitializeWizard;
var
BottomMargin: Integer;
begin
BottomMargin := ScaleY(100);
WizardForm.WelcomeLabel1.Caption := CustomMessage('WelcomeTitle');
WizardForm.WelcomeLabel2.Caption := CustomMessage('WelcomeText');
WizardForm.WelcomeLabel2.Height := WizardForm.WelcomePage.Height - WizardForm.WelcomeLabel2.Top - BottomMargin;
VisitLabel := TNewStaticText.Create(WizardForm);
VisitLabel.Parent := WizardForm.WelcomePage;
VisitLabel.Caption := CustomMessage('VisitLink');
VisitLabel.Font.Color := clBlue;
VisitLabel.Font.Style := [fsUnderline];
VisitLabel.Cursor := crHandPoint;
VisitLabel.OnClick := @LinkLabelClick;
VisitLabel.Left := WizardForm.WelcomeLabel2.Left;
VisitLabel.Top := WizardForm.WelcomeLabel2.Top + WizardForm.WelcomeLabel2.Height + ScaleY(10);
VisitLabel.Width := WizardForm.WelcomeLabel2.Width;
BoostyLabel := TNewStaticText.Create(WizardForm);
BoostyLabel.Parent := WizardForm.WelcomePage;
BoostyLabel.Caption := CustomMessage('BoostyLink');
BoostyLabel.Font.Color := clBlue;
BoostyLabel.Font.Style := [fsUnderline];
BoostyLabel.Cursor := crHandPoint;
BoostyLabel.OnClick := @BoostyLabelClick;
BoostyLabel.Left := WizardForm.WelcomeLabel2.Left;
BoostyLabel.Top := VisitLabel.Top + VisitLabel.Height + ScaleY(10);
BoostyLabel.Width := WizardForm.WelcomeLabel2.Width;
DisclaimerLabel := TNewStaticText.Create(WizardForm);
DisclaimerLabel.Parent := WizardForm.WelcomePage;
DisclaimerLabel.Caption := CustomMessage('DisclaimerLink');
DisclaimerLabel.Font.Color := $00008B;
DisclaimerLabel.Font.Style := [fsUnderline];
DisclaimerLabel.Cursor := crHandPoint;
DisclaimerLabel.OnClick := @DisclaimerLabelClick;
DisclaimerLabel.Left := WizardForm.WelcomeLabel2.Left;
DisclaimerLabel.Top := BoostyLabel.Top + BoostyLabel.Height + ScaleY(10);
DisclaimerLabel.Width := WizardForm.WelcomeLabel2.Width;
end;
function GetSteamPath(): String;
var
RegPath: String;
begin
RegPath := '';
if RegQueryStringValue(HKLM64, 'SOFTWARE\Valve\Steam', 'InstallPath', RegPath) then
begin
Result := RegPath;
Exit;
end;
if RegQueryStringValue(HKLM, 'SOFTWARE\Valve\Steam', 'InstallPath', RegPath) then
begin
Result := RegPath;
Exit;
end;
Result := ExpandConstant('{commonpf}\Steam');
end;
function GetValueFromLine(const Line: String): String;
var
StartPos, EndPos: Integer;
TempStr: String;
begin
Result := '';
TempStr := Line;
while (Length(TempStr) > 0) and (TempStr[1] = ' ') do Delete(TempStr, 1, 1);
StartPos := Pos('"', TempStr);
if StartPos > 0 then
begin
Delete(TempStr, 1, StartPos);
StartPos := Pos('"', TempStr);
if StartPos > 0 then
begin
Delete(TempStr, 1, StartPos);
StartPos := Pos('"', TempStr);
if StartPos > 0 then
begin
Delete(TempStr, 1, StartPos);
EndPos := Pos('"', TempStr);
if EndPos > 0 then Result := Copy(TempStr, 1, EndPos - 1);
end;
end;
end;
end;
function CheckCommonPirateLocations(): String;
var
i: Integer;
GamePath: String;
CommonDirs: array[0..9] of String;
begin
Result := '';
CommonDirs[0] := 'C:\Games\{#GameName}';
CommonDirs[1] := 'C:\Игры\{#GameName}';
CommonDirs[2] := 'C:\Program Files\{#GameName}';
CommonDirs[3] := 'C:\Program Files (x86)\{#GameName}';
CommonDirs[4] := 'C:\{#GameName}';
CommonDirs[5] := 'D:\Games\{#GameName}';
CommonDirs[6] := 'D:\Игры\{#GameName}';
CommonDirs[7] := 'D:\{#GameName}';
CommonDirs[8] := 'E:\Games\{#GameName}';
CommonDirs[9] := ExpandConstant('{userdesktop}\{#GameName}');
for i := 0 to 9 do
begin
if DirExists(CommonDirs[i]) then
begin
Result := CommonDirs[i];
Exit;
end;
end;
for i := 65 to 90 do
begin
GamePath := Chr(i) + ':\{#GameName}';
if DirExists(GamePath) then begin Result := GamePath; Exit; end;
GamePath := Chr(i) + ':\Games\{#GameName}';
if DirExists(GamePath) then begin Result := GamePath; Exit; end;
GamePath := Chr(i) + ':\Игры\{#GameName}';
if DirExists(GamePath) then begin Result := GamePath; Exit; end;
GamePath := Chr(i) + ':\Игра\{#GameName}';
if DirExists(GamePath) then begin Result := GamePath; Exit; end;
GamePath := Chr(i) + ':\Game\{#GameName}';
if DirExists(GamePath) then begin Result := GamePath; Exit; end;
GamePath := Chr(i) + ':\Games\Игры\{#GameName}';
if DirExists(GamePath) then begin Result := GamePath; Exit; end;
GamePath := Chr(i) + ':\Игры\Games\{#GameName}';
if DirExists(GamePath) then begin Result := GamePath; Exit; end;
end;
end;
function GetGamePath(Param: String): String;
var
DefaultPath, SteamPath, LibraryFoldersFile: String;
GamePath, TempPath: String;
i, LineCount: Integer;
FileLines: TArrayOfString;
Line: String;
begin
SteamPath := GetSteamPath();
DefaultPath := SteamPath + '\steamapps\common\{#GameName}';
if DirExists(DefaultPath) then
begin
Result := DefaultPath;
Exit;
end;
GamePath := '\home\deck\.local\share\Steam\steamapps\common\{#GameName}';
if DirExists(GamePath) then
begin
Result := GamePath;
Exit;
end;
LibraryFoldersFile := SteamPath + '\steamapps\libraryfolders.vdf';
if FileExists(LibraryFoldersFile) then
begin
if LoadStringsFromFile(LibraryFoldersFile, FileLines) then
begin
LineCount := GetArrayLength(FileLines);
for i := 0 to LineCount - 1 do
begin
Line := FileLines[i];
if Pos('"path"', Line) > 0 then
begin
TempPath := GetValueFromLine(Line);
if TempPath <> '' then
begin
GamePath := TempPath + '\steamapps\common\{#GameName}';
StringChange(GamePath, '\\', '\');
if DirExists(GamePath) then
begin
Result := GamePath;
Exit;
end;
end;
end;
end;
end;
end;
for i := 65 to 90 do
begin
GamePath := Chr(i) + ':\SteamLibrary\steamapps\common\{#GameName}';
if DirExists(GamePath) then begin Result := GamePath; Exit; end;
GamePath := Chr(i) + ':\Steam\steamapps\common\{#GameName}';
if DirExists(GamePath) then begin Result := GamePath; Exit; end;
end;
GamePath := CheckCommonPirateLocations();
if GamePath <> '' then
begin
Result := GamePath;
Exit;
end;
Result := 'C:\Program Files (x86)\Steam\steamapps\common\{#GameName}';
end;