Skip to content

Commit

Permalink
Add messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnlaan committed Nov 14, 2024
1 parent 1dfd2f7 commit 3f83b08
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
9 changes: 8 additions & 1 deletion Files/Default.isl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; *** Inno Setup version 6.1.0+ English messages ***
; *** Inno Setup version 6.4.0+ English messages ***
;
; To download user-contributed translations of this file, go to:
; https://jrsoftware.org/files/istrans/
Expand Down Expand Up @@ -222,6 +222,13 @@ ErrorFileHash2=Invalid file hash: expected %1, found %2
ErrorProgress=Invalid progress: %1 of %2
ErrorFileSize=Invalid file size: expected %1, found %2
; *** TExtractionWizardPage wizard page and Extract7ZipArchive
ExtractionLabel=Extracting additional files...
ButtonStopExtraction=&Stop extraction
StopExtraction=Are you sure you want to stop the extraction?
ErrorExtractionAborted=Extraction aborted
ErrorExtractionFailed=Extraction failed: %1
; *** "Preparing to Install" wizard page
WizardPreparing=Preparing to Install
PreparingDesc=Setup is preparing to install [name] on your computer.
Expand Down
6 changes: 3 additions & 3 deletions Projects/Src/Compression.SevenZipDecoder.pas
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ procedure Extract7ZipArchive(const ArchiveFileName, DestDir: String;

var SaveCurDir := GetCurrentDir;
if not ForceDirectories(False, DestDir) or not SetCurrentDir(DestDir) then
raise Exception.Create(FmtSetupMessage(msgErrorDownloadFailed, ['-1', ''])); //todo: fix message
raise Exception.Create(FmtSetupMessage(msgErrorExtractionFailed, ['-1']));
try
State.ExpandedArchiveFileName := PathExpand(ArchiveFileName);
State.ExpandedDestDir := AddBackslash(PathExpand(DestDir));
Expand All @@ -290,9 +290,9 @@ procedure Extract7ZipArchive(const ArchiveFileName, DestDir: String;
Log(State.LogBuffer);

if State.Aborted then
raise Exception.Create(SetupMessages[msgErrorDownloadAborted]) //todo: fix message
raise Exception.Create(SetupMessages[msgErrorExtractionAborted])
else if Res <> 0 then
raise Exception.Create(FmtSetupMessage(msgErrorDownloadFailed, [Res.ToString, ''])) //todo: fix message
raise Exception.Create(FmtSetupMessage(msgErrorExtractionFailed, [Res.ToString]))
finally
SetCurrentDir(SaveCurDir);
end;
Expand Down
7 changes: 3 additions & 4 deletions Projects/Src/Setup.ScriptDlg.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1082,8 +1082,7 @@ function TDownloadWizardPage.Download: Int64;

procedure TExtractionWizardPage.AbortButtonClick(Sender: TObject);
begin
//todo: fix msg!
FAbortedByUser := LoggedMsgBox(SetupMessages[msgStopDownload], '', mbConfirmation, MB_YESNO, True, ID_YES) = IDYES;
FAbortedByUser := LoggedMsgBox(SetupMessages[msgStopExtraction], '', mbConfirmation, MB_YESNO, True, ID_YES) = IDYES;
end;

function TExtractionWizardPage.InternalOnExtractionProgress(const ArchiveName, FileName: string; const Progress, ProgressMax: Int64): Boolean;
Expand Down Expand Up @@ -1136,11 +1135,11 @@ procedure TExtractionWizardPage.Initialize;
begin
inherited;

FMsg1Label.Caption := SetupMessages[msgDownloadingLabel]; //todo: fix message
FMsg1Label.Caption := SetupMessages[msgExtractionLabel];

FAbortButton := TNewButton.Create(Self);
with FAbortButton do begin
Caption := SetupMessages[msgButtonStopDownload]; //todo: fix message
Caption := SetupMessages[msgButtonStopExtraction];
Top := FProgressBar.Top + FProgressBar.Height + WizardForm.ScalePixelsY(8);
Width := WizardForm.CalculateButtonWidth([Caption]);
Anchors := [akLeft, akTop];
Expand Down
5 changes: 5 additions & 0 deletions Projects/Src/Shared.SetupMessageIDs.pas
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ interface
msgButtonNoToAll,
msgButtonOK,
msgButtonStopDownload,
msgButtonStopExtraction,
msgButtonWizardBrowse,
msgButtonYes,
msgButtonYesToAll,
Expand Down Expand Up @@ -85,6 +86,8 @@ interface
msgErrorDownloadFailed,
msgErrorDownloadSizeFailed,
msgErrorExecutingProgram,
msgErrorExtractionAborted,
msgErrorExtractionFailed,
msgErrorFileHash1,
msgErrorFileHash2,
msgErrorFileSize,
Expand Down Expand Up @@ -119,6 +122,7 @@ interface
msgExistingFileReadOnlyKeepExisting,
msgExitSetupMessage,
msgExitSetupTitle,
msgExtractionLabel,
msgFileAbortRetryIgnoreSkipNotRecommended,
msgFileAbortRetryIgnoreIgnoreNotRecommended,
msgFileExistsSelectAction,
Expand Down Expand Up @@ -234,6 +238,7 @@ interface
msgStatusRunProgram,
msgStatusUninstalling,
msgStopDownload,
msgStopExtraction,
msgTranslatorNote,
msgUninstallAppFullTitle,
msgUninstallAppTitle,
Expand Down
2 changes: 1 addition & 1 deletion Projects/Src/Shared.Struct.pas
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ interface
SetupID: TSetupID = 'Inno Setup Setup Data (6.4.0)';
UninstallLogID: array[Boolean] of TUninstallLogID =
('Inno Setup Uninstall Log (b)', 'Inno Setup Uninstall Log (b) 64-bit');
MessagesHdrID: TMessagesHdrID = 'Inno Setup Messages (6.0.0) (u)';
MessagesHdrID: TMessagesHdrID = 'Inno Setup Messages (6.4.0) (u)';
MessagesLangOptionsID: TMessagesLangOptionsID = '!mlo!001';
ZLIBID: TCompID = 'zlb'#26;
DiskSliceID: TDiskSliceID = 'idska32'#26;
Expand Down

0 comments on commit 3f83b08

Please sign in to comment.