home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 26 / CD_ASCQ_26_1295.iso / vrac / ysfl12.zip / FILES1.ZIP / unit1.pas < prev    next >
Pascal/Delphi Source File  |  1995-08-17  |  7KB  |  229 lines

  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls, Buttons, ExtCtrls, Install, Idcf, Idwg, Idfg,
  8.   Idgi, Ysfltool, Idcs;
  9.  
  10. const
  11.   YSFLComponentCount = 13;
  12.  
  13. type
  14.   TForm1 = class(TForm)
  15.     Panel1: TPanel;
  16.     Label1: TLabel;
  17.     Label2: TLabel;
  18.     Label3: TLabel;
  19.     Image1: TImage;
  20.     BitBtn1: TBitBtn;
  21.     BitBtn2: TBitBtn;
  22.     Label4: TLabel;
  23.     Bevel1: TBevel;
  24.     Install1: TInstall;
  25.     fgComponents: TInstallFileGroup;
  26.     fgExamples: TInstallFileGroup;
  27.     ProgramItem1: TProgramItem;
  28.     fgInstallationBuilder: TInstallFileGroup;
  29.     fgKeywordFiles: TInstallFileGroup;
  30.     InstallFileGroupsDlg1: TInstallFileGroupsDlg;
  31.     SelectWindowGroupDlg1: TSelectWindowGroupDlg;
  32.     CopyFileDlg1: TCopyFileDlg;
  33.     fgInstallationBuilderinsbld_exe: TInstallFile;
  34.     fgInstallationBuilderuzdll20_dll: TInstallFile;
  35.     fgInstallationBuilderzdll20a_dll: TInstallFile;
  36.     fgInstallationBuilderzdll20b_dll: TInstallFile;
  37.     fgInstallationBuilderbivbx11_dll: TInstallFile;
  38.     Panel2: TPanel;
  39.     Image2: TImage;
  40.     Image3: TImage;
  41.     Image4: TImage;
  42.     Image5: TImage;
  43.     Image6: TImage;
  44.     Image7: TImage;
  45.     Image8: TImage;
  46.     Image9: TImage;
  47.     Image10: TImage;
  48.     Image11: TImage;
  49.     Timer1: TTimer;
  50.     Image12: TImage;
  51.     Image13: TImage;
  52.     InstallINIFile1: TInstallINIFile;
  53.     GoodInstallationDlg1: TGoodInstallationDlg;
  54.     Image14: TImage;
  55.     fgInstallationBuilderysflpsu_exe: TInstallFile;
  56.     Label5: TLabel;
  57.     fgComponentsidcf_dcu: TInstallFile;
  58.     fgComponentsidcfmf_dcu: TInstallFile;
  59.     fgComponentsidfg_dcu: TInstallFile;
  60.     fgComponentsidfgmf_dcu: TInstallFile;
  61.     fgComponentsidgi_dcu: TInstallFile;
  62.     fgComponentsidgimf_dcu: TInstallFile;
  63.     fgComponentsidrs_dcu: TInstallFile;
  64.     fgComponentsidrsmf_dcu: TInstallFile;
  65.     fgComponentsidwg_dcu: TInstallFile;
  66.     fgComponentsidwgmf_dcu: TInstallFile;
  67.     fgComponentsinstall_dcu: TInstallFile;
  68.     fgComponentsinstcmed_dcu: TInstallFile;
  69.     fgComponentsinstfile_dcu: TInstallFile;
  70.     fgComponentsinststr_dcu: TInstallFile;
  71.     fgComponentsinstuzip_dcu: TInstallFile;
  72.     fgComponentsregister_dcu: TInstallFile;
  73.     fgComponentsrpt2_dcu: TInstallFile;
  74.     fgComponentsrptman_dcu: TInstallFile;
  75.     fgComponentsyouseful_pas: TInstallFile;
  76.     fgComponentsidcfmf_dfm: TInstallFile;
  77.     fgComponentsidfg_dfm: TInstallFile;
  78.     fgComponentsidfgmf_dfm: TInstallFile;
  79.     fgComponentsidgimf_dfm: TInstallFile;
  80.     fgComponentsidrsmf_dfm: TInstallFile;
  81.     fgComponentsidwgmf_dfm: TInstallFile;
  82.     fgComponentsinstcmed_dfm: TInstallFile;
  83.     fgComponentsinstfile_dfm: TInstallFile;
  84.     fgComponentsregister_dfm: TInstallFile;
  85.     Label6: TLabel;
  86.     fgExamplessetup_dpr: TInstallFile;
  87.     fgExamplessetup_opt: TInstallFile;
  88.     fgExamplessetup_res: TInstallFile;
  89.     fgExamplesunit1_dfm: TInstallFile;
  90.     fgExamplesunit1_pas: TInstallFile;
  91.     fgExamplesunit3_dfm: TInstallFile;
  92.     fgExamplesunit3_pas: TInstallFile;
  93.     fgExamplesunit2_dfm: TInstallFile;
  94.     fgExamplesunit2_pas: TInstallFile;
  95.     fgExamplesmagic_dcu: TInstallFile;
  96.     fgExamplesmagic_dll: TInstallFile;
  97.     fgExamplesmagic_imp: TInstallFile;
  98.     fgExamplesmagic_pas: TInstallFile;
  99.     fgExamplesttt_dcr: TInstallFile;
  100.     fgExamplesttt_dcu: TInstallFile;
  101.     fgExamplesttt_pas: TInstallFile;
  102.     fgComponentsyouseful_dcr: TInstallFile;
  103.     fgInstallationBuilderyouseful_hlp: TInstallFile;
  104.     fgKeywordFilesyouseful_kwf: TInstallFile;
  105.     fgComponentsui_dcu: TInstallFile;
  106.     fgComponentsuidf_dcu: TInstallFile;
  107.     fgComponentsuidfmf_dcu: TInstallFile;
  108.     fgComponentsysfltool_dcu: TInstallFile;
  109.     fgComponentsuidfmf_dfm: TInstallFile;
  110.     fgComponentsuninst_exe: TInstallFile;
  111.     fgExamplesuninst_dpr: TInstallFile;
  112.     fgExamplesuninst_opt: TInstallFile;
  113.     fgExamplesuninst_res: TInstallFile;
  114.     fgExamplesuninstmf_dfm: TInstallFile;
  115.     fgExamplesuninstmf_pas: TInstallFile;
  116.     ProgramItem2: TProgramItem;
  117.     ComponentConflictDlg1: TComponentConflictDlg;
  118.     fgComponentsidcs_dcu: TInstallFile;
  119.     fgComponentsidcsmf_dcu: TInstallFile;
  120.     fgComponentsidcsmf_dfm: TInstallFile;
  121.     procedure BitBtn2Click(Sender: TObject);
  122.     procedure BitBtn1Click(Sender: TObject);
  123.     procedure Install1StartInstallingPMItems(Sender: TObject);
  124.     procedure Install1CopyingFileEvent(Sender: TObject;
  125.       InstallFile: TInstallFile);
  126.     procedure Install1DoneCopyingFiles(Sender: TObject);
  127.     procedure Install1ChooseFileGroups(Sender: TObject);
  128.     procedure FormShow(Sender: TObject);
  129.     procedure Timer1Timer(Sender: TObject);
  130.     procedure Install1GoodInstallation(Sender: TObject);
  131.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  132.   private
  133.     { Private declarations }
  134.     CurrentImage: Integer;
  135.     SystemDir: String;
  136.     szSystemDir: array[0..255] of char;
  137.   public
  138.     { Public declarations }
  139.     YSFLComponentBM: array[0..YSFLComponentCount-1] of TImage;
  140.   end;
  141.  
  142. var
  143.   Form1: TForm1;
  144.  
  145. implementation
  146.  
  147. {$R *.DFM}
  148.  
  149. uses
  150.   Unit2,FMXUtils;
  151.  
  152. procedure TForm1.BitBtn2Click(Sender: TObject);
  153. begin
  154.   Close;
  155. end;
  156.  
  157. procedure TForm1.BitBtn1Click(Sender: TObject);
  158. begin
  159.   BitBtn1.Enabled := False;
  160.   BitBtn2.Enabled := False;
  161.   Install1.Install;
  162.   Close;
  163. end;
  164.  
  165. procedure TForm1.Install1StartInstallingPMItems(Sender: TObject);
  166. begin
  167.   SelectWindowGroupDlg1.Execute;
  168. end;
  169.  
  170. procedure TForm1.Install1CopyingFileEvent(Sender: TObject;
  171.   InstallFile: TInstallFile);
  172. begin
  173.   CopyFileDlg1.Update;
  174. end;
  175.  
  176. procedure TForm1.Install1DoneCopyingFiles(Sender: TObject);
  177. begin
  178.   CopyFileDlg1.Hide;
  179.   ComponentConflictDlg1.Execute;
  180. end;
  181.  
  182. procedure TForm1.Install1ChooseFileGroups(Sender: TObject);
  183. begin
  184.   InstallFileGroupsDlg1.Execute;
  185.   MessageDlg('You can make your installations really wierd',mtInformation,[mbOk],0);
  186.   CopyFile(Install1.SourceDir+'magic.dll',SystemDir);
  187.   Form2.Show;
  188. end;
  189.  
  190. procedure TForm1.FormShow(Sender: TObject);
  191. begin
  192.   GetSystemDirectory(szSystemDir,255);
  193.   SystemDir := StrPas(szSystemDir);
  194.   YSFLComponentBM[0] := Image2;
  195.   YSFLComponentBM[1] := Image3;
  196.   YSFLComponentBM[2] := Image4;
  197.   YSFLComponentBM[3] := Image5;
  198.   YSFLComponentBM[4] := Image6;
  199.   YSFLComponentBM[5] := Image7;
  200.   YSFLComponentBM[6] := Image8;
  201.   YSFLComponentBM[7] := Image9;
  202.   YSFLComponentBM[8] := Image10;
  203.   YSFLComponentBM[9] := Image11;
  204.   YSFLComponentBM[10] := Image12;
  205.   YSFLComponentBM[11] := Image13;
  206.   YSFLComponentBM[12] := Image14;
  207.   CurrentImage := 0;
  208.   YSFLComponentBM[CurrentImage].BringToFront;
  209. end;
  210.  
  211. procedure TForm1.Timer1Timer(Sender: TObject);
  212. begin
  213.   CurrentImage := (CurrentImage+1) mod YSFLComponentCount;
  214.   YSFLComponentBM[CurrentImage].BringToFront;
  215. end;
  216.  
  217. procedure TForm1.Install1GoodInstallation(Sender: TObject);
  218. begin
  219.   GoodInstallationDlg1.Execute;
  220. end;
  221.  
  222. procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
  223. begin
  224.   Form2.Close;
  225.   DeleteFile(SystemDir+'\magic.dll');
  226. end;
  227.  
  228. end.
  229.