如何使用我想要的名称创建个性化的s = 'fgvhlsdagfcisdghfjkfdshfsal'
for c in s:
print(c)
?如何实现Inno Setup - How to hide certain filenames while installing? (FilenameLabel)的建议(第三个选项,CurInstallProgressChanged,复制文件名,你想从隐藏标签显示到自定义标签)。
我看到了这段代码:
FilenameLabel
但是,如果可能的话,如何使用procedure InitializeWizard;
begin
with TNewStaticText.Create(WizardForm) do
begin
Parent := WizardForm.FilenameLabel.Parent;
Left := WizardForm.FilenameLabel.Left;
Top := WizardForm.FilenameLabel.Top;
Width := WizardForm.FilenameLabel.Width;
Height := WizardForm.FilenameLabel.Height;
Caption := ExpandConstant('{cm:InstallingLabel}');
end;
WizardForm.FilenameLabel.Visible := False;
end;
来定义我想要的文件的名称?
答案 0 :(得分:4)
正如你所回答的那样:
FilenameLabel
; CurInstallProgressChanged
将文件名映射到您要显示的任何内容,并将其显示在自定义标签上。[Files]
Source: "data1.dat"; DestDir: {app}
Source: "data2.dat"; DestDir: {app}
Source: "data3.dat"; DestDir: {app}
[Code]
var
MyFilenameLabel: TNewStaticText;
procedure InitializeWizard();
begin
MyFilenameLabel := TNewStaticText.Create(WizardForm);
{ Clone the FilenameLabel }
MyFilenameLabel.Parent := WizardForm.FilenameLabel.Parent;
MyFilenameLabel.Left := WizardForm.FilenameLabel.Left;
MyFilenameLabel.Top := WizardForm.FilenameLabel.Top;
MyFilenameLabel.Width := WizardForm.FilenameLabel.Width;
MyFilenameLabel.Height := WizardForm.FilenameLabel.Height;
MyFilenameLabel.AutoSize := WizardForm.FilenameLabel.AutoSize;
{ Hide real FilenameLabel }
WizardForm.FilenameLabel.Visible := False;
end;
procedure CurInstallProgressChanged(CurProgress, MaxProgress: Integer);
var
Filename: string;
begin
Filename := ExtractFileName(WizardForm.FilenameLabel.Caption);
{ Map filenames to descriptions }
if CompareText(Filename, 'data1.dat') = 0 then Filename := 'Some hilarious videos'
else
if CompareText(Filename, 'data2.dat') = 0 then Filename := 'Some awesome pictures'
else
if CompareText(Filename, 'data3.dat') = 0 then Filename := 'Some cool music';
MyFilenameLabel.Caption := Filename;
end;