How to hide Inno Setup installation progress and show only filename as installation path

When using the Inno Setup default wizard to create the generated installation package, some steps in the installation steps can actually be ignored and not displayed. At the same time, some users like to pursue details. For example, what we are going to solve today is to use Inno Setup to not display the installation path during the installation process and only display the file name. By default, we can manually change the language file and use the following code to achieve this. The following is the Inno Setup code that hides the installation progress and only displays the file name.

 
 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

[Code]
var
  myLabel: TNewStaticText;

procedure InitializeWizard();
begin
  WizardForm.FilenameLabel.Visible := false;
  MyLabel := TNewStaticText.Create(WizardForm.InstallingPage);
  MyLabel.Parent := WizardForm.InstallingPage;
  MyLabel.Top := WizardForm.FilenameLabel.Top;
  MyLabel.Left := WizardForm.FilenameLabel.Left;
  MyLabel.Width := WizardForm.FilenameLabel.Width;
  MyLabel.Visible := True;
  MyLabel.Caption := '';
end;

procedure DisplayFileName();
begin
  MyLabel.Caption := ExtractFileName(CurrentFileName);
end;

[Files]
Source: "{app}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; AfterInstall: DisplayFileName

Just copy and paste the above Inno Setup code and save it into the Inno Setup script. The website provides you with many different types of Inno Setup scripts. You should also use them flexibly when integrating the scripts.

Guess you like

Origin blog.csdn.net/winkexin/article/details/131761074