neosecure 0 #262750 Posted April 15, 2015 Hello Everyone. I need help.... When the components page is loaded, I want to increase the Width size. And.... In addition. I want to adjust the location of the 'About' button. Could anyone help me? Thanks so much in advanced. [setup]AppName=My ProgramAppVersion=1.5DefaultDirName={pf}My ProgramDefaultGroupName=My ProgramUninstallDisplayIcon={app}MyProg.exeOutputDir=userdocs:Inno Setup Examples Output[Types]Name: "full"; Description: "Full installation"Name: "compact"; Description: "Compact installation"Name: "custom"; Description: "Custom installation"; Flags: iscustom[Components]Name: "program"; Description: "Program Files"; Types: full compact custom; Flags: fixedName: "help"; Description: "Help File"; Types: fullName: "readme"; Description: "Readme File"; Types: fullName: "readmeen"; Description: "English"; Flags: exclusiveName: "readmede"; Description: "German"; Flags: exclusive procedure AboutButtonOnClick(Sender: TObject);beginMsgBox('This is a demo of how to create a button!', mbInformation, mb_Ok);end;procedure CreateAboutButton(ParentForm: TSetupForm; CancelButton: TNewButton);varAboutButton: TNewButton;beginAboutButton := TNewButton.Create(ParentForm);AboutButton.Left := ParentForm.ClientWidth - CancelButton.Left - CancelButton.Width;AboutButton.Top := CancelButton.Top;AboutButton.Width := CancelButton.Width;AboutButton.Height := CancelButton.Height;AboutButton.Caption := '&About...';AboutButton.OnClick := @AboutButtonOnClick;AboutButton.Parent := ParentForm;end;procedure InitializeWizard1();beginCreateAboutButton(WizardForm, WizardForm.CancelButton);end;typeTPositionStorage = array of Integer;varCompPageModified: Boolean;CompPagePositions: TPositionStorage;procedure SaveComponentsPage(out Storage: TPositionStorage);beginSetArrayLength(Storage, 10);Storage[0] := WizardForm.Height;Storage[1] := WizardForm.NextButton.Top;Storage[2] := WizardForm.BackButton.Top;Storage[3] := WizardForm.CancelButton.Top;Storage[4] := WizardForm.ComponentsList.Height;Storage[5] := WizardForm.OuterNotebook.Height;Storage[6] := WizardForm.InnerNotebook.Height;Storage[7] := WizardForm.Bevel.Top;Storage[8] := WizardForm.BeveledLabel.Top;Storage[9] := WizardForm.ComponentsDiskSpaceLabel.Top;end;procedure LoadComponentsPage(const Storage: TPositionStorage;HeightOffset: Integer);beginif GetArrayLength(Storage) <> 10 thenRaiseException('Invalid storage array length.');WizardForm.Height := Storage[0] + HeightOffset;WizardForm.NextButton.Top := Storage[1] + HeightOffset;WizardForm.BackButton.Top := Storage[2] + HeightOffset;WizardForm.CancelButton.Top := Storage[3] + HeightOffset;WizardForm.ComponentsList.Height := Storage[4] + HeightOffset;WizardForm.OuterNotebook.Height := Storage[5] + HeightOffset;WizardForm.InnerNotebook.Height := Storage[6] + HeightOffset;WizardForm.Bevel.Top := Storage[7] + HeightOffset;WizardForm.BeveledLabel.Top := Storage[8] + HeightOffset;WizardForm.ComponentsDiskSpaceLabel.Top := Storage[9] + HeightOffset;end;procedure InitializeWizard2();beginCompPageModified := False;end;procedure CurPageChanged(CurPageID: Integer);beginif CurpageID = wpSelectComponents thenbeginSaveComponentsPage(CompPagePositions);LoadComponentsPage(CompPagePositions, 200);CompPageModified := True;endelseif CompPageModified thenbeginLoadComponentsPage(CompPagePositions, 0);CompPageModified := False;end;end;procedure InitializeWizard();beginInitializeWizard1();InitializeWizard2();end; Quote Share this post Link to post Short link Share on other sites
AtotIK 580 #262764 Posted April 15, 2015 (edited) neosecure, something like this: procedure ResizeComponentsPage(CurPageID: Integer); begin case CurPageID of wpSelectComponents: begin ......... end; procedure CurPageChanged(CurPageID: Integer); begin ResizeComponentsPage(CurPageID); end; or more simple: [Setup] AppName=My Program AppVersion=1.5 DefaultDirName={pf}My Program DefaultGroupName=My Program UninstallDisplayIcon={app}MyProg.exe OutputDir=userdocs:Inno Setup Examples Output [Types] Name: "full"; Description: "Full installation" Name: "compact"; Description: "Compact installation" Name: "custom"; Description: "Custom installation"; Flags: iscustom [Components] Name: "program"; Description: "Program Files"; Types: full compact custom; Flags: fixed Name: "help"; Description: "Help File"; Types: full Name: "readme"; Description: "Readme File"; Types: full Name: "readmeen"; Description: "English"; Flags: exclusive Name: "readmede"; Description: "German"; Flags: exclusive [~~~~~~~~~~~~~~~~~~~~~Code~~~~~~~~~~~~~~~~~~~~~] var AboutButton: TNewButton; procedure AboutButtonOnClick(Sender: TObject); begin MsgBox('This is a demo of how to create a button!', mbInformation, mb_Ok); end; procedure CreateAboutButton(ParentForm: TSetupForm; CancelButton: TNewButton); begin AboutButton := TNewButton.Create(ParentForm); AboutButton.Left := ParentForm.ClientWidth - CancelButton.Left - CancelButton.Width; AboutButton.Top := CancelButton.Top; AboutButton.Width := CancelButton.Width; AboutButton.Height := CancelButton.Height; AboutButton.Caption := '&About...'; AboutButton.OnClick := @AboutButtonOnClick; AboutButton.Parent := ParentForm; end; procedure InitializeWizard1(); begin CreateAboutButton(WizardForm, WizardForm.CancelButton); end; type TPositionStorage = array of Integer; var CompPageModified: Boolean; CompPagePositions: TPositionStorage; procedure SaveComponentsPage(out Storage: TPositionStorage); begin SetArrayLength(Storage, 11); Storage[0] := WizardForm.Height; Storage[1] := WizardForm.NextButton.Top; Storage[2] := WizardForm.BackButton.Top; Storage[3] := WizardForm.CancelButton.Top; Storage[4] := WizardForm.ComponentsList.Height; Storage[5] := WizardForm.OuterNotebook.Height; Storage[6] := WizardForm.InnerNotebook.Height; Storage[7] := WizardForm.Bevel.Top; Storage[8] := WizardForm.BeveledLabel.Top; Storage[9] := WizardForm.ComponentsDiskSpaceLabel.Top; Storage[10] := AboutButton.Top; end; procedure LoadComponentsPage(const Storage: TPositionStorage; HeightOffset: Integer); begin if GetArrayLength(Storage) <> 11 then RaiseException('Invalid storage array length.'); WizardForm.Height := Storage[0] + HeightOffset; WizardForm.NextButton.Top := Storage[1] + HeightOffset; WizardForm.BackButton.Top := Storage[2] + HeightOffset; WizardForm.CancelButton.Top := Storage[3] + HeightOffset; WizardForm.ComponentsList.Height := Storage[4] + HeightOffset; WizardForm.OuterNotebook.Height := Storage[5] + HeightOffset; WizardForm.InnerNotebook.Height := Storage[6] + HeightOffset; WizardForm.Bevel.Top := Storage[7] + HeightOffset; WizardForm.BeveledLabel.Top := Storage[8] + HeightOffset; WizardForm.ComponentsDiskSpaceLabel.Top := Storage[9] + HeightOffset; AboutButton.Top := Storage[10] + HeightOffset; end; procedure InitializeWizard2(); begin CompPageModified := False; end; procedure CurPageChanged(CurPageID: Integer); begin if CurpageID = wpSelectComponents then begin SaveComponentsPage(CompPagePositions); LoadComponentsPage(CompPagePositions, 100); CompPageModified := True; end else if CompPageModified then begin LoadComponentsPage(CompPagePositions, 0); CompPageModified := False; end; end; procedure InitializeWizard(); begin InitializeWizard1(); InitializeWizard2(); end; Edited April 15, 2015 by AtotIK Quote Share this post Link to post Short link Share on other sites
neosecure 0 #262795 Posted April 15, 2015 (edited) procedure ResizeComponentsPage(CurPageID: Integer); begin case CurPageID of wpSelectComponents: begin ......... end; procedure CurPageChanged(CurPageID: Integer); begin ResizeComponentsPage(CurPageID); end; //======================================================================= // AtotIK... I appreciate your kindness :) // I add "ResizeComponentsPage()" // But,... there is no change. // For example, https://www.dropbox.com/s/4a9blb9q6keoer2/cats.jpg // When the components page is loaded, I want to increase the Width size. // Is there a way? // Only the width of the components page ... // I ask for help again. // Have a good day ! :) //======================================================================= [setup] AppName=My Program AppVersion=1.5 DefaultDirName={pf}My Program DefaultGroupName=My Program UninstallDisplayIcon={app}MyProg.exe OutputDir=userdocs:Inno Setup Examples Output [Types] Name: "full"; Description: "Full installation" Name: "compact"; Description: "Compact installation" Name: "custom"; Description: "Custom installation"; Flags: iscustom [Components] Name: "program"; Description: "Program Files"; Types: full compact custom; Flags: fixed Name: "help"; Description: "Help File"; Types: full Name: "readme"; Description: "Readme File"; Types: full Name: "readmeen"; Description: "English"; Flags: exclusive Name: "readmede"; Description: "German"; Flags: exclusive var AboutButton: TNewButton; procedure AboutButtonOnClick(Sender: TObject); begin MsgBox('This is a demo of how to create a button!', mbInformation, mb_Ok); end; procedure CreateAboutButton(ParentForm: TSetupForm; CancelButton: TNewButton); begin AboutButton := TNewButton.Create(ParentForm); AboutButton.Left := ParentForm.ClientWidth - CancelButton.Left - CancelButton.Width; AboutButton.Top := CancelButton.Top; AboutButton.Width := CancelButton.Width; AboutButton.Height := CancelButton.Height; AboutButton.Caption := '&About...'; AboutButton.OnClick := @AboutButtonOnClick; AboutButton.Parent := ParentForm; end; procedure InitializeWizard1(); begin CreateAboutButton(WizardForm, WizardForm.CancelButton); end; type TPositionStorage = array of Integer; var CompPageModified: Boolean; CompPagePositions: TPositionStorage; procedure SaveComponentsPage(out Storage: TPositionStorage); begin SetArrayLength(Storage, 11); Storage[0] := WizardForm.Height; Storage[1] := WizardForm.NextButton.Top; Storage[2] := WizardForm.BackButton.Top; Storage[3] := WizardForm.CancelButton.Top; Storage[4] := WizardForm.ComponentsList.Height; Storage[5] := WizardForm.OuterNotebook.Height; Storage[6] := WizardForm.InnerNotebook.Height; Storage[7] := WizardForm.Bevel.Top; Storage[8] := WizardForm.BeveledLabel.Top; Storage[9] := WizardForm.ComponentsDiskSpaceLabel.Top; Storage[10] := AboutButton.Top; end; procedure LoadComponentsPage(const Storage: TPositionStorage; HeightOffset: Integer); begin if GetArrayLength(Storage) <> 11 then RaiseException('Invalid storage array length.'); WizardForm.Height := Storage[0] + HeightOffset; WizardForm.NextButton.Top := Storage[1] + HeightOffset; WizardForm.BackButton.Top := Storage[2] + HeightOffset; WizardForm.CancelButton.Top := Storage[3] + HeightOffset; WizardForm.ComponentsList.Height := Storage[4] + HeightOffset; WizardForm.OuterNotebook.Height := Storage[5] + HeightOffset; WizardForm.InnerNotebook.Height := Storage[6] + HeightOffset; WizardForm.Bevel.Top := Storage[7] + HeightOffset; WizardForm.BeveledLabel.Top := Storage[8] + HeightOffset; WizardForm.ComponentsDiskSpaceLabel.Top := Storage[9] + HeightOffset; AboutButton.Top := Storage[10] + HeightOffset; end; procedure InitializeWizard2(); begin CompPageModified := False; end; //--- procedure CurPageChanged(CurPageID: Integer); //--- I add this ... procedure ResizeComponentsPage(CurPageID: Integer); begin if CurpageID = wpSelectComponents then begin SaveComponentsPage(CompPagePositions); LoadComponentsPage(CompPagePositions, 200); CompPageModified := True; end else if CompPageModified then begin LoadComponentsPage(CompPagePositions, 0); CompPageModified := False; end; end; procedure CurPageChanged(CurPageID: Integer); begin ResizeComponentsPage(CurPageID); end; procedure InitializeWizard(); begin InitializeWizard1(); InitializeWizard2(); end; Edited April 15, 2015 by neosecure Quote Share this post Link to post Short link Share on other sites
voin_123 5 #262806 Posted April 15, 2015 А как изменить язык для BackUpPage.iss Quote Share this post Link to post Short link Share on other sites
AtotIK 580 #262807 Posted April 15, 2015 (edited) neosecure, thous code for example, you MUST think by yourself in next time. [Setup] AppName=My Program AppVersion=1.5 DefaultDirName={pf}My Program DefaultGroupName=My Program OutputDir=Output [Messages] BeveledLabel=Debug Bevel [Types] Name: "full"; Description: "Full installation" Name: "compact"; Description: "Compact installation" Name: "custom"; Description: "Custom installation"; Flags: iscustom [Components] Name: "program"; Description: "Program Files"; Types: full compact custom; Flags: fixed Name: "help"; Description: "Help File"; Types: full Name: "readme"; Description: "Readme File"; Types: full Name: "readmeen"; Description: "English"; Flags: exclusive Name: "readmede"; Description: "German"; Flags: exclusive [~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Code~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~] var AboutButton: TNewButton; procedure AboutButtonOnClick(Sender: TObject); begin MsgBox('This is a demo of how to create a button!', mbInformation, mb_Ok); end; procedure CreateAboutButton(ParentForm: TSetupForm; CancelButton: TNewButton); begin AboutButton:=TNewButton.Create(ParentForm); AboutButton.Left:=ParentForm.ClientWidth - CancelButton.Left - CancelButton.Width; AboutButton.Top:=CancelButton.Top; AboutButton.Width:=CancelButton.Width; AboutButton.Height:=CancelButton.Height; AboutButton.Caption:='&About...'; AboutButton.OnClick:=@AboutButtonOnClick; AboutButton.Parent:=ParentForm; end; procedure InitializeWizard1(); begin CreateAboutButton(WizardForm, WizardForm.CancelButton); end; type TPositionStorage = array of Integer; var CompPageModified: Boolean; CompPagePositions: TPositionStorage; procedure SaveComponentsPage(out Storage: TPositionStorage); begin SetArrayLength(Storage, 25); Storage[0]:=WizardForm.Height; Storage[1]:=WizardForm.NextButton.Top; Storage[2]:=WizardForm.BackButton.Top; Storage[3]:=WizardForm.CancelButton.Top; Storage[4]:=WizardForm.ComponentsList.Height; Storage[5]:=WizardForm.OuterNotebook.Height; Storage[6]:=WizardForm.InnerNotebook.Height; Storage[7]:=WizardForm.Bevel.Top; Storage[8]:=WizardForm.BeveledLabel.Top; Storage[9]:=WizardForm.ComponentsDiskSpaceLabel.Top; Storage[10]:=AboutButton.Top; Storage[11]:=WizardForm.Width; Storage[12]:=WizardForm.NextButton.Left; Storage[13]:=WizardForm.BackButton.Left; Storage[14]:=WizardForm.CancelButton.Left; Storage[15]:=WizardForm.ComponentsList.Width; Storage[16]:=WizardForm.OuterNotebook.Width; Storage[17]:=WizardForm.InnerNotebook.Width; Storage[18]:=WizardForm.Bevel.Width; Storage[19]:=WizardForm.BeveledLabel.Height; Storage[20]:=WizardForm.TypesCombo.Width; Storage[21]:=WizardForm.Bevel1.Width; Storage[22]:=WizardForm.WizardSmallBitmapImage.Left; Storage[23]:=WizardForm.MainPanel.Width; Storage[24]:=WizardForm.SelectComponentsLabel.Width; end; procedure LoadComponentsPage(const Storage: TPositionStorage; HeightOffset, WidthOffset: Integer); begin if GetArrayLength(Storage) <> 25 then RaiseException('Invalid storage array length.'); WizardForm.Height:=Storage[0] + HeightOffset; WizardForm.NextButton.Top:=Storage[1] + HeightOffset; WizardForm.BackButton.Top:=Storage[2] + HeightOffset; WizardForm.CancelButton.Top:=Storage[3] + HeightOffset; WizardForm.ComponentsList.Height:=Storage[4] + HeightOffset; WizardForm.OuterNotebook.Height:=Storage[5] + HeightOffset; WizardForm.InnerNotebook.Height:=Storage[6] + HeightOffset; WizardForm.Bevel.Top:=Storage[7] + HeightOffset; WizardForm.BeveledLabel.Top:=Storage[8] + HeightOffset; WizardForm.ComponentsDiskSpaceLabel.Top:=Storage[9] + HeightOffset; AboutButton.Top:=Storage[10] + HeightOffset; WizardForm.Width:=Storage[11] + WidthOffset; WizardForm.NextButton.Left:=Storage[12] + WidthOffset; WizardForm.BackButton.Left:=Storage[13] + WidthOffset; WizardForm.CancelButton.Left:=Storage[14] + WidthOffset; WizardForm.ComponentsList.Width:=Storage[15] + WidthOffset; WizardForm.OuterNotebook.Width:=Storage[16] + WidthOffset; WizardForm.InnerNotebook.Width:=Storage[17] + WidthOffset; WizardForm.Bevel.Width:=Storage[18] + WidthOffset; WizardForm.BeveledLabel.Height:=Storage[19] + WidthOffset; WizardForm.TypesCombo.Width:=Storage[20] + WidthOffset; WizardForm.Bevel1.Width:=Storage[21] + WidthOffset; WizardForm.WizardSmallBitmapImage.Left:=Storage[22] + WidthOffset; WizardForm.MainPanel.Width:=Storage[23] + WidthOffset; WizardForm.SelectComponentsLabel.Width:=Storage[24] + WidthOffset; end; procedure InitializeWizard2(); begin CompPageModified:=False; end; procedure CurPageChanged(CurPageID: Integer); begin if CurpageID = wpSelectComponents then begin SaveComponentsPage(CompPagePositions); LoadComponentsPage(CompPagePositions, 200, 200); CompPageModified:=True; end else if CompPageModified then begin LoadComponentsPage(CompPagePositions, 0, 0); CompPageModified:=False; end; end; procedure InitializeWizard(); begin InitializeWizard1(); InitializeWizard2(); end; voin_123, там весь скрипт переписывать надо, т.к. писался он на коленке. Edited April 15, 2015 by AtotIK Quote Share this post Link to post Short link Share on other sites
Kotyarko_O 1,906 #262816 Posted April 15, 2015 тупой вопрос, но какого хрена не переносит файл И откуда ты это выполняешь? Quote Share this post Link to post Short link Share on other sites
neosecure 0 #262826 Posted April 16, 2015 AtotIK, Thanks so much. :) I'm glad to resolve the problem. I'll do a better effort. Have a good day. :) Quote Share this post Link to post Short link Share on other sites
svskrm 5 #262958 Posted April 17, 2015 вопрос: есть стандартная форма компонентов wpSelectComponents и костомная ComponentsPage1проверка на выбор хотя бы одного компонента if CurPageID = ComponentsPage1.ID then if WizardSelectedComponents(False) = '' then begin MsgBox('Ни один из компонентов не выбран!', mbInformation, MB_OK); Result:= False; end; со стандартной работает, а во с кастомной не хочетпомогите, плиз... Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #262975 Posted April 17, 2015 И откуда ты это выполняешь? уже решил проблему Как IsComponentSelected использовать для нового листа? Или какая есть альтернатива? Quote Share this post Link to post Short link Share on other sites
Kotyarko_O 1,906 #263044 Posted April 17, 2015 (edited) Как IsComponentSelected использовать для нового листа? Или какая есть альтернатива? Никак. Можно сделать аналог, но проверять нужно будет не по имени компонента, а по его индексу в компонентЛисте. Или сразу обращаться к листу. вопрос: есть стандартная форма компонентов wpSelectComponents и костомная ComponentsPage1 проверка на выбор хотя бы одного компонента if WizardSelectedComponents(False) = '' then со стандартной работает, а во с кастомной не хочет И не должно. Как вариант: Function NextButtonClick(CurPageID: Integer): Boolean; var I, NotCheckedCount: Integer; begin Result := True; NotCheckedCount := 0; if CurPageID = страница_с_компонент_листом.ID then begin for I := 0 to твой_компонент_лист.Items.Count - 1 do begin if not твой_компонент_лист.Checked[I] then NotCheckedCount := NotCheckedCount + 1; end; Result := (NotCheckedCount = твой_компонент_лист.Items.Count); if not Result then MsgBoxEx(WizardForm.Handle, 'Ни один из представленных компонентов не выбран.', 'Выбор компонентов', MB_OK or MB_MB_ICONWARNING, 0, 0); end; end; Edited April 17, 2015 by Kotyarko_O 1 Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #263045 Posted April 17, 2015 (edited) Никак. Можно сделать аналог, но проверять нужно будет не по имени компонента, а по его индексу в компонентЛисте. Или сразу обращаться к листу. как это сделать? и еще как сделать тип установки для нового листа? Edited April 17, 2015 by Dark_Knight_MiX Quote Share this post Link to post Short link Share on other sites
Kotyarko_O 1,906 #263050 Posted April 17, 2015 (edited) как это сделать? Так: Function IsComponentChecked(Idx: Integer): Boolean; begin Result := твой_компонент_лист.Checked[Idx]; end; Применять на подобии IsComponentSelected, но с индексом компонента в кастомном компонентЛисте. Не забывай, что счёт начинается с 0, но для удобства и это можно подкорректировать; надеюсь, сам поймёшь как. Edited April 17, 2015 by Kotyarko_O Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #263051 Posted April 17, 2015 Так: Function IsComponentChecked(Idx: Integer): Boolean; begin Result := твой_компонент_лист.Checked[Idx]; end; Применять на подобии IsComponentSelected, но с индексом компонента в кастомном компонентЛисте. тоесть вот так ? function IsComponent(CompIndex: Integer): Boolean; var i: Integer; begin Result := False; for i := 0 to ComponentsList1.ItemCount - 1 do begin if CompIndex <= (ComponentsList1.ItemCount - 1) then Result := ComponentsList1.Checked[CompIndex]; end; end; If (IsComponent('1')) Quote Share this post Link to post Short link Share on other sites
Kotyarko_O 1,906 #263052 Posted April 17, 2015 как сделать тип установки для нового листа? Он будет работать менее удобно, чем в стандартном компонентЛисте. Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #263053 Posted April 17, 2015 Он будет работать менее удобно, чем в стандартном компонентЛисте. так как к новому прицепить? Quote Share this post Link to post Short link Share on other sites
Kotyarko_O 1,906 #263054 Posted April 17, 2015 If (IsComponent('1')) Учи типы данных. Integer кавычками не выделяется. If IsComponent(1) Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #263055 Posted April 17, 2015 Не забывай, что счёт начинается с 0, но для удобства и это можно подкорректировать; надеюсь, сам поймёшь как. Учи типы данных. Integer кавычками не выделяется. If IsComponent(1) ясно Как сделать тип установки для нового листа и что бы при последующий переустановки его выбор сохранялся? Quote Share this post Link to post Short link Share on other sites
Kotyarko_O 1,906 #263062 Posted April 17, 2015 Как сделать тип установки для нового листа и что бы при последующий переустановки его выбор сохранялся? Давно бы уже загуглил TNewComboBox.Для сохранения ранее установленных параметров нужно при установке сохранять выбранные компоненты, а затем считывать их. Тут есть пример. Quote Share this post Link to post Short link Share on other sites
AtotIK 580 #263064 Posted April 17, 2015 Я использую второй вариант, но это только "верхушка" айсберга, там же ещё присвоить всем компонентам идентификаторы, записать их в файл и потом считать при следующей установке так, что бы всё правильно отметилось. В общем мозговой штурм ещё тот получается. Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #263065 Posted April 17, 2015 Давно бы уже загуглил TNewComboBox. Для сохранения ранее установленных параметров нужно при установке сохранять выбранные компоненты, а затем считывать их. Тут есть пример. и как прицепить, что то не допер [Setup] AppName=Моя программа AppVersion=1.5 DefaultDirName={pf}\Моя программа DirExistsWarning=no AppendDefaultDirName=no [CustomMessages] CompName1=Компонент 1 CompName2=Компонент 2 CompSubtitlesLng=Язык субтитров CompVoiceLng=Язык озвучки CompRussian=Русский CompEnglish=Английский [Code] var ComboBox: TNewComboBox; Page: TWizardPage; var ComponentsList1: TNewCheckListBox; procedure CreateWizardPages; begin begin Page := CreateCustomPage(wpWelcome, '', ''); ComboBox := TNewComboBox.Create(Page); ComboBox.Width := Page.SurfaceWidth; ComboBox.Parent := Page.Surface; ComboBox.Style := csDropDownList; ComboBox.Items.Add('TComboBox 1'); ComboBox.Items.Add('TComboBox 2'); ComboBox.Items.Add('TComboBox 3'); ComboBox.Items.Add('TComboBox 4'); ComboBox.Items.Add('TComboBox 5'); ComboBox.Items.Add('TComboBox 6'); ComboBox.Items.Add('TComboBox 7'); ComboBox.ItemIndex := 0; end; //========================================================================\\ ComponentsList1 := TNewCheckListBox.Create(WizardForm); with ComponentsList1 do begin Parent := Page.Surface; SetBounds(ScaleX(0), ScaleY(61), ScaleX(417), ScaleY(169)); AddCheckBox(CustomMessage('CompSubtitlesLng'), '', 0, True, True, False, True, nil); //0 AddRadioButton(CustomMessage('CompRussian'), '', 1, True, True, nil); //1 AddRadioButton(CustomMessage('CompEnglish'), '', 1, True, True, nil); //2 AddCheckBox(CustomMessage('CompVoiceLng'), '', 0, True, True, False, True, nil); //3 AddRadioButton(CustomMessage('CompRussian'), '', 1, True, True, nil); //4 AddRadioButton(CustomMessage('CompEnglish'), '', 1, True, True, nil); //5 end; end; function IsComponentsForm1(CompIndex: Integer): Boolean; var i: Integer; begin Result := False; for i := 0 to ComponentsList1.ItemCount - 1 do begin if CompIndex <= (ComponentsList1.ItemCount - 1) then Result := ComponentsList1.Checked[CompIndex]; end; end; procedure InitializeWizard(); begin CreateWizardPages; end; Я использую второй вариант, но это только "верхушка" айсберга, там же ещё присвоить всем компонентам идентификаторы, записать их в файл и потом считать при следующей установке так, что бы всё правильно отметилось. В общем мозговой штурм ещё тот получается. этот [setup] AppName=MyApp AppVerName=MyApp DefaultDirName={pf}\MyApp [components] name: comp1; description: comp1; name: comp1\1; description: comp1_1; name: comp2; description: comp2; name: comp1\1; description: comp2_1; name: comp3; description: comp3; name: comp3\1; description: comp3_1; name: comp4; description: comp4; [code] var ConfigList: TStringList; function CheckConfigName(CompName: String): Longint; var i: Integer; begin Result:= -1; if (ConfigList.Count <= 0) then Exit; if ConfigList.Find(CompName, i) then Result:= i; end; procedure InitializeWizard(); begin ConfigList:= TStringList.Create(); ConfigList.LoadFromFile('E:\Setup.ini'); if (CheckConfigName('St1\Comp1') >= 0) then WizardForm.ComponentsList.CheckItem(0, coCheckWithChildren); if (CheckConfigName('St1\Comp3\3') >= 0) then WizardForm.ComponentsList.CheckItem(5, coCheckWithChildren); end; procedure DeinitializeSetup(); begin ConfigList.Free(); end; Quote Share this post Link to post Short link Share on other sites