A modern, self-hosted backup solution for secure, encrypted backups across local and cloud storage.
fix: resolves missing app url on windows installer setup
towfiqia38cd182f869
diff --git a/installers/windows/pluton-setup.iss b/installers/windows/pluton-setup.issindex ce08dae..224e20a 100644--- a/installers/windows/pluton-setup.iss+++ b/installers/windows/pluton-setup.iss@@ -124,6 +124,8 @@ Type: files; Name: "{app}\pluton-open.url"[Code]var+ DashboardLinkLabel: TNewStaticText;+ FinishNoteLabel: TNewStaticText;SettingsPage: TInputQueryWizardPage;IsUpgrade: Boolean;@@ -199,6 +201,22 @@ beginend;end;+function GetDashboardUrl(): String;+begin+ if ServerPort = '' then+ ServerPort := '5173';++ Result := 'http://localhost:' + ServerPort;+end;++procedure DashboardLinkLabelOnClick(Sender: TObject);+var+ ErrorCode: Integer;+begin+ if not ShellExec('open', GetDashboardUrl(), '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode) then+ MsgBox('Failed to open the dashboard URL.', mbError, MB_OK);+end;+// Stop the service if it's runningfunction StopService(ServiceName: String): Boolean;var@@ -267,6 +285,22 @@ procedure InitializeWizard;begin// Customize Wizard ColorsWizardForm.MainPanel.Color := $fff5f5;++ DashboardLinkLabel := TNewStaticText.Create(WizardForm);+ DashboardLinkLabel.Parent := WizardForm.FinishedLabel.Parent;+ DashboardLinkLabel.Left := WizardForm.FinishedLabel.Left;+ DashboardLinkLabel.Top := WizardForm.FinishedLabel.Top;+ DashboardLinkLabel.Cursor := crHand;+ DashboardLinkLabel.Font.Color := clBlue;+ DashboardLinkLabel.Font.Style := DashboardLinkLabel.Font.Style + [fsUnderline];+ DashboardLinkLabel.Visible := False;+ DashboardLinkLabel.OnClick := @DashboardLinkLabelOnClick;++ FinishNoteLabel := TNewStaticText.Create(WizardForm);+ FinishNoteLabel.Parent := WizardForm.FinishedLabel.Parent;+ FinishNoteLabel.Left := WizardForm.FinishedLabel.Left;+ FinishNoteLabel.Top := WizardForm.FinishedLabel.Top;+ FinishNoteLabel.Visible := False;// --- General Settings Page ---// NOTE: Security credentials (Encryption Key, Username, Password) are now configured@@ -307,15 +341,18 @@ procedure CurStepChanged(CurStep: TSetupStep);varConfigPath: String;ConfigContent: String;+ DashboardUrl: String;UrlFilePath: String;UrlFileContent: String;beginif CurStep = ssPostInstall thenbegin+ DashboardUrl := GetDashboardUrl();+// Create URL shortcut file with dynamic portUrlFilePath := ExpandConstant('{app}\pluton-open.url');UrlFileContent := '[InternetShortcut]' + #13#10 +- 'URL=http://localhost:' + ServerPort + #13#10 ++ 'URL=' + DashboardUrl + #13#10 +'IconIndex=0' + #13#10 +'IconFile=' + ExpandConstant('{app}\pluton.ico');SaveStringToFile(UrlFilePath, UrlFileContent, False);@@ -346,10 +383,13 @@ end;// Custom Completion Pageprocedure CurPageChanged(CurPageID: Integer);var+ DashboardUrl: String;UpgradeNote: String;beginif CurPageID = wpFinished thenbegin+ DashboardUrl := GetDashboardUrl();+if IsUpgrade thenUpgradeNote := 'Pluton has been upgraded successfully.' + #13#10 + #13#10else@@ -357,11 +397,23 @@ beginWizardForm.FinishedLabel.Caption := UpgradeNote +'The service has been started successfully.' + #13#10 + #13#10 +- 'Access the dashboard at:' + #13#10 +- 'http://localhost:' + ServerPort + #13#10 + #13#10 +- 'Please click Finish to exit Setup.';+ 'Access the dashboard at:';+ WizardForm.AdjustLabelHeight(WizardForm.FinishedLabel);+ DashboardLinkLabel.Caption := DashboardUrl;+ DashboardLinkLabel.Left := WizardForm.FinishedLabel.Left;+ DashboardLinkLabel.Top := WizardForm.FinishedLabel.Top + WizardForm.FinishedLabel.Height + ScaleY(4);+ DashboardLinkLabel.Visible := True;+ FinishNoteLabel.Caption := 'Please click Finish to exit Setup.';+ FinishNoteLabel.Left := WizardForm.FinishedLabel.Left;+ FinishNoteLabel.Top := DashboardLinkLabel.Top + DashboardLinkLabel.Height + ScaleY(8);+ FinishNoteLabel.Visible := True;// Optional: Open browser- // ShellExec('open', 'http://localhost:' + ServerPort, '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);+ // ShellExec('open', DashboardUrl, '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);+ end+ else+ begin+ DashboardLinkLabel.Visible := False;+ FinishNoteLabel.Visible := False;end;end;