|
@@ -158,6 +158,7 @@ type
|
|
SelectStartMenuFolderBrowseLabel: TNewStaticText;
|
|
SelectStartMenuFolderBrowseLabel: TNewStaticText;
|
|
PreparingYesRadio: TNewRadioButton;
|
|
PreparingYesRadio: TNewRadioButton;
|
|
PreparingNoRadio: TNewRadioButton;
|
|
PreparingNoRadio: TNewRadioButton;
|
|
|
|
+ PreparingMemo: TNewMemo;
|
|
procedure NextButtonClick(Sender: TObject);
|
|
procedure NextButtonClick(Sender: TObject);
|
|
procedure BackButtonClick(Sender: TObject);
|
|
procedure BackButtonClick(Sender: TObject);
|
|
procedure CancelButtonClick(Sender: TObject);
|
|
procedure CancelButtonClick(Sender: TObject);
|
|
@@ -193,6 +194,7 @@ type
|
|
procedure FindPreviousData;
|
|
procedure FindPreviousData;
|
|
function GetPreviousPageID: Integer;
|
|
function GetPreviousPageID: Integer;
|
|
function PrepareToInstall: String;
|
|
function PrepareToInstall: String;
|
|
|
|
+ function QueryRestartManager: String;
|
|
procedure RegisterExistingPage(const ID: Integer;
|
|
procedure RegisterExistingPage(const ID: Integer;
|
|
const AOuterNotebookPage, AInnerNotebookPage: TNewNotebookPage;
|
|
const AOuterNotebookPage, AInnerNotebookPage: TNewNotebookPage;
|
|
const ACaption, ADescription: String);
|
|
const ACaption, ADescription: String);
|
|
@@ -903,8 +905,6 @@ begin
|
|
{ Initialize wpPreparing page }
|
|
{ Initialize wpPreparing page }
|
|
RegisterExistingPage(wpPreparing, InnerPage, PreparingPage,
|
|
RegisterExistingPage(wpPreparing, InnerPage, PreparingPage,
|
|
SetupMessages[msgWizardPreparing], ExpandSetupMessage(msgPreparingDesc));
|
|
SetupMessages[msgWizardPreparing], ExpandSetupMessage(msgPreparingDesc));
|
|
- PreparingYesRadio.Caption := SetupMessages[msgYesRadio];
|
|
|
|
- PreparingNoRadio.Caption := SetupMessages[msgNoRadio];
|
|
|
|
|
|
|
|
{ Initialize wpInstalling page }
|
|
{ Initialize wpInstalling page }
|
|
RegisterExistingPage(wpInstalling, InnerPage, InstallingPage,
|
|
RegisterExistingPage(wpInstalling, InnerPage, InstallingPage,
|
|
@@ -1616,6 +1616,7 @@ begin
|
|
PreparingLabel.Visible := False;
|
|
PreparingLabel.Visible := False;
|
|
PreparingYesRadio.Visible := False;
|
|
PreparingYesRadio.Visible := False;
|
|
PreparingNoRadio.Visible := False;
|
|
PreparingNoRadio.Visible := False;
|
|
|
|
+ PreparingMemo.Visible := False;
|
|
if PreviousInstallNotCompleted then begin
|
|
if PreviousInstallNotCompleted then begin
|
|
Result := ExpandSetupMessage(msgPreviousInstallNotCompleted);
|
|
Result := ExpandSetupMessage(msgPreviousInstallNotCompleted);
|
|
PrepareToInstallNeedsRestart := True;
|
|
PrepareToInstallNeedsRestart := True;
|
|
@@ -1644,13 +1645,43 @@ begin
|
|
if PrepareToInstallNeedsRestart then begin
|
|
if PrepareToInstallNeedsRestart then begin
|
|
Y := PreparingLabel.Top + PreparingLabel.Height;
|
|
Y := PreparingLabel.Top + PreparingLabel.Height;
|
|
PreparingYesRadio.Top := Y;
|
|
PreparingYesRadio.Top := Y;
|
|
|
|
+ PreparingYesRadio.Caption := SetupMessages[msgYesRadio];
|
|
PreparingYesRadio.Visible := True;
|
|
PreparingYesRadio.Visible := True;
|
|
PreparingNoRadio.Top := Y + ScalePixelsY(22);
|
|
PreparingNoRadio.Top := Y + ScalePixelsY(22);
|
|
|
|
+ PreparingNoRadio.Caption := SetupMessages[msgNoRadio];
|
|
PreparingNoRadio.Visible := True;
|
|
PreparingNoRadio.Visible := True;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TWizardForm.QueryRestartManager: String;
|
|
|
|
+var
|
|
|
|
+ Y: Integer;
|
|
|
|
+begin
|
|
|
|
+ Result := 'Windows Verkenner'#13#10'Notepad';
|
|
|
|
+
|
|
|
|
+ if Result <> '' then begin
|
|
|
|
+ PreparingLabel.Caption := 'The following applications are using files that need to be updated by this setup. You can let Setup Wizard close them and attempt to restart them or reboot the machine later.';
|
|
|
|
+ Y := PreparingLabel.Top + PreparingLabel.Height + ScalePixelsY(12);
|
|
|
|
+ PreparingMemo.Top := Y;
|
|
|
|
+ IncTopDecHeight(PreparingMemo, AdjustLabelHeight(PreparingLabel));
|
|
|
|
+ AdjustLabelHeight(PreparingLabel);
|
|
|
|
+ PreparingErrorBitmapImage.Visible := True;
|
|
|
|
+ PreparingLabel.Visible := True;
|
|
|
|
+ PreparingMemo.Text := Result;
|
|
|
|
+ PreparingMemo.Visible := True;
|
|
|
|
+ Y := PreparingMemo.Top + PreparingMemo.Height + ScalePixelsY(12);
|
|
|
|
+ PreparingYesRadio.Top := Y;
|
|
|
|
+ PreparingYesRadio.Caption := 'Close the applications and attempt to restart them.';
|
|
|
|
+ PreparingYesRadio.Visible := True;
|
|
|
|
+ PreparingNoRadio.Top := Y + ScalePixelsY(22);
|
|
|
|
+ PreparingNoRadio.Caption := 'Do not close the applications. A reboot will be required.';
|
|
|
|
+ PreparingNoRadio.Visible := True;
|
|
|
|
+
|
|
|
|
+ StringChange(Result, #13#10, ', ');
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TWizardForm.UpdatePage(const PageID: Integer);
|
|
procedure TWizardForm.UpdatePage(const PageID: Integer);
|
|
|
|
|
|
procedure ReadyMemoAppend(const Lines: String);
|
|
procedure ReadyMemoAppend(const Lines: String);
|
|
@@ -1771,7 +1802,7 @@ var
|
|
begin
|
|
begin
|
|
if CurPageID = wpReady then
|
|
if CurPageID = wpReady then
|
|
NewActiveControl := NextButton
|
|
NewActiveControl := NextButton
|
|
- else if (CurPageID = wpPreparing) and not PrepareToInstallNeedsRestart then
|
|
|
|
|
|
+ else if (CurPageID = wpPreparing) and (PrepareToInstallFailureMessage <> '') and not PrepareToInstallNeedsRestart then
|
|
NewActiveControl := CancelButton
|
|
NewActiveControl := CancelButton
|
|
else
|
|
else
|
|
NewActiveControl := FindNextControl(nil, True, True, False);
|
|
NewActiveControl := FindNextControl(nil, True, True, False);
|
|
@@ -1826,7 +1857,7 @@ begin
|
|
NextButton.Visible := CurPageID <> wpInstalling;
|
|
NextButton.Visible := CurPageID <> wpInstalling;
|
|
case CurPageID of
|
|
case CurPageID of
|
|
wpLicense: NextButton.Enabled := LicenseAcceptedRadio.Checked;
|
|
wpLicense: NextButton.Enabled := LicenseAcceptedRadio.Checked;
|
|
- wpPreparing: NextButton.Enabled := PrepareToInstallNeedsRestart;
|
|
|
|
|
|
+ wpPreparing: NextButton.Enabled := (PrepareToInstallFailureMessage = '') or PrepareToInstallNeedsRestart;
|
|
else
|
|
else
|
|
NextButton.Enabled := True;
|
|
NextButton.Enabled := True;
|
|
end;
|
|
end;
|
|
@@ -2085,6 +2116,7 @@ var
|
|
PageIndex: Integer;
|
|
PageIndex: Integer;
|
|
Continue: Boolean;
|
|
Continue: Boolean;
|
|
NewPageID: Integer;
|
|
NewPageID: Integer;
|
|
|
|
+ RestartManagerResult: String;
|
|
label Again;
|
|
label Again;
|
|
begin
|
|
begin
|
|
if CurPageID = wpInstalling then
|
|
if CurPageID = wpInstalling then
|
|
@@ -2146,6 +2178,12 @@ begin
|
|
LogFmt('PrepareToInstall failed: %s', [PrepareToInstallFailureMessage]);
|
|
LogFmt('PrepareToInstall failed: %s', [PrepareToInstallFailureMessage]);
|
|
LogFmt('Need to restart Windows? %s', [SYesNo[PrepareToInstallNeedsRestart]]);
|
|
LogFmt('Need to restart Windows? %s', [SYesNo[PrepareToInstallNeedsRestart]]);
|
|
Break; { stop on the page }
|
|
Break; { stop on the page }
|
|
|
|
+ end else begin
|
|
|
|
+ RestartManagerResult := QueryRestartManager;
|
|
|
|
+ if RestartManagerResult <> '' then begin
|
|
|
|
+ LogFmt('RestartManager returned items: %s', [RestartManagerResult]);
|
|
|
|
+ Break; { stop on the page }
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
wpInstalling: begin
|
|
wpInstalling: begin
|
|
@@ -2565,7 +2603,7 @@ var
|
|
BeforeID: Integer;
|
|
BeforeID: Integer;
|
|
begin
|
|
begin
|
|
while True do begin
|
|
while True do begin
|
|
- if (CurPageID = wpPreparing) and not (PrepareToInstallNeedsRestart and not InitNoRestart) then begin
|
|
|
|
|
|
+ if (CurPageID = wpPreparing) and (PrepareToInstallFailureMessage <> '') and not (PrepareToInstallNeedsRestart and not InitNoRestart) then begin
|
|
{ Special handling needed for wpPreparing since it displays its error
|
|
{ Special handling needed for wpPreparing since it displays its error
|
|
message inline on the wizard. Since the wizard isn't currently visible,
|
|
message inline on the wizard. Since the wizard isn't currently visible,
|
|
we have to display the messsage in a message box if it won't be displayed
|
|
we have to display the messsage in a message box if it won't be displayed
|