Guest User

Untitled

a guest
Apr 24th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. [Setup]
  2. AppId=ComponentExample
  3. AppName=ComponentExample
  4.  
  5. AppVersion=1.0.0
  6.  
  7. VersionInfoVersion=1.0.0
  8. VersionInfoDescription={#SetupSetting("AppName")} Installer
  9.  
  10. OutputBaseFilename={#SetupSetting("AppName")}_{#SetupSetting("AppVersion")}
  11. DefaultDirName={sd}\{#SetupSetting("AppName")}
  12. DefaultGroupName={#SetupSetting("AppName")}
  13. OutputDir=.
  14.  
  15. ; ランゲージ選択あり
  16. ShowLanguageDialog=yes
  17.  
  18. [Languages]
  19. Name: "en"; MessagesFile: "compiler:Default.isl";
  20. Name: "ja"; MessagesFile: "compiler:Languages/Japanese.isl";
  21.  
  22. [Types]
  23. Name: "custom"; Description: "{cm:CustomInstallation}"; Flags: iscustom
  24. Name: "full"; Description: "{cm:FullInstallation}"
  25.  
  26. [Components]
  27. Name: "Program"; Description: "Program Files"; Types: full custom; Flags: fixed
  28.  
  29. ; "Flags: disablenouninstallwarning;" をつけている場合は、2度目以降のインストール時にチェックを外しても
  30. ; 「すでにインストールされていますが、チェックをはずしてもアンインストールはされません」みたいな警告は出なくなる。
  31. Name: "Samples"; Description: "Sample Files"; Types: full; Flags: disablenouninstallwarning;
  32. Name: "Samples\Example1"; Description: "Example1"; Types: full; Flags: disablenouninstallwarning;
  33. Name: "Samples\Example2"; Description: "Example2"; Types: full; Flags: disablenouninstallwarning;
  34.  
  35. [Files]
  36. Source: "lib/*"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs;
  37. Source: "files/pictures/dandelion-3281574_1920.jpg"; DestDir: "{app}\data"; Flags: recursesubdirs createallsubdirs; Components: "Samples\Example1";
  38. Source: "files/pictures/flower-3219718_1920.jpg"; DestDir: "{app}\data"; Flags: recursesubdirs createallsubdirs; Components: "Samples\Example2";
  39.  
  40. [CustomMessages]
  41. FullInstallation=Full Installation
  42. ja.FullInstallation=フルインストール
  43.  
  44. CustomInstallation=Custom Installtion
  45. ja.CustomInstallation=カスタムインストール
  46.  
  47. [Code]
  48. var
  49. { コンポーネント選択ページを表示したことを示す }
  50. initizliedComponentPage: Boolean;
  51.  
  52. { コンポーネント選択ページのコンポーネントリストを走査して、
  53. システムのインストール済みのコンポーネントのチェックを外しておく }
  54. procedure SelectDefaultComponents();
  55. var
  56. idx: integer;
  57. compname: String;
  58. begin
  59. // コンポーネントの選択ドロップダウンは非表示とする
  60. // (状況に応じて自動設定するため)
  61. WizardForm.TypesCombo.Visible := False;
  62.  
  63. // コンポーネントリストの表示名を走査して、対象のコンポーネントを見つける。
  64. for idx := 0 to WizardForm.ComponentsList.Items.Count - 1 do
  65. begin
  66. compname := WizardForm.ComponentsList.ItemCaption[idx];
  67. Log('Component Name: ' + compname);
  68. case compname of
  69. 'Example1': begin
  70. WizardForm.ComponentsList.Checked[idx] := True;
  71. end;
  72.  
  73. 'Example2': begin
  74. WizardForm.ComponentsList.Checked[idx] := False;
  75. end;
  76. end;
  77. end;
  78. end;
  79.  
  80. { ページの切り替えごとに呼び出される }
  81. procedure CurPageChanged(CurPageID: Integer);
  82. begin
  83. case CurPageID of
  84. wpSelectComponents: begin
  85. if not initizliedComponentPage then begin
  86. SelectDefaultComponents();
  87. initizliedComponentPage := True;
  88. end;
  89. end;
  90. end;
  91. end;
Add Comment
Please, Sign In to add comment