Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Setup]
- AppId=ComponentExample
- AppName=ComponentExample
- AppVersion=1.0.0
- VersionInfoVersion=1.0.0
- VersionInfoDescription={#SetupSetting("AppName")} Installer
- OutputBaseFilename={#SetupSetting("AppName")}_{#SetupSetting("AppVersion")}
- DefaultDirName={sd}\{#SetupSetting("AppName")}
- DefaultGroupName={#SetupSetting("AppName")}
- OutputDir=.
- ; ランゲージ選択あり
- ShowLanguageDialog=yes
- [Languages]
- Name: "en"; MessagesFile: "compiler:Default.isl";
- Name: "ja"; MessagesFile: "compiler:Languages/Japanese.isl";
- [Types]
- Name: "custom"; Description: "{cm:CustomInstallation}"; Flags: iscustom
- Name: "full"; Description: "{cm:FullInstallation}"
- [Components]
- Name: "Program"; Description: "Program Files"; Types: full custom; Flags: fixed
- ; "Flags: disablenouninstallwarning;" をつけている場合は、2度目以降のインストール時にチェックを外しても
- ; 「すでにインストールされていますが、チェックをはずしてもアンインストールはされません」みたいな警告は出なくなる。
- Name: "Samples"; Description: "Sample Files"; Types: full; Flags: disablenouninstallwarning;
- Name: "Samples\Example1"; Description: "Example1"; Types: full; Flags: disablenouninstallwarning;
- Name: "Samples\Example2"; Description: "Example2"; Types: full; Flags: disablenouninstallwarning;
- [Files]
- Source: "lib/*"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs;
- Source: "files/pictures/dandelion-3281574_1920.jpg"; DestDir: "{app}\data"; Flags: recursesubdirs createallsubdirs; Components: "Samples\Example1";
- Source: "files/pictures/flower-3219718_1920.jpg"; DestDir: "{app}\data"; Flags: recursesubdirs createallsubdirs; Components: "Samples\Example2";
- [CustomMessages]
- FullInstallation=Full Installation
- ja.FullInstallation=フルインストール
- CustomInstallation=Custom Installtion
- ja.CustomInstallation=カスタムインストール
- [Code]
- var
- { コンポーネント選択ページを表示したことを示す }
- initizliedComponentPage: Boolean;
- { コンポーネント選択ページのコンポーネントリストを走査して、
- システムのインストール済みのコンポーネントのチェックを外しておく }
- procedure SelectDefaultComponents();
- var
- idx: integer;
- compname: String;
- begin
- // コンポーネントの選択ドロップダウンは非表示とする
- // (状況に応じて自動設定するため)
- WizardForm.TypesCombo.Visible := False;
- // コンポーネントリストの表示名を走査して、対象のコンポーネントを見つける。
- for idx := 0 to WizardForm.ComponentsList.Items.Count - 1 do
- begin
- compname := WizardForm.ComponentsList.ItemCaption[idx];
- Log('Component Name: ' + compname);
- case compname of
- 'Example1': begin
- WizardForm.ComponentsList.Checked[idx] := True;
- end;
- 'Example2': begin
- WizardForm.ComponentsList.Checked[idx] := False;
- end;
- end;
- end;
- end;
- { ページの切り替えごとに呼び出される }
- procedure CurPageChanged(CurPageID: Integer);
- begin
- case CurPageID of
- wpSelectComponents: begin
- if not initizliedComponentPage then begin
- SelectDefaultComponents();
- initizliedComponentPage := True;
- end;
- end;
- end;
- end;
Add Comment
Please, Sign In to add comment