Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 76b23b0

Browse files
committed
fix: Installer progress bar should not 100% while downloading dependencies
1 parent 7b80e2e commit 76b23b0

File tree

3 files changed

+63
-3
lines changed

3 files changed

+63
-3
lines changed

engine/templates/windows/installer-beta.iss

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ var
3939
ResultCode: Integer;
4040
begin
4141
ExpandedAppDir := ExpandConstant('{app}');
42+
43+
// Set the maximum value for the progress bar to 100 (representing 100%)
44+
WizardForm.ProgressGauge.Max := 100;
45+
46+
// Set the progress bar to 80%
47+
WizardForm.ProgressGauge.Position := 80;
48+
WizardForm.ProgressGauge.Update;
4249
4350
// Add {app} to PATH
4451
CmdLine := Format('setx PATH "%s;%%PATH%%"', [ExpandedAppDir]);
@@ -48,15 +55,28 @@ begin
4855
WizardForm.StatusLabel.Caption := 'Downloading llama.cpp engine and dependencies ...';
4956
WizardForm.StatusLabel.Update;
5057
58+
// Set the progress bar to 85% after adding to PATH
59+
WizardForm.ProgressGauge.Position := 85;
60+
WizardForm.ProgressGauge.Update;
61+
5162
// Download llamacpp engine by default
5263
CortexInstallCmd := Format('"%s\cortex-beta.exe" engines install cortex.llamacpp', [ExpandedAppDir]);
5364
Exec('cmd.exe', '/C ' + CortexInstallCmd, '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
5465
55-
// Clear the status message after completion
66+
// Set the progress bar to 90% after downloading the engine
67+
WizardForm.ProgressGauge.Position := 90;
68+
WizardForm.ProgressGauge.Update;
69+
70+
// Clear status message after completion
5671
WizardForm.StatusLabel.Caption := '';
5772
WizardForm.StatusLabel.Update;
73+
74+
// Set the progress bar to 100% after completion
75+
WizardForm.ProgressGauge.Position := 100;
76+
WizardForm.ProgressGauge.Update;
5877
end;
5978
79+
6080
procedure DeleteCurrentUserCortexFolderAndConfig;
6181
var
6282
UserCortexFolder: String;

engine/templates/windows/installer-nightly.iss

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ var
3939
ResultCode: Integer;
4040
begin
4141
ExpandedAppDir := ExpandConstant('{app}');
42+
43+
// Set the maximum value for the progress bar to 100 (representing 100%)
44+
WizardForm.ProgressGauge.Max := 100;
45+
46+
// Set the progress bar to 80%
47+
WizardForm.ProgressGauge.Position := 80;
48+
WizardForm.ProgressGauge.Update;
4249
4350
// Add {app} to PATH
4451
CmdLine := Format('setx PATH "%s;%%PATH%%"', [ExpandedAppDir]);
@@ -48,15 +55,28 @@ begin
4855
WizardForm.StatusLabel.Caption := 'Downloading llama.cpp engine and dependencies ...';
4956
WizardForm.StatusLabel.Update;
5057
58+
// Set the progress bar to 85% after adding to PATH
59+
WizardForm.ProgressGauge.Position := 85;
60+
WizardForm.ProgressGauge.Update;
61+
5162
// Download llamacpp engine by default
5263
CortexInstallCmd := Format('"%s\cortex-nightly.exe" engines install cortex.llamacpp', [ExpandedAppDir]);
5364
Exec('cmd.exe', '/C ' + CortexInstallCmd, '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
5465
55-
// Clear the status message after completion
66+
// Set the progress bar to 90% after downloading the engine
67+
WizardForm.ProgressGauge.Position := 90;
68+
WizardForm.ProgressGauge.Update;
69+
70+
// Clear status message after completion
5671
WizardForm.StatusLabel.Caption := '';
5772
WizardForm.StatusLabel.Update;
73+
74+
// Set the progress bar to 100% after completion
75+
WizardForm.ProgressGauge.Position := 100;
76+
WizardForm.ProgressGauge.Update;
5877
end;
5978
79+
6080
procedure DeleteCurrentUserCortexFolderAndConfig;
6181
var
6282
UserCortexFolder: String;

engine/templates/windows/installer.iss

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ var
3939
ResultCode: Integer;
4040
begin
4141
ExpandedAppDir := ExpandConstant('{app}');
42+
43+
// Set the maximum value for the progress bar to 100 (representing 100%)
44+
WizardForm.ProgressGauge.Max := 100;
45+
46+
// Set the progress bar to 80%
47+
WizardForm.ProgressGauge.Position := 80;
48+
WizardForm.ProgressGauge.Update;
4249
4350
// Add {app} to PATH
4451
CmdLine := Format('setx PATH "%s;%%PATH%%"', [ExpandedAppDir]);
@@ -48,15 +55,28 @@ begin
4855
WizardForm.StatusLabel.Caption := 'Downloading llama.cpp engine and dependencies ...';
4956
WizardForm.StatusLabel.Update;
5057
58+
// Set the progress bar to 85% after adding to PATH
59+
WizardForm.ProgressGauge.Position := 85;
60+
WizardForm.ProgressGauge.Update;
61+
5162
// Download llamacpp engine by default
5263
CortexInstallCmd := Format('"%s\cortex.exe" engines install cortex.llamacpp', [ExpandedAppDir]);
5364
Exec('cmd.exe', '/C ' + CortexInstallCmd, '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
5465
55-
// Clear the status message after completion
66+
// Set the progress bar to 90% after downloading the engine
67+
WizardForm.ProgressGauge.Position := 90;
68+
WizardForm.ProgressGauge.Update;
69+
70+
// Clear status message after completion
5671
WizardForm.StatusLabel.Caption := '';
5772
WizardForm.StatusLabel.Update;
73+
74+
// Set the progress bar to 100% after completion
75+
WizardForm.ProgressGauge.Position := 100;
76+
WizardForm.ProgressGauge.Update;
5877
end;
5978
79+
6080
procedure DeleteCurrentUserCortexFolderAndConfig;
6181
var
6282
UserCortexFolder: String;

0 commit comments

Comments
 (0)