-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathwpInstallMode.iss
115 lines (94 loc) · 3.27 KB
/
wpInstallMode.iss
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
[Code]
var
wpInstallMode : TWizardPage;
wpSelectBackupDir : TInputDirWizardPage;
normalInstallRadioBtn : TRadioButton;
backupInstallRadioBtn : TRadioButton;
function wpSelectBackupDir_NextClick(Page: TWizardPage): Boolean;
begin
Result := True;
userPackageDataDir := wpSelectBackupDir.Values[0] + '_' + GetDateTimeString('yyyy-mm-dd_hh.nn.ss', #0, #0);
if not CreateDir(userPackageDataDir) then
RaiseException('Failed create backup folder.');
Log(userPackageDataDir);
end;
function wpSelectBackupDir_ShouldSkip(Page: TWizardPage): Boolean;
begin
Result := normalInstallRadioBtn.Checked;
end;
function wpInstallModeNextClick(Page: TWizardPage): Boolean;
begin
Result := True;
if backupInstallRadioBtn.Checked then
begin
wpSelectBackupDir := CreateInputDirPage(wpInstallMode.ID, CustomMessage('BackupLocationTitle'),
CustomMessage('BackupLocationDesc'), CustomMessage('BackupLocationBrowse'),
True, 'sh2ee_packages');
wpSelectBackupDir.Add('');
with wpSelectBackupDir do
begin
OnNextButtonClick := @wpSelectBackupDir_NextClick;
OnShouldSkipPage := @wpSelectBackupDir_ShouldSkip;
end;
end;
end;
// Creates the maintenance page
procedure PrepareInstallModePage();
var
normalInstallLabel : TLabel;
backupInstallLabel : TLabel;
begin
wpInstallMode := CreateCustomPage(wpLicense, CustomMessage('IstallModeTitle'), CustomMessage('IstallModeDesc'));
normalInstallRadioBtn := TRadioButton.Create(wpInstallMode);
with normalInstallRadioBtn do
begin
Parent := wpInstallMode.Surface;
Caption := CustomMessage('normalInstallBtn');
Font.Style := [fsBold];
Checked := True;
Left := ScaleX(16);
Top := ScaleY(5);
Anchors := [akTop, akLeft];
Width := wpInstallMode.SurfaceWidth;
end;
backupInstallRadioBtn := TRadioButton.Create(wpInstallMode);
with backupInstallRadioBtn do
begin
Parent := wpInstallMode.Surface;
Caption := CustomMessage('backupInstallBtn');
Font.Style := [fsBold];
Checked := False;
Left := normalInstallRadioBtn.Left;
Top := normalInstallRadioBtn.Top + ScaleY(74);
Anchors := [akTop, akLeft];
Width := wpInstallMode.SurfaceWidth;
end;
normalInstallLabel := TLabel.Create(wpInstallMode);
with normalInstallLabel do
begin
Parent := wpInstallMode.Surface;
Caption := CustomMessage('normalInstallLabel');
Left := normalInstallRadioBtn.Left + ScaleX(17);
Top := normalInstallRadioBtn.Top + ScaleX(22);
Width := wpInstallMode.SurfaceWidth - ScaleX(70);
Anchors := [akTop, akLeft, akRight];
WordWrap := True;
AutoSize := True;
end;
backupInstallLabel := TLabel.Create(wpInstallMode);
with backupInstallLabel do
begin
Parent := wpInstallMode.Surface;
Caption := CustomMessage('backupInstallLabel');
Left := backupInstallRadioBtn.Left + ScaleX(17);
Top := backupInstallRadioBtn.Top + ScaleX(22);
Width := wpInstallMode.SurfaceWidth - ScaleX(70);
Anchors := [akTop, akLeft, akRight];
WordWrap := True;
AutoSize := True;
end;
with wpInstallMode do
begin
OnNextButtonClick := @wpInstallModeNextClick;
end;
end;