Inno Setup - How to create a personalized FilenameLabel with the names I want?

How to create a personalized FilenameLabel with the names I want? How to implement an offer from Inno Setup - how to hide certain file names during installation? (FilenameLabel) (the third option, CurInstallProgressChanged, copy the name of the file that you want to show from hidden to the user shortcut ยจ).

I see this code:

 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; 

But how to determine, if possible, the names of the files I want with CurInstallProgressChanged ?

+2
source share
1 answer

As explained in the answer you linked:

  • create a new custom label "file name";
  • hide the original FilenameLabel ;
  • we implement CurInstallProgressChanged to match the file name with what you want to display and display it on a custom label.
 [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; 

Description instead of file name

+3
source

All Articles