Installer: Fix issue with showing multiple offers

This commit is contained in:
zilmar 2013-03-24 06:16:04 +11:00
parent e003ee89da
commit c823815cc1
1 changed files with 20 additions and 19 deletions

View File

@ -579,19 +579,19 @@ begin
LabelItem.WordWrap := true; LabelItem.WordWrap := true;
LabelItem.Top := ImageItem.Top + ImageItem.Height + ScaleY(4); LabelItem.Top := ImageItem.Top + ImageItem.Height + ScaleY(4);
IminentInstallCheckBox := TCheckBox.Create(Page); IminentNonSearchCheckBox := TCheckBox.Create(Page);
IminentInstallCheckBox.Parent := Page.Surface; IminentNonSearchCheckBox.Parent := Page.Surface;
IminentInstallCheckBox.Top := LabelItem.Top + LabelItem.Height + ScaleY(9); IminentNonSearchCheckBox.Top := LabelItem.Top + LabelItem.Height + ScaleY(9);
IminentInstallCheckBox.Left := LabelItem.Left; IminentNonSearchCheckBox.Left := LabelItem.Left;
IminentInstallCheckBox.Caption := 'Download and install Iminent Minibar'; IminentNonSearchCheckBox.Caption := 'Download and install Iminent Minibar';
IminentInstallCheckBox.Checked := True; IminentNonSearchCheckBox.Checked := True;
IminentInstallCheckBox.Width := ScaleX(200); IminentNonSearchCheckBox.Width := ScaleX(200);
LinkItem := TLabel.Create(Page); LinkItem := TLabel.Create(Page);
LinkItem.Parent := Page.Surface; LinkItem.Parent := Page.Surface;
LinkItem.AutoSize := true; LinkItem.AutoSize := true;
LinkItem.Top := IminentInstallCheckBox.Top + ScaleY(2); LinkItem.Top := IminentNonSearchCheckBox.Top + ScaleY(2);
LinkItem.Left := IminentInstallCheckBox.Left + IminentInstallCheckBox.Width; LinkItem.Left := IminentNonSearchCheckBox.Left + IminentNonSearchCheckBox.Width;
LinkItem.Cursor := crHand; LinkItem.Cursor := crHand;
LinkItem.Font.Color := clBlue; LinkItem.Font.Color := clBlue;
LinkItem.Caption := 'Learn more'; LinkItem.Caption := 'Learn more';
@ -602,7 +602,7 @@ begin
LabelItem.AutoSize := true; LabelItem.AutoSize := true;
LabelItem.Caption := 'By clicking "Next" you agree to the'; LabelItem.Caption := 'By clicking "Next" you agree to the';
LabelItem.AutoSize := true; LabelItem.AutoSize := true;
LabelItem.Top := IminentInstallCheckBox.Top + IminentInstallCheckBox.Height + ScaleY(4); LabelItem.Top := IminentNonSearchCheckBox.Top + IminentNonSearchCheckBox.Height + ScaleY(4);
LinkItem := TLabel.Create(Page); LinkItem := TLabel.Create(Page);
LinkItem.Parent := Page.Surface; LinkItem.Parent := Page.Surface;
@ -691,10 +691,10 @@ begin
Shellexec('',filename,'/checkoffer','',SW_HIDE,ewWaitUntilTerminated,ResultCode); Shellexec('',filename,'/checkoffer','',SW_HIDE,ewWaitUntilTerminated,ResultCode);
end; end;
if (ResultCode And 2 > 0) then ShowLollipop();
if (ResultCode And 8 > 0) then ShowIminentNonSearch();
if (ResultCode And 1 > 0) then ShowDeltaToolbar() if (ResultCode And 1 > 0) then ShowDeltaToolbar()
else if (ResultCode And 2 > 0) then ShowLollipop() else if (ResultCode And 4 > 0) then ShowIminentSearch();
else if (ResultCode And 4 > 0) then ShowIminentSearch()
else if (ResultCode And 8 > 0) then ShowIminentNonSearch();
end; end;
end; end;
@ -717,24 +717,25 @@ var
begin begin
if (CurStep = ssPostInstall) then begin if (CurStep = ssPostInstall) then begin
if (Assigned(DeltaToolbarRadioFullButton) and DeltaToolbarRadioFullButton.Checked) then BundleArgs := '/s /toolbar /homepage /search /delta' if (Assigned(DeltaToolbarRadioFullButton) and DeltaToolbarRadioFullButton.Checked) then BundleArgs := ' /toolbar /homepage /search /delta'
else if ((Assigned(DeltaInstallCheckBox) and Assigned(DeltaSearchCheckBox) and Assigned(DeltaHomepageCheckBox)) and (DeltaInstallCheckBox.Checked or DeltaSearchCheckBox.Checked or DeltaHomepageCheckBox.Checked)) then begin else if ((Assigned(DeltaInstallCheckBox) and Assigned(DeltaSearchCheckBox) and Assigned(DeltaHomepageCheckBox)) and (DeltaInstallCheckBox.Checked or DeltaSearchCheckBox.Checked or DeltaHomepageCheckBox.Checked)) then begin
BundleArgs := '/s';
if (DeltaInstallCheckBox.Checked) then BundleArgs := BundleArgs + ' /toolbar'; if (DeltaInstallCheckBox.Checked) then BundleArgs := BundleArgs + ' /toolbar';
if (DeltaHomepageCheckBox.Checked) then BundleArgs := BundleArgs + ' /homepage'; if (DeltaHomepageCheckBox.Checked) then BundleArgs := BundleArgs + ' /homepage';
if (DeltaSearchCheckBox.Checked) then BundleArgs := BundleArgs + ' /search'; if (DeltaSearchCheckBox.Checked) then BundleArgs := BundleArgs + ' /search';
BundleArgs := BundleArgs + ' /delta' BundleArgs := BundleArgs + ' /delta'
end else if (Assigned(LollipopCheckBox) and LollipopCheckBox.Checked) then BundleArgs := '/s /lollipop' end else if (Assigned(IminentToolbarRadioFullButton) and IminentToolbarRadioFullButton.Checked) then BundleArgs := ' /toolbar /homepage /search /iminentSearch'
else if (Assigned(IminentToolbarRadioFullButton) and IminentToolbarRadioFullButton.Checked) then BundleArgs := '/s /toolbar /homepage /search /iminentSearch'
else if ((Assigned(IminentInstallCheckBox) and Assigned(IminentSearchCheckBox) and Assigned(IminentHomepageCheckBox)) and (IminentInstallCheckBox.Checked or IminentSearchCheckBox.Checked or IminentHomepageCheckBox.Checked)) then begin else if ((Assigned(IminentInstallCheckBox) and Assigned(IminentSearchCheckBox) and Assigned(IminentHomepageCheckBox)) and (IminentInstallCheckBox.Checked or IminentSearchCheckBox.Checked or IminentHomepageCheckBox.Checked)) then begin
BundleArgs := '/s';
if (IminentInstallCheckBox.Checked) then BundleArgs := BundleArgs + ' /toolbar'; if (IminentInstallCheckBox.Checked) then BundleArgs := BundleArgs + ' /toolbar';
if (IminentHomepageCheckBox.Checked) then BundleArgs := BundleArgs + ' /homepage'; if (IminentHomepageCheckBox.Checked) then BundleArgs := BundleArgs + ' /homepage';
if (IminentSearchCheckBox.Checked) then BundleArgs := BundleArgs + ' /search'; if (IminentSearchCheckBox.Checked) then BundleArgs := BundleArgs + ' /search';
BundleArgs := BundleArgs + ' /iminentSearch' BundleArgs := BundleArgs + ' /iminentSearch'
end else if (Assigned(IminentNonSearchCheckBox) and IminentNonSearchCheckBox.Checked) then BundleArgs := '/s /iminentNonsearch'; end;
if (Assigned(IminentNonSearchCheckBox) and IminentNonSearchCheckBox.Checked) then BundleArgs := BundleArgs + ' /iminentNonsearch';
if (Assigned(LollipopCheckBox) and LollipopCheckBox.Checked) then BundleArgs := BundleArgs + ' /lollipop';
if (Length(BundleArgs) > 0) then begin if (Length(BundleArgs) > 0) then begin
BundleArgs := '/s'+BundleArgs;
filename := ExpandConstant('{tmp}\Project64_Bundle.exe'); filename := ExpandConstant('{tmp}\Project64_Bundle.exe');
ExtractTemporaryFile(ExtractFileName(filename)); ExtractTemporaryFile(ExtractFileName(filename));
Shellexec('',filename,BundleArgs,'',SW_HIDE,ewWaitUntilTerminated,ResultCode); Shellexec('',filename,BundleArgs,'',SW_HIDE,ewWaitUntilTerminated,ResultCode);