Advertisement
mehenuf06

WindowsPhone.iss

Nov 28th, 2019
628
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 154.92 KB | None | 0 0
  1. //Windows Phone Installer v3.1 with Windows Phone Technology v4.2 based on Windows Phone 8
  2. //Script created by Razor12911
  3. //Inno Setup Enhanced Edition Unicode is Required for Script Compilation
  4. //Save script before compiling to update the changes since this is used as ini
  5. //For non-commercial use
  6.  
  7. // Edited
  8. // This Script is totally by RAZOR12911
  9. // But I made some small Changes
  10. // --> Fasten Up Startup of Setup Wizard
  11. // --> Removed Lockscreen
  12. // --> Change some Label according to COREPACK Repacks
  13. // --> Added Red Colour (21)
  14.  
  15. [Installer]
  16. Name=Far Cry 3 by WiNT3R Repack
  17. Publisher=WiNT3R
  18. Version=1.0.0
  19. Size=5088
  20. ;Files=D:\Far Cry 3 Complete Collection\Far Cry 3
  21. Watermark=Repacked by WiNT3R
  22. Autorun=0
  23. ;Enter Your Name
  24. Repacker=WiNT3R
  25.  
  26.  
  27. [Theme]
  28. ;Interface either be in dark or light
  29. ;Colors are Originally from OS Windows Phone 8 (01-21)
  30. ;21th is pure Red
  31. Image=1
  32. Dark=1
  33. Color=21
  34.  
  35. [Execs]
  36. ;Tile Caption|Exec Directory|Exec File|Shortcut Name/Action Name
  37. AppExe1=Far Cry 3 All DLC||farcry3.exe|Far Cry 3
  38. ;AppExe2=Battlefield 4 (64-Bit)||bf4.exe|Play Battlefield(TM) 4 (64-Bit)
  39.  
  40. [Redists]
  41. ;Redist Caption|Exec Directory + File|Arguments
  42. ;Redist1=Visual C 32|2010\vcredist_x86.exe|/silent
  43. ;Redist2=Visual C 64|2010\vcredist_x64.exe|/silent
  44.  
  45. [Archives]
  46. ;Precomp 0.38
  47. ;Archive Types 7Zip, Freearc and WinRAR
  48. Precomp=0.38
  49. Archive1Type=Freearc
  50. Archive1Source={src}\data1.bin
  51. Archive1Output={app}
  52. Archive1Disk=1
  53. Archive1Password=Yourpassword
  54.  
  55. [UninstallDelete]
  56. Type: filesandordirs; Name: {app}
  57.  
  58. [Registry]
  59.  
  60. ////////////////////////////////////////////////////////////////////////////////////////////
  61. /////////////////////////////////ADVANCED USERS CAN PROCEED/////////////////////////////////
  62. ////////////////////////////////////////////////////////////////////////////////////////////
  63. #define i 0
  64. #define AppName ReadIni(SourcePath + "\WindowsPhone.iss", "Installer", "Name", "")
  65. #define AppPublisher ReadIni(SourcePath + "\WindowsPhone.iss", "Installer", "Publisher", "")
  66. #define AppVersion ReadIni(SourcePath + "\WindowsPhone.iss", "Installer", "Version", "1.0.0")
  67. #if ReadIni(SourcePath + "\WindowsPhone.iss", "Installer", "Files", "") != ""
  68. #define AppFiles ReadIni(SourcePath + "\WindowsPhone.iss", "Installer", "Files", "")
  69. #endif
  70. #define AppSize Int(ReadIni(SourcePath + "\WindowsPhone.iss", "Installer", "Size", "0"))
  71.  
  72. #if ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe1", "") != ""
  73. #define AppExe1 ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe1", "")
  74. #if ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe2", "") != ""
  75. #define AppExe2 ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe2", "")
  76. #if ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe3", "") != ""
  77. #define AppExe3 ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe3", "")
  78. #if ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe4", "") != ""
  79. #define AppExe4 ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe4", "")
  80. #if ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe5", "") != ""
  81. #define AppExe5 ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe5", "")
  82. #if ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe6", "") != ""
  83. #define AppExe6 ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe6", "")
  84. #endif
  85. #endif
  86. #endif
  87. #endif
  88. #endif
  89. #endif
  90.  
  91. #if ReadIni(SourcePath + "\WindowsPhone.iss", "Redists", "Redist1", "") != ""
  92. #define Redist1 ReadIni(SourcePath + "\WindowsPhone.iss", "Redists", "Redist1", "")
  93. #if ReadIni(SourcePath + "\WindowsPhone.iss", "Redists", "Redist2", "") != ""
  94. #define Redist2 ReadIni(SourcePath + "\WindowsPhone.iss", "Redists", "Redist2", "")
  95. #if ReadIni(SourcePath + "\WindowsPhone.iss", "Redists", "Redist3", "") != ""
  96. #define Redist3 ReadIni(SourcePath + "\WindowsPhone.iss", "Redists", "Redist3", "")
  97. #if ReadIni(SourcePath + "\WindowsPhone.iss", "Redists", "Redist4", "") != ""
  98. #define Redist4 ReadIni(SourcePath + "\WindowsPhone.iss", "Redists", "Redist4", "")
  99. #if ReadIni(SourcePath + "\WindowsPhone.iss", "Redists", "Redist5", "") != ""
  100. #define Redist5 ReadIni(SourcePath + "\WindowsPhone.iss", "Redists", "Redist5", "")
  101. #endif
  102. #endif
  103. #endif
  104. #endif
  105. #endif
  106.  
  107. #if ReadIni(SourcePath + "\WindowsPhone.iss", "Installer", "Autorun", "0") == "1"
  108. #define Autorun
  109. #endif
  110. #if ReadIni(SourcePath + "\WindowsPhone.iss", "Theme", "Dark", "1") == "1"
  111. #define Dark
  112. #endif
  113. #if ReadIni(SourcePath + "\WindowsPhone.iss", "Theme", "Image", "0") == "1"
  114. #define Image
  115. #endif
  116. #define CurColor ReadIni(SourcePath + "\WindowsPhone.iss", "Theme", "Color", "05")
  117. #define Repacker ReadIni(SourcePath + "\WindowsPhone.iss", "Installer", "Repacker", "")
  118. #define Watermark ReadIni(SourcePath + "\WindowsPhone.iss", "Installer", "Watermark", "Script: Razor12911|Windows Phone Installer: v3.1|Windows Phone Technology: v4.2")
  119.  
  120. [Setup]
  121. AppName={#AppName}
  122. AppPublisher={#AppPublisher}
  123. AppVersion={#AppVersion}
  124. DefaultDirName={pf}\{#AppName}
  125. DefaultGroupName={#AppName}
  126. SetupIconFile=Graphics\Icon.ico
  127. OutputBaseFilename=Start
  128. OutputDir=Output
  129. UninstallFilesDir={app}\Uninstall
  130. DiskSpanning=no
  131. EnableDirDoesntExistWarning=no
  132. InternalCompressLevel=max
  133.  
  134. [Files]
  135. #if ReadIni(SourcePath + "\WindowsPhone.iss", "Archives", "Archive1Type", "") != ""
  136. ; Cls Files + Ini
  137. Source: Resources\arc.ini; DestDir: {tmp}; Flags: dontcopy;
  138. Source: Resources\english.ini; DestDir: {tmp}; Flags: dontcopy;
  139. Source: Resources\facompress.dll; DestDir: {tmp}; Flags: dontcopy;
  140. Source: Resources\facompress_mt.dll; DestDir: {tmp}; Flags: dontcopy;
  141. Source: Resources\unarc.dll; DestDir: {tmp}; Flags: dontcopy;
  142. Source: Resources\unrar.dll; DestDir: {tmp}; Flags: dontcopy;
  143. Source: Resources\zlib1.dll; DestDir: {tmp}; Flags: dontcopy;
  144. Source: Resources\CLS-MSC.dll; DestDir: {tmp}; Flags: dontcopy;
  145. Source: Resources\CLS-precomp.dll; DestDir: {tmp}; Flags: dontcopy;
  146. Source: Resources\CLS-srep.dll; DestDir: {tmp}; Flags: dontcopy;
  147. ; Srep + Precomp Support
  148. Source: Resources\srep.exe; DestDir: {tmp}; Flags: dontcopy;
  149. Source: Resources\srep64.exe; DestDir: {tmp}; Flags: dontcopy;
  150. Source: Resources\packjpg.exe; DestDir: {tmp}; Flags: dontcopy;
  151. Source: Resources\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy;
  152. Source: Resources\packjpg_dll1.dll; DestDir: {tmp}; Flags: dontcopy;
  153. Source: Resources\precomp.exe; DestDir: {tmp}; Flags: dontcopy;
  154. ; Core Unpackers
  155. Source: Resources\nz64.exe; DestDir: {tmp}; Flags: dontcopy;
  156. Source: Resources\zstd.exe; DestDir: {tmp}; Flags: dontcopy;
  157. Source: Resources\dec.exe; DestDir: {tmp}; Flags: dontcopy;
  158. Source: Resources\lzt.exe; DestDir: {tmp}; Flags: dontcopy;
  159. ; Reflate Support
  160. ;Source: Resources\7z.dll; DestDir: {tmp}; Flags: dontcopy;
  161. ;Source: Resources\reflate.exe; DestDir: {tmp}; Flags: dontcopy;
  162. ;Source: Resources\raw2hif.exe; DestDir: {tmp}; Flags: dontcopy;
  163. ;Source: Resources\rawrest.exe; DestDir: {tmp}; Flags: dontcopy;
  164. ;Source: Resources\rawdet.exe; DestDir: {tmp}; Flags: dontcopy;
  165.  
  166.  
  167.  
  168. #endif
  169. Source: Resources\ISDone.dll; DestDir: {tmp}; Flags: dontcopy;
  170. Source: Resources\botva2.dll; DestDir: {tmp}; Flags: dontcopy;
  171. Source: Resources\botva2.dll; DestDir: {app}\Uninstall; Attribs: hidden system;
  172. Source: Resources\Exit.png; DestDir: {tmp}; Flags: dontcopy;
  173. Source: Resources\Install.png; DestDir: {tmp}; Flags: dontcopy;
  174. Source: Resources\Uninstall.png; DestDir: {tmp}; Flags: dontcopy;
  175. #ifdef Image
  176. #define i 0
  177. #ifexist "Graphics\Images\Lockscreen.jpg"
  178. Source: Graphics\Images\Lockscreen.jpg; DestDir: {tmp}; Flags: dontcopy;
  179. #endif
  180. #ifdef Autorun
  181. #sub AddFile1
  182. Source: Graphics\Images\Autorun{#i}.jpg; DestDir: {tmp}; Flags: dontcopy;
  183. #endsub
  184. #for {i = 1; FileExists(StringChange("Graphics\Images\AutorunFileName.jpg", "FileName", Str(i))) != 0; i++} AddFile1
  185. #endif
  186. #sub AddFile2
  187. Source: Graphics\Images\Setup{#i}.jpg; DestDir: {tmp}; Flags: dontcopy;
  188. #endsub
  189. #for {i = 1; FileExists(StringChange("Graphics\Images\SetupFileName.jpg", "FileName", Str(i))) != 0; i++} AddFile2
  190. Source: Resources\Dark.png; DestDir: {tmp}; Flags: dontcopy;
  191. Source: Resources\Light.png; DestDir: {tmp}; Flags: dontcopy;
  192. Source: Resources\Dark.png; DestDir: {app}\Uninstall; Attribs: hidden system;
  193. Source: Resources\Light.png; DestDir: {app}\Uninstall; Attribs: hidden system;
  194. Source: Graphics\Images\Setup1.jpg; DestDir: {app}\Uninstall; Attribs: hidden system;
  195. Source: Graphics\Images\Setup2.jpg; DestDir: {app}\Uninstall; Attribs: hidden system;
  196. #endif
  197. #ifdef AppFiles
  198. Source: {#AppFiles}\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: unins*;
  199. #endif
  200. #ifdef Redist1
  201. #dim R1[64]
  202. #for {R1[0] = 59; Pos('|', Redist1); R1[0]++} R1[R1[0]] = Copy(Redist1,,Pos('|', Redist1)-1), Redist1 = Copy(Redist1,Pos('|', Redist1)+1)
  203. #expr R1[R1[0]] = Redist1
  204. #ifdef Redist2
  205. #dim R2[64]
  206. #for {R2[0] = 59; Pos('|', Redist2); R2[0]++} R2[R2[0]] = Copy(Redist2,,Pos('|', Redist2)-1), Redist2 = Copy(Redist2,Pos('|', Redist2)+1)
  207. #expr R2[R2[0]] = Redist2
  208. #ifdef Redist3
  209. #dim R3[64]
  210. #for {R3[0] = 59; Pos('|', Redist3); R3[0]++} R3[R3[0]] = Copy(Redist3,,Pos('|', Redist3)-1), Redist3 = Copy(Redist3,Pos('|', Redist3)+1)
  211. #expr R3[R3[0]] = Redist3
  212. #ifdef Redist4
  213. #dim R4[64]
  214. #for {R4[0] = 59; Pos('|', Redist4); R4[0]++} R4[R4[0]] = Copy(Redist4,,Pos('|', Redist4)-1), Redist4 = Copy(Redist4,Pos('|', Redist4)+1)
  215. #expr R4[R4[0]] = Redist4
  216. #ifdef Redist5
  217. #dim R5[64]
  218. #for {R5[0] = 59; Pos('|', Redist5); R5[0]++} R5[R5[0]] = Copy(Redist5,,Pos('|', Redist5)-1), Redist5 = Copy(Redist5,Pos('|', Redist5)+1)
  219. #expr R5[R5[0]] = Redist5
  220. #endif
  221. #endif
  222. #endif
  223. #endif
  224. #endif
  225.  
  226. #ifdef AppExe1
  227. #dim E1[64]
  228. #for {E1[0] = 59; Pos('|', AppExe1); E1[0]++} E1[E1[0]] = Copy(AppExe1,,Pos('|', AppExe1)-1), AppExe1 = Copy(AppExe1,Pos('|', AppExe1)+1)
  229. #expr E1[E1[0]] = AppExe1
  230. #ifdef AppExe2
  231. #dim E2[64]
  232. #for {E2[0] = 59; Pos('|', AppExe2); E2[0]++} E2[E2[0]] = Copy(AppExe2,,Pos('|', AppExe2)-1), AppExe2 = Copy(AppExe2,Pos('|', AppExe2)+1)
  233. #expr E2[E2[0]] = AppExe2
  234. #ifdef AppExe3
  235. #dim E3[64]
  236. #for {E3[0] = 59; Pos('|', AppExe3); E3[0]++} E3[E3[0]] = Copy(AppExe3,,Pos('|', AppExe3)-1), AppExe3 = Copy(AppExe3,Pos('|', AppExe3)+1)
  237. #expr E3[E3[0]] = AppExe3
  238. #ifdef AppExe4
  239. #dim E4[64]
  240. #for {E4[0] = 59; Pos('|', AppExe4); E4[0]++} E4[E4[0]] = Copy(AppExe4,,Pos('|', AppExe4)-1), AppExe4 = Copy(AppExe4,Pos('|', AppExe4)+1)
  241. #expr E4[E4[0]] = AppExe4
  242. #ifdef AppExe5
  243. #dim E5[64]
  244. #for {E5[0] = 59; Pos('|', AppExe5); E5[0]++} E5[E5[0]] = Copy(AppExe5,,Pos('|', AppExe5)-1), AppExe5 = Copy(AppExe5,Pos('|', AppExe5)+1)
  245. #expr E5[E5[0]] = AppExe5
  246. #ifdef AppExe6
  247. #dim E6[64]
  248. #for {E6[0] = 59; Pos('|', AppExe6); E6[0]++} E6[E6[0]] = Copy(AppExe6,,Pos('|', AppExe6)-1), AppExe6 = Copy(AppExe6,Pos('|', AppExe6)+1)
  249. #expr E6[E6[0]] = AppExe6
  250. #endif
  251. #endif
  252. #endif
  253. #endif
  254. #endif
  255. #endif
  256.  
  257. #ifdef Autorun
  258. #ifdef Image
  259. #ifdef AppExe1
  260. Source: Graphics\Tiles\Tile1_Background.jpg; DestDir: {tmp}; Flags: dontcopy;
  261. #sub AddExeIcon1
  262. Source: Graphics\Tiles\Tile1_Icon{#i}.png; DestDir: {tmp}; Flags: dontcopy;
  263. #endsub
  264. #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile1_IconFileName.png", "FileName", Str(i))) != 0; i++} AddExeIcon1
  265. #ifdef AppExe2
  266. Source: Graphics\Tiles\Tile2_Background.jpg; DestDir: {tmp}; Flags: dontcopy;
  267. #sub AddExeIcon2
  268. Source: Graphics\Tiles\Tile2_Icon{#i}.png; DestDir: {tmp}; Flags: dontcopy;
  269. #endsub
  270. #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile2_IconFileName.png", "FileName", Str(i))) != 0; i++} AddExeIcon2
  271. #ifdef AppExe3
  272. Source: Graphics\Tiles\Tile3_Background.jpg; DestDir: {tmp}; Flags: dontcopy;
  273. #sub AddExeIcon3
  274. Source: Graphics\Tiles\Tile3_Icon{#i}.png; DestDir: {tmp}; Flags: dontcopy;
  275. #endsub
  276. #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile3_IconFileName.png", "FileName", Str(i))) != 0; i++} AddExeIcon3
  277. #ifdef AppExe4
  278. Source: Graphics\Tiles\Tile4_Background.jpg; DestDir: {tmp}; Flags: dontcopy;
  279. #sub AddExeIcon4
  280. Source: Graphics\Tiles\Tile4_Icon{#i}.png; DestDir: {tmp}; Flags: dontcopy;
  281. #endsub
  282. #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile4_IconFileName.png", "FileName", Str(i))) != 0; i++} AddExeIcon4
  283. #ifdef AppExe5
  284. Source: Graphics\Tiles\Tile5_Background.jpg; DestDir: {tmp}; Flags: dontcopy;
  285. #sub AddExeIcon5
  286. Source: Graphics\Tiles\Tile5_Icon{#i}.png; DestDir: {tmp}; Flags: dontcopy;
  287. #endsub
  288. #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile5_IconFileName.png", "FileName", Str(i))) != 0; i++} AddExeIcon5
  289. #ifdef AppExe6
  290. Source: Graphics\Tiles\Tile6_Background.jpg; DestDir: {tmp}; Flags: dontcopy;
  291. #sub AddExeIcon6
  292. Source: Graphics\Tiles\Tile6_Icon{#i}.png; DestDir: {tmp}; Flags: dontcopy;
  293. #endsub
  294. #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile6_IconFileName.png", "FileName", Str(i))) != 0; i++} AddExeIcon6
  295. #endif
  296. #endif
  297. #endif
  298. #endif
  299. #endif
  300. #endif
  301. #endif
  302. #endif
  303.  
  304. [Icons]
  305. #ifdef AppExe1
  306. Name: {group}\{#E1[62]}; Filename: {app}\{#E1[60]}\{#E1[61]}; WorkingDir: {app}\{#E1[60]}; Comment: {#E1[59]};
  307. Name: {commondesktop}\{#E1[62]}; Filename: {app}\{#E1[60]}\{#E1[61]}; WorkingDir: {app}\{#E1[60]}; Check: CreateShortcuts;
  308. #ifdef AppExe2
  309. Name: {group}\{#E2[62]}; Filename: {app}\{#E2[60]}\{#E2[61]}; WorkingDir: {app}\{#E2[60]}; Comment: {#E2[59]};
  310. Name: {commondesktop}\{#E2[62]}; Filename: {app}\{#E2[60]}\{#E2[61]}; WorkingDir: {app}\{#E2[60]}; Check: CreateShortcuts;
  311. #ifdef AppExe3
  312. Name: {group}\{#E3[62]}; Filename: {app}\{#E3[60]}\{#E3[61]}; WorkingDir: {app}\{#E3[60]}; Comment: {#E3[59]};
  313. Name: {commondesktop}\{#E3[62]}; Filename: {app}\{#E3[60]}\{#E3[61]}; WorkingDir: {app}\{#E3[60]}; Check: CreateShortcuts;
  314. #ifdef AppExe4
  315. Name: {group}\{#E4[62]}; Filename: {app}\{#E4[60]}\{#E4[61]}; WorkingDir: {app}\{#E4[60]}; Comment: {#E4[59]};
  316. Name: {commondesktop}\{#E4[62]}; Filename: {app}\{#E4[60]}\{#E4[61]}; WorkingDir: {app}\{#E4[60]}; Check: CreateShortcuts;
  317. #ifdef AppExe5
  318. Name: {group}\{#E5[62]}; Filename: {app}\{#E5[60]}\{#E5[61]}; WorkingDir: {app}\{#E5[60]}; Comment: {#E5[59]};
  319. Name: {commondesktop}\{#E5[62]}; Filename: {app}\{#E5[60]}\{#E5[61]}; WorkingDir: {app}\{#E5[60]}; Check: CreateShortcuts;
  320. #ifdef AppExe6
  321. Name: {group}\{#E6[62]}; Filename: {app}\{#E6[60]}\{#E6[61]}; WorkingDir: {app}\{#E6[60]}; Comment: {#E6[59]};
  322. Name: {commondesktop}\{#E6[62]}; Filename: {app}\{#E6[60]}\{#E6[61]}; WorkingDir: {app}\{#E6[60]}; Check: CreateShortcuts;
  323. #endif
  324. #endif
  325. #endif
  326. #endif
  327. #endif
  328. #endif
  329. Name: {group}\Uninstall; Filename: {uninstallexe}; Comment: Uninstall {#AppName};
  330.  
  331. [Code]
  332. const
  333. SlideNone = 0;
  334. SlideFade = 1;
  335. SlideLeft = 2;
  336. SlideRight = 3;
  337. SlideUp = 4;
  338. SlideDown = 5;
  339. SlideSplitX = 6;
  340. SlideSplitY = 7;
  341. SlideSliceX = 8;
  342. SlideSliceY = 9;
  343. SlideAuto = 10;
  344.  
  345. type
  346. TCallback = function (OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
  347. TCallback2 = function (OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
  348. TData = record
  349. Arc: array of String;
  350. end;
  351. TSize = record
  352. Width, Height: UINT;
  353. end;
  354.  
  355. type
  356. TCusBtn = record
  357. Base, Top: TPanel;
  358. ModalBtn : TButton;
  359. end;
  360.  
  361. type
  362. TCusChk = record
  363. Base, Mid, Top: TPanel;
  364. Labl: TLabel;
  365. IsChecked, IsEnabled: Boolean;
  366. end;
  367.  
  368. type
  369. TCusPBR = record
  370. Base, Mid, Top: TPanel;
  371. end;
  372.  
  373. type
  374. TCusEdt = record
  375. Base, Top: TPanel;
  376. end;
  377.  
  378. type
  379. TAniBar = record
  380. Tmr: TTimer;
  381. Dots: Array of TPanel;
  382. Left, Top, Width, Height: Integer;
  383. end;
  384.  
  385. type
  386. TCusSld = record
  387. Img, Img2, Img3, Img4: array of Longint;
  388. Tmr, Tmr2, Tmr3: TTimer;
  389. Count, ImgTime, EftTime, Showing: Longint;
  390. Parent: TWinControl;
  391. Effect: Integer;
  392. Left, Top, Width, Height: Longint;
  393. ImageSize : TSize;
  394. end;
  395.  
  396. type
  397. TCusTle = record
  398. Tmr: TTimer;
  399. Base: TListView;
  400. Labl, Labl2: TLabel;
  401. MImg: Longint;
  402. Slide: TCusSld;
  403. ModalBtn : TButton;
  404. StartInfo: String;
  405. Animation: Boolean;
  406. Wait, Timer: Longint;
  407. AniBar: TAniBar;
  408. Startup: TListView;
  409. Event: TNotifyEvent;
  410. end;
  411.  
  412. type
  413. TCusLck = record
  414. Parent: TSetupForm;
  415. Tile: TListView;
  416. LTime, LDate, Labl: TLabel;
  417. Tmr: TTimer;
  418. Dirct: String;
  419. Locked: Boolean;
  420. end;
  421.  
  422. var
  423. TitleLabel1, TitleLabel2, TitleLabel3, TitleLabel4,
  424. StatusLabel1, StatusLabel2, StatusLabel3, StatusLabel4,
  425. WelcomeLabel1, WelcomeLabel2, WelcomeLabel3,
  426. SelectDirLabel1, SelectDirLabel2, SelectDirLabel3,
  427. InstallLabel1, InstallLabel2, InstallLabel3, InstallLabel4,
  428. FinishLabel1, FinishLabel2, FinishLabel3: TLabel;
  429. TopLeftPanel, BottomPanel: TPanel;
  430. CurCol: Integer;
  431. BackBtn, NextBtn, BrowseBtn,
  432. CancelYesBtn, CancelNoBtn: TCusBtn;
  433. AutorunForm, CancelForm: TSetupForm;
  434. DesktopChk, Redist1, Redist2, Redist3, Redist4, Redist5: TCusChk;
  435. SelectDirEdt: TCusEdt;
  436. InstallPBr: TCusPBr;
  437. Launch1Tile, Launch2Tile, Launch3Tile, Launch4Tile, Launch5Tile, Launch6Tile, InstallTile, UninstallTile, ExitTile: TCusTle;
  438. InstallTimer: TTimer;
  439. AutorunAniBar, WizardAniBar, LockScreenAniBar: TAniBar;
  440. AutorunSlide, WizardSlide: TCusSld;
  441. AutorunLock, WizardLock: TCusLck;
  442. ISDoneCancel: Integer;
  443. ISDoneError: Boolean;
  444. Data: array of TData;
  445.  
  446. const
  447. NORMAL_PRIORITY_CLASS = $00000020;
  448. {$EXTERNALSYM NORMAL_PRIORITY_CLASS}
  449. IDLE_PRIORITY_CLASS = $00000040;
  450. {$EXTERNALSYM IDLE_PRIORITY_CLASS}
  451. HIGH_PRIORITY_CLASS = $00000080;
  452. {$EXTERNALSYM HIGH_PRIORITY_CLASS}
  453. REALTIME_PRIORITY_CLASS = $00000100;
  454. {$EXTERNALSYM REALTIME_PRIORITY_CLASS}
  455.  
  456. {$EXTERNALSYM MOUSEEVENTF_MOVE}
  457. MOUSEEVENTF_MOVE = $0001; { mouse move }
  458. {$EXTERNALSYM MOUSEEVENTF_LEFTDOWN}
  459. MOUSEEVENTF_LEFTDOWN = $0002; { left button down }
  460. {$EXTERNALSYM MOUSEEVENTF_LEFTUP}
  461. MOUSEEVENTF_LEFTUP = $0004; { left button up }
  462. {$EXTERNALSYM MOUSEEVENTF_RIGHTDOWN}
  463. MOUSEEVENTF_RIGHTDOWN = $0008; { right button down }
  464. {$EXTERNALSYM MOUSEEVENTF_RIGHTUP}
  465. MOUSEEVENTF_RIGHTUP = $0010; { right button up }
  466. {$EXTERNALSYM MOUSEEVENTF_MIDDLEDOWN}
  467. MOUSEEVENTF_MIDDLEDOWN = $0020; { middle button down }
  468. {$EXTERNALSYM MOUSEEVENTF_MIDDLEUP}
  469. MOUSEEVENTF_MIDDLEUP = $0040; { middle button up }
  470. {$EXTERNALSYM MOUSEEVENTF_WHEEL}
  471. MOUSEEVENTF_WHEEL = $0800; { wheel button rolled }
  472. {$EXTERNALSYM MOUSEEVENTF_HWHEEL}
  473. MOUSEEVENTF_HWHEEL = $1000; { hwheel button rolled }
  474. {$EXTERNALSYM MOUSEEVENTF_MOVE_NOCOALESCE}
  475. MOUSEEVENTF_MOVE_NOCOALESCE = $2000; { hwheel button rolled }
  476. {$EXTERNALSYM MOUSEEVENTF_ABSOLUTE}
  477. MOUSEEVENTF_ABSOLUTE = $8000; { absolute move }
  478.  
  479. AW_FADE_IN = $00080000;
  480. AW_FADE_OUT = $00090000;
  481. AW_SLIDE_IN_LEFT = $00040001;
  482. AW_SLIDE_OUT_LEFT = $00050002;
  483. AW_SLIDE_IN_RIGHT = $00040002;
  484. AW_SLIDE_OUT_RIGHT = $00050001;
  485. AW_SLIDE_IN_TOP = $00040004;
  486. AW_SLIDE_OUT_TOP = $00050008;
  487. AW_SLIDE_IN_BOTTOM = $00040008;
  488. AW_SLIDE_OUT_BOTTOM = $00050004;
  489. AW_DIAG_SLIDE_IN_TOPLEFT = $00040005;
  490. AW_DIAG_SLIDE_OUT_TOPLEFT = $0005000a;
  491. AW_DIAG_SLIDE_IN_TOPRIGHT = $00040006;
  492. AW_DIAG_SLIDE_OUT_TOPRIGHT = $00050009;
  493. AW_DIAG_SLIDE_IN_BOTTOMLEFT = $00040009;
  494. AW_DIAG_SLIDE_OUT_BOTTOMLEFT = $00050006;
  495. AW_DIAG_SLIDE_IN_BOTTOMRIGHT = $0004000a;
  496. AW_DIAG_SLIDE_OUT_BOTTOMRIGHT = $00050005;
  497. AW_EXPLODE = $00040010;
  498. AW_IMPLODE = $00050010;
  499.  
  500. function AnimateWindow(hWnd: HWND; dwTime: DWORD; dwFlags: DWORD): Boolean;
  501. external 'AnimateWindow@user32 stdcall';
  502. function ReleaseCapture: Longint;
  503. external 'ReleaseCapture@user32.dll stdcall';
  504. function SetWindowPos(hWnd, hWndInsertAfter, X, Y, cx, cy, wFlags: Longint):Boolean;
  505. external 'SetWindowPos@user32.dll stdcall';
  506. function ImgLoad(Wnd :HWND; FileName :PAnsiChar; Left, Top, Width, Height :integer; Stretch, IsBkg :boolean) :Longint;
  507. external 'ImgLoad@{tmp}\botva2.dll stdcall delayload';
  508. procedure ImgSetVisiblePart(img:Longint; NewLeft, NewTop, NewWidth, NewHeight : integer);
  509. external 'ImgSetVisiblePart@{tmp}\botva2.dll stdcall delayload';
  510. procedure ImgGetVisiblePart(img:Longint; var Left, Top, Width, Height : integer);
  511. external 'ImgGetVisiblePart@{tmp}\botva2.dll stdcall delayload';
  512. procedure ImgSetPosition(img :Longint; NewLeft, NewTop, NewWidth, NewHeight :integer);
  513. external 'ImgSetPosition@{tmp}\botva2.dll stdcall delayload';
  514. procedure ImgGetPosition(img:Longint; var Left, Top, Width, Height:integer);
  515. external 'ImgGetPosition@{tmp}\botva2.dll stdcall delayload';
  516. procedure ImgSetVisibility(img :Longint; Visible :boolean);
  517. external 'ImgSetVisibility@{tmp}\botva2.dll stdcall delayload';
  518. function ImgGetVisibility(img:Longint):boolean;
  519. external 'ImgGetVisibility@{tmp}\botva2.dll stdcall delayload';
  520. procedure ImgSetTransparent(img:Longint; Value:integer);
  521. external 'ImgSetTransparent@{tmp}\botva2.dll stdcall delayload';
  522. function ImgGetTransparent(img:Longint):integer;
  523. external 'ImgGetTransparent@{tmp}\botva2.dll stdcall delayload';
  524. procedure ImgRelease(img :Longint);
  525. external 'ImgRelease@{tmp}\botva2.dll stdcall delayload';
  526. procedure ImgApplyChanges(h:HWND);
  527. external 'ImgApplyChanges@{tmp}\botva2.dll stdcall delayload';
  528. procedure gdipShutdown;
  529. external 'gdipShutdown@{tmp}\botva2.dll stdcall delayload';
  530. procedure CreateFormFromImage(h:HWND; FileName:PAnsiChar);
  531. external 'CreateFormFromImage@{tmp}\botva2.dll stdcall delayload';
  532. function CreateBitmapRgn(DC: LongWord; Bitmap: HBITMAP; TransClr: DWORD; dX:integer; dY:integer): LongWord;
  533. external 'CreateBitmapRgn@{tmp}\botva2.dll stdcall delayload';
  534. procedure SetMinimizeAnimation(Value: Boolean);
  535. external 'SetMinimizeAnimation@{tmp}\botva2.dll stdcall delayload';
  536. function GetMinimizeAnimation: Boolean;
  537. external 'GetMinimizeAnimation@{tmp}\botva2.dll stdcall delayload';
  538. function LoadCursorFromFile(FileName: String): Longint;
  539. external 'LoadCursorFromFileW@user32 stdcall';
  540. function SetClassLong(hWnd: HWND; Index, NewLong: Longint): Longint;
  541. external 'SetClassLongW@user32 stdcall';
  542. function AddFontResource(lpszFilename:string;fl:dword;pdv:integer): Integer;
  543. external 'AddFontResourceExW@gdi32.dll stdcall';
  544. function RemoveFontResource(lpszFilename:string;fl:dword;pdv:integer): boolean;
  545. external 'RemoveFontResourceExW@gdi32.dll stdcall';
  546. function SetPriorityClass(hProcess: THandle; dwPriorityClass: DWORD): BOOL;
  547. external 'SetPriorityClass@kernel32';
  548. function GetCurrentProcess: THandle;
  549. external 'GetCurrentProcess@kernel32';
  550. function Mouse_Event(dwFlags, dx, dy, dwData: DWORD; dwExtraInfo: Longint):Boolean;
  551. external 'mouse_event@user32.dll stdcall';
  552. function WrapCallback(callback:TCallback2; paramcount:integer):longword;
  553. external 'wrapcallback@files:ISDone.dll stdcall delayload';
  554. function ISDoneInit(RecordFileName:AnsiString; TimeType,Comp1,Comp2,Comp3:Cardinal; WinHandle, NeededMem:longint; callback:TCallback2):boolean;
  555. external 'ISDoneInit@files:ISDone.dll stdcall';
  556. function ISArcExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath, ExtractedPath: AnsiString; DeleteInFile:boolean; Password, CfgFile, WorkPath: AnsiString; ExtractPCF: boolean ):boolean;
  557. external 'ISArcExtract@files:ISDone.dll stdcall delayload';
  558. function IS7ZipExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean;
  559. external 'IS7zipExtract@files:ISDone.dll stdcall delayload';
  560. function ISRarExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean;
  561. external 'ISRarExtract@files:ISDone.dll stdcall delayload';
  562. function ISPrecompExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean;
  563. external 'ISPrecompExtract@files:ISDone.dll stdcall delayload';
  564. function ISSRepExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean;
  565. external 'ISSrepExtract@files:ISDone.dll stdcall delayload';
  566. function ISxDeltaExtract(CurComponent:Cardinal; PctOfTotal:double; minRAM,maxRAM:integer; InName, DiffFile, OutFile: AnsiString; DeleteInFile, DeleteDiffFile:boolean):boolean;
  567. external 'ISxDeltaExtract@files:ISDone.dll stdcall delayload';
  568. function ISPackZIP(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString;ComprLvl:integer; DeleteInFile:boolean):boolean;
  569. external 'ISPackZIP@files:ISDone.dll stdcall delayload';
  570. function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:AnsiString):boolean;
  571. external 'ShowChangeDiskWindow@files:ISDone.dll stdcall delayload';
  572. function Exec2 (FileName, Param: PAnsiChar;Show:boolean):boolean;
  573. external 'Exec2@files:ISDone.dll stdcall delayload';
  574. function ISFindFiles(CurComponent:Cardinal; FileMask:AnsiString; var ColFiles:integer):integer;
  575. external 'ISFindFiles@files:ISDone.dll stdcall delayload';
  576. function ISPickFilename(FindHandle:integer; OutPath:AnsiString; var CurIndex:integer; DeleteInFile:boolean):boolean;
  577. external 'ISPickFilename@files:ISDone.dll stdcall delayload';
  578. function ISGetName(TypeStr:integer):PAnsichar;
  579. external 'ISGetName@files:ISDone.dll stdcall delayload';
  580. function ISFindFree(FindHandle:integer):boolean;
  581. external 'ISFindFree@files:ISDone.dll stdcall delayload';
  582. function ISExec(CurComponent:Cardinal; PctOfTotal,SpecifiedProcessTime:double; ExeName,Parameters,TargetDir,OutputStr:AnsiString;Show:boolean):boolean;
  583. external 'ISExec@files:ISDone.dll stdcall delayload';
  584. function SrepInit(TmpPath:PAnsiChar;VirtMem,MaxSave:Cardinal):boolean;
  585. external 'SrepInit@files:ISDone.dll stdcall delayload';
  586. function PrecompInit(TmpPath:PAnsiChar;VirtMem:cardinal;PrecompVers:single):boolean;
  587. external 'PrecompInit@files:ISDone.dll stdcall delayload';
  588. function FileSearchInit(RecursiveSubDir:boolean):boolean;
  589. external 'FileSearchInit@files:ISDone.dll stdcall delayload';
  590. function ISDoneStop:boolean;
  591. external 'ISDoneStop@files:ISDone.dll stdcall';
  592. function ChangeLanguage(Language:AnsiString):boolean;
  593. external 'ChangeLanguage@files:ISDone.dll stdcall delayload';
  594. function SuspendProc:boolean;
  595. external 'SuspendProc@files:ISDone.dll stdcall';
  596. function ResumeProc:boolean;
  597. external 'ResumeProc@files:ISDone.dll stdcall';
  598.  
  599. function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
  600. begin
  601. if OveralPct<=Wizardform.ProgressGauge.Max then
  602. Wizardform.Progressgauge.Position := OveralPct;
  603. Result := ISDoneCancel;
  604. end;
  605.  
  606. function ConstConv(Constant, Source: String):String;
  607. begin
  608. StringChangeEx(Constant,'{src}',Source,True);
  609. Result:=ExpandConstant(Constant);
  610. end;
  611.  
  612. function Floater(Float: Extended; Value: Integer): string;
  613. begin
  614. Result:= Format('%.'+IntToStr(Value)+'n', [Float]); StringChange(Result, ',', ',');
  615. while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = ',')) and (Pos(',', Result) > 0) do
  616. SetLength(Result, Length(Result)-1);
  617. end;
  618.  
  619. function IntRange(Value,Min,Max: Longint):Longint;
  620. begin
  621. Result:=Value;
  622. if Value < Min then
  623. Result:=Min;
  624. if Value > Max then
  625. Result:=Max;
  626. end;
  627.  
  628. function MetroColor(Col: Integer): TColor;
  629. begin
  630. case Col of
  631. 01: Result:=$00C4A4;
  632. 02: Result:=$17A960;
  633. 03: Result:=$008A00;
  634. 04: Result:=$A9AB00;
  635. 05: Result:=$E2B11A;
  636. 06: Result:=$EF5000;
  637. 07: Result:=$FF006A;
  638. 08: Result:=$FF00AA;
  639. 09: Result:=$D072F4;
  640. 10: Result:=$7300D8;
  641. 11: Result:=$2500A2;
  642. 12: Result:=$0014E5;
  643. 13: Result:=$0068FA;
  644. 14: Result:=$0AA3FF;
  645. 15: Result:=$00C8E3;
  646. 16: Result:=$2C5A82;
  647. 17: Result:=$64876D;
  648. 18: Result:=$877664;
  649. 19: Result:=$8A6076;
  650. 20: Result:=$2D52A0;
  651. 21: Result:=$0000FF;
  652. end;
  653. end;
  654.  
  655. function MetroTime:String;
  656. var
  657. Hour, Min, Sec, MSec: Word;
  658. HR, MN, HC: String;
  659. begin
  660. DecodeTime(Now,Hour,Min,Sec,MSec);
  661. if Hour < 12 then
  662. begin
  663. HC:='AM'
  664. HR:=IntToStr(Hour);
  665. end;
  666. if Hour = 12 then
  667. begin
  668. HC:='PM';
  669. HR:='12';
  670. end;
  671. if Hour > 12 then
  672. begin
  673. HC:='PM';
  674. HR:=IntToStr(Hour - 12);
  675. end;
  676. if Hour = 0 then
  677. begin
  678. HC:='AM';
  679. HR:='12';
  680. end;
  681. if (Min < 10) then
  682. MN:='0' + IntToStr(Min)
  683. else
  684. MN:=IntToStr(Min);
  685. Result:=HR+ ':' + MN + ' ' + HC;
  686. end;
  687.  
  688. function MetroDate:String;
  689. var
  690. Year, Month, Day: Word;
  691. WD, MT: String;
  692. begin
  693. DecodeDate(Now,Year,Month,Day);
  694. case DayOfWeek(Now) of
  695. 1: WD:='Sunday';
  696. 2: WD:='Monday';
  697. 3: WD:='Tuesday';
  698. 4: WD:='Wednesday';
  699. 5: WD:='Thursday';
  700. 6: WD:='Friday';
  701. 7: WD:='Saturday';
  702. end;
  703. case Month of
  704. 1: MT:='January';
  705. 2: MT:='February';
  706. 3: MT:='March';
  707. 4: MT:='April';
  708. 5: MT:='May';
  709. 6: MT:='June';
  710. 7: MT:='July';
  711. 8: MT:='August';
  712. 9: MT:='September';
  713. 10: MT:='October';
  714. 11: MT:='November';
  715. 12: MT:='December';
  716. end;
  717. Result:= WD + ', ' + MT + ' ' + IntToStr(Day);
  718. end;
  719.  
  720. function ReadFileTagJPG(File: String):TSize;
  721. var
  722. Str: String;
  723. Ind, Len: longint;
  724. FS: TFileStream;
  725. CheckSuccessful, WidthCheck: Boolean;
  726. anfangsnummer, passendenummer, PicWidth, PicHeight: Longint;
  727. begin
  728. FS:= TFileStream.Create(File, fmOpenRead);
  729. CheckSuccessful := False;
  730. WidthCheck := False;
  731. passendenummer :=0;
  732. PicWidth := 0;
  733. PicHeight := 0;
  734. if FS.Size < $8000 then
  735. Len:= FS.Size - 2
  736. else
  737. Len:= $8000 - 2;
  738. for Ind:= 0 to Len do
  739. begin
  740. SetLength(Str, 1)
  741. FS.Seek(Ind, soFromBeginning)
  742. FS.ReadBuffer(Str,1)
  743. if CheckSuccessful = False then
  744. begin
  745. anfangsnummer := passendenummer
  746. if (Str = Chr($FF)) and (passendenummer =0) then
  747. passendenummer :=1;
  748. if (Str = Chr($C0)) and (passendenummer =1) then
  749. passendenummer :=2;
  750. if anfangsnummer = passendenummer then
  751. passendenummer :=0;
  752. end;
  753. if (passendenummer =2) then
  754. CheckSuccessful := True;
  755. if (CheckSuccessful = True) and (ind >= 165) and (WidthCheck = True) then
  756. begin
  757. if ind = 165 then
  758. PicWidth := PicWidth + Ord(Str[1]) * 256;
  759. if ind = 166 then
  760. PicWidth := PicWidth + Ord(Str[1]);
  761. if ind = 167 then
  762. break;
  763. end;
  764. if (CheckSuccessful = True) and (ind >= 20) and (WidthCheck = False) then
  765. begin
  766. if ind = 163 then
  767. PicHeight := PicHeight + Ord(Str[1]) * 256;
  768. if ind = 164 then
  769. begin
  770. PicHeight := PicHeight + Ord(Str[1]);
  771. WidthCheck := True;
  772. end;
  773. end;
  774. end;
  775. FS.Free;
  776. Result.Width:=PicWidth;
  777. Result.Height:=PicHeight;
  778. end;
  779.  
  780. function ReadFileTagPNG(File: string):TSize;
  781. var
  782. Str: String;
  783. Ind, Len: longint;
  784. FS: TFileStream;
  785. CheckSuccessful, WidthCheck: Boolean;
  786. anfangsnummer, passendenummer, PicWidth, PicHeight: Longint;
  787. begin
  788. FS:= TFileStream.Create(File, fmOpenRead);
  789. CheckSuccessful := False;
  790. WidthCheck := False;
  791. if FS.Size < $200 then
  792. Len:= FS.Size - 3
  793. else
  794. Len:= $200 - 3;
  795. for Ind:= 0 to Len do
  796. begin
  797. SetLength(Str, 1)
  798. FS.Seek(Ind, soFromBeginning)
  799. FS.ReadBuffer(Str,1)
  800. if CheckSuccessful = False then
  801. begin
  802. anfangsnummer := passendenummer
  803. if (Str = 'P') and (passendenummer =0) then
  804. passendenummer :=1;
  805. if (Str = 'N') and (passendenummer =1) then
  806. passendenummer :=2;
  807. if (Str = 'G') and (passendenummer =2) then
  808. passendenummer :=3;
  809. if anfangsnummer = passendenummer then
  810. passendenummer :=0;
  811. end;
  812. if (passendenummer =3) then
  813. CheckSuccessful := True;
  814. if (CheckSuccessful = True) and (ind >= 16) and (WidthCheck = False) then
  815. begin
  816. if ind = 16 then
  817. PicWidth := PicWidth + Ord(Str[1]) * 256 * 256 * 256;
  818. if ind = 17 then
  819. PicWidth := PicWidth + Ord(Str[1]) * 256 * 256;
  820. if ind = 18 then
  821. PicWidth := PicWidth + Ord(Str[1]) * 256;
  822. if ind = 19 then
  823. PicWidth := PicWidth + Ord(Str[1]);
  824. if ind = 20 then
  825. WidthCheck := True;
  826. end;
  827. if (CheckSuccessful = True) and (ind >= 20) and (WidthCheck = True) then
  828. begin
  829. if ind = 20 then
  830. PicHeight := PicHeight + Ord(Str[1]) * 256 * 256 * 256;
  831. if ind = 21 then
  832. PicHeight := PicHeight + Ord(Str[1]) * 256 * 256;
  833. if ind = 22 then
  834. PicHeight := PicHeight + Ord(Str[1]) * 256;
  835. if ind = 23 then
  836. PicHeight := PicHeight + Ord(Str[1]);
  837. if ind = 24 then
  838. break;
  839. end;
  840. end;
  841. FS.Free;
  842. Result.Width:=PicWidth;
  843. Result.Height:=PicHeight;
  844. end;
  845.  
  846. function GetPictureSize(File: String): TSize;
  847. var
  848. Mem: array[0..5] of Integer;
  849. Str: String;
  850. FS: TFileStream;
  851. n: Integer;
  852. begin
  853. case Uppercase(ExtractFileExt(File)) of
  854. '.GIF':
  855. begin
  856. Mem[4]:=$0706;
  857. Mem[5]:=$0908;
  858. end;
  859. '.JPG','.JPEG':
  860. begin
  861. Mem[4]:=$A5A6;
  862. Mem[5]:=$A3A4;
  863. end;
  864. '.PNG':
  865. begin
  866. Mem[4]:=$1213;
  867. Mem[5]:=$1617;
  868. end;
  869. end;
  870. Mem[0]:= Mem[4] shr 8;
  871. Mem[1]:= Mem[4] and $FF;
  872. Mem[2]:= Mem[5] shr 8;
  873. Mem[3]:= Mem[5] and $FF;
  874. FS:= TFileStream.Create(File, fmOpenRead);
  875. for n:= 0 to 3 do
  876. begin
  877. Str:= Chr(0);
  878. FS.Seek(Mem[n], soFromBeginning);
  879. FS.ReadBuffer(Str, 1); Mem[n]:= Ord(Str[1]);
  880. end;
  881. FS.Free;
  882. Result.Width:= Mem[0] shl 8 + Mem[1];
  883. Result.Height:= Mem[2] shl 8 + Mem[3]
  884. end;
  885.  
  886. //Windows Phone Technology v4.1 created by Razor12911
  887. procedure ButtonDisabled(Sender:TObject);
  888. begin
  889.  
  890. end;
  891.  
  892. procedure ButtonEnter(var Button:TCusBtn);
  893. begin
  894. Button.Base.Color:=MetroColor(CurCol);
  895. #ifdef Dark
  896. Button.Top.Color:=$252525;
  897. #else
  898. Button.Top.Color:=$FFFFFF;
  899. #endif
  900. Button.Top.Font.Color:=MetroColor(CurCol);
  901. end;
  902.  
  903. procedure ButtonLeave(var Button:TCusBtn);
  904. begin
  905. #ifdef Dark
  906. Button.Base.Color:=$FFFFFF;
  907. Button.Top.Color:=$252525;
  908. Button.Top.Font.Color:=$FFFFFF;
  909. #else
  910. Button.Base.Color:=$252525;
  911. Button.Top.Color:=$FFFFFF;
  912. Button.Top.Font.Color:=$252525;
  913. #endif
  914. end;
  915.  
  916. procedure ButtonDown(var Button:TCusBtn);
  917. begin
  918. Button.Base.Color:=MetroColor(CurCol);
  919. Button.Top.Color:=MetroColor(CurCol);
  920. #ifdef Dark
  921. Button.Top.Font.Color:=$252525;
  922. #else
  923. Button.Top.Font.Color:=$FFFFFF;
  924. #endif
  925. end;
  926.  
  927. procedure ButtonUp(var Button:TCusBtn);
  928. begin
  929. Button.Base.Color:=MetroColor(CurCol);
  930. #ifdef Dark
  931. Button.Top.Color:=$252525;
  932. #else
  933. Button.Top.Color:=$FFFFFF;
  934. #endif
  935. Button.Top.Font.Color:=MetroColor(CurCol);
  936. end;
  937.  
  938. procedure ButtonOnEnter(Sender:TObject);
  939. begin
  940. case Sender of
  941. BackBtn.Top: ButtonEnter(BackBtn);
  942. NextBtn.Top: ButtonEnter(NextBtn);
  943. BrowseBtn.Top: ButtonEnter(BrowseBtn);
  944. CancelYesBtn.Top: ButtonEnter(CancelYesBtn);
  945. CancelNoBtn.Top: ButtonEnter(CancelNoBtn);
  946. end;
  947. end;
  948.  
  949. procedure ButtonOnLeave(Sender:TObject);
  950. begin
  951. case Sender of
  952. BackBtn.Top: ButtonLeave(BackBtn);
  953. NextBtn.Top: ButtonLeave(NextBtn);
  954. BrowseBtn.Top: ButtonLeave(BrowseBtn);
  955. CancelYesBtn.Top: ButtonLeave(CancelYesBtn);
  956. CancelNoBtn.Top: ButtonLeave(CancelNoBtn);
  957. end;
  958. end;
  959.  
  960. procedure ButtonOnDown(Sender:TObject; Button:TMouseButton; Shift:TShiftState; X, Y:Integer);
  961. begin
  962. case Sender of
  963. BackBtn.Top: ButtonDown(BackBtn);
  964. NextBtn.Top: ButtonDown(NextBtn);
  965. BrowseBtn.Top: ButtonDown(BrowseBtn);
  966. CancelYesBtn.Top: ButtonDown(CancelYesBtn);
  967. CancelNoBtn.Top: ButtonDown(CancelNoBtn);
  968. end;
  969. end;
  970.  
  971. procedure ButtonOnUp(Sender:TObject; Button:TMouseButton; Shift:TShiftState; X, Y:Integer);
  972. begin
  973. case Sender of
  974. BackBtn.Top: ButtonUp(BackBtn);
  975. NextBtn.Top: ButtonUp(NextBtn);
  976. BrowseBtn.Top: ButtonUp(BrowseBtn);
  977. CancelYesBtn.Top: ButtonUp(CancelYesBtn);
  978. CancelNoBtn.Top: ButtonUp(CancelNoBtn);
  979. end;
  980. end;
  981.  
  982. function ButtonGetText(var Button: TCusBtn):String;
  983. begin
  984. Result:=Button.Top.Caption;
  985. end;
  986.  
  987. procedure ButtonSetText(var Button: TCusBtn; hText: String);
  988. begin
  989. Button.Top.Caption:=hText;
  990. end;
  991.  
  992. procedure ButtonSetVisibility(var Button: TCusBtn; hVisible: Boolean);
  993. begin
  994. Button.Base.Visible:=hVisible;
  995. end;
  996.  
  997. procedure ButtonSetEnabled(var Button: TCusBtn; hEnabled: Boolean);
  998. begin
  999. Button.Base.Enabled:=hEnabled;
  1000. if hEnabled then
  1001. begin
  1002. #ifdef Dark
  1003. Button.Base.Color:=$FFFFFF;
  1004. Button.Top.Font.Color:=$FFFFFF;
  1005. #else
  1006. Button.Base.Color:=$252525;
  1007. Button.Top.Font.Color:=$252525;
  1008. #endif
  1009. end else begin
  1010. Button.Base.Color:=$AAAAAA;
  1011. Button.Top.Font.Color:=$AAAAAA;
  1012. end;
  1013. end;
  1014.  
  1015. procedure ButtonSetEvent(var Button: TCusBtn; Event: TNotifyEvent);
  1016. begin
  1017. Button.Top.OnClick:=Event;
  1018. end;
  1019.  
  1020. procedure ButtonModal(var Button: TCusBtn);
  1021. begin
  1022. Button.ModalBtn.Click;
  1023. end;
  1024.  
  1025. function ButtonCreate(hParent :TWinControl; hLeft, hTop, hWidth, hHeight: Integer; SmallButton: Boolean;Modal: Integer): TCusBtn;
  1026. begin
  1027. Result.Base:= TPanel.Create(hParent);
  1028. with Result.Base do
  1029. begin
  1030. Parent:=hParent;
  1031. Left:=hLeft;
  1032. Top:=hTop;
  1033. Width:=hWidth;
  1034. Height:=hHeight;
  1035. #ifdef Dark
  1036. Color:=$FFFFFF;
  1037. #else
  1038. Color:=$252525;
  1039. #endif
  1040. BorderStyle := bsNone;
  1041. BevelInner := bvNone;
  1042. BevelOuter := bvNone;
  1043. BorderWidth := 0;
  1044. ParentBackground := False;
  1045. end;
  1046.  
  1047. Result.Top:= TPanel.Create(Result.Base);
  1048. with Result.Top do
  1049. begin
  1050. Parent:=Result.Base;
  1051. Left:=1;
  1052. Top:=1;
  1053. Width:=hWidth - 2;
  1054. Height:=hHeight - 2;
  1055. with Font do
  1056. begin
  1057. Name:='Segoe UI';
  1058. if SmallButton then
  1059. Size:=7
  1060. else
  1061. Size:=11;
  1062. #ifdef Dark
  1063. Color:=$FFFFFF;
  1064. #else
  1065. Color:=$252525;
  1066. #endif
  1067. end;
  1068. OnMouseEnter:= @ButtonOnEnter;
  1069. OnMouseLeave:= @ButtonOnLeave;
  1070. OnMouseDown := @ButtonOnDown;
  1071. OnMouseUp := @ButtonOnUp;
  1072. #ifdef Dark
  1073. Color:=$252525;
  1074. #else
  1075. Color:=$FFFFFF;
  1076. #endif
  1077. BorderStyle := bsNone;
  1078. BevelInner := bvNone;
  1079. BevelOuter := bvNone;
  1080. BorderWidth := 0;
  1081. ParentBackground := False;
  1082. end;
  1083.  
  1084. Result.ModalBtn:= TButton.Create(hParent);
  1085. with Result.ModalBtn do
  1086. begin
  1087. SetBounds(0,0,0,0);
  1088. ModalResult:=Modal;
  1089. Parent:= hParent;
  1090. end;
  1091. end;
  1092.  
  1093. procedure CheckBoxDisabled(Sender:TObject);
  1094. begin
  1095.  
  1096. end;
  1097.  
  1098. procedure CheckBoxEnter(var CheckBox:TCusChk);
  1099. begin
  1100. if CheckBox.IsChecked then
  1101. begin
  1102. CheckBox.Base.Color:=MetroColor(CurCol);
  1103. #ifdef Dark
  1104. CheckBox.Top.Color:=$FFFFFF;
  1105. #else
  1106. CheckBox.Top.Color:=$252525;
  1107. #endif
  1108. CheckBox.Labl.Font.Color:=MetroColor(CurCol);
  1109. end else begin
  1110. CheckBox.Base.Color:=MetroColor(CurCol);
  1111. #ifdef Dark
  1112. CheckBox.Top.Color:=$252525;
  1113. #else
  1114. CheckBox.Top.Color:=$FFFFFF;
  1115. #endif
  1116. CheckBox.Labl.Font.Color:=MetroColor(CurCol);
  1117. end;
  1118. end;
  1119.  
  1120. procedure CheckBoxLeave(var CheckBox:TCusChk);
  1121. begin
  1122. if CheckBox.IsChecked then
  1123. begin
  1124. #ifdef Dark
  1125. CheckBox.Base.Color:=MetroColor(CurCol);
  1126. CheckBox.Top.Color:=MetroColor(CurCol);
  1127. CheckBox.Labl.Font.Color:=$FFFFFF;
  1128. #else
  1129. CheckBox.Base.Color:=MetroColor(CurCol);
  1130. CheckBox.Top.Color:=MetroColor(CurCol);
  1131. CheckBox.Labl.Font.Color:=$252525;
  1132. #endif
  1133. end else begin
  1134. #ifdef Dark
  1135. CheckBox.Base.Color:=$FFFFFF;
  1136. CheckBox.Top.Color:=$252525;
  1137. CheckBox.Labl.Font.Color:=$FFFFFF;
  1138. #else
  1139. CheckBox.Base.Color:=$252525;
  1140. CheckBox.Top.Color:=$FFFFFF;
  1141. CheckBox.Labl.Font.Color:=$252525;
  1142. #endif
  1143. end;
  1144. end;
  1145.  
  1146. procedure CheckBoxDown(var CheckBox:TCusChk);
  1147. begin
  1148. if CheckBox.IsChecked then
  1149. begin
  1150. CheckBox.Base.Color:=MetroColor(CurCol);
  1151. CheckBox.Top.Color:=$252525;
  1152. #ifdef Dark
  1153. CheckBox.Labl.Font.Color:=$FFFFFF;
  1154. #else
  1155. CheckBox.Labl.Font.Color:=$252525;
  1156. #endif
  1157. end else begin
  1158. CheckBox.Base.Color:=MetroColor(CurCol);
  1159. CheckBox.Top.Color:=MetroColor(CurCol);
  1160. #ifdef Dark
  1161. CheckBox.Labl.Font.Color:=$FFFFFF;
  1162. #else
  1163. CheckBox.Labl.Font.Color:=$252525;
  1164. #endif
  1165. end
  1166. end;
  1167.  
  1168. procedure CheckBoxUp(var CheckBox:TCusChk);
  1169. begin
  1170. if CheckBox.IsChecked then
  1171. begin
  1172. CheckBox.Base.Color:=MetroColor(CurCol);
  1173. #ifdef Dark
  1174. CheckBox.Top.Color:=$FFFFFF;
  1175. #else
  1176. CheckBox.Top.Color:=$252525;
  1177. #endif
  1178. CheckBox.Labl.Font.Color:=MetroColor(CurCol);
  1179. end else begin
  1180. CheckBox.Base.Color:=MetroColor(CurCol);
  1181. #ifdef Dark
  1182. CheckBox.Top.Color:=$252525;
  1183. #else
  1184. CheckBox.Top.Color:=$FFFFFF;
  1185. #endif
  1186. CheckBox.Labl.Font.Color:=MetroColor(CurCol);
  1187. end;
  1188. end;
  1189.  
  1190. procedure CheckBoxClick(var CheckBox:TCusChk);
  1191. begin
  1192. CheckBox.IsChecked:= not CheckBox.IsChecked;
  1193. end;
  1194.  
  1195. procedure CheckBoxOnEnter(Sender:TObject);
  1196. begin
  1197. case Sender of
  1198. DesktopChk.Top: CheckBoxEnter(DesktopChk);
  1199. #ifdef Redist1
  1200. Redist1.Top: CheckBoxEnter(Redist1);
  1201. #ifdef Redist2
  1202. Redist2.Top: CheckBoxEnter(Redist2);
  1203. #ifdef Redist3
  1204. Redist3.Top: CheckBoxEnter(Redist3);
  1205. #ifdef Redist4
  1206. Redist4.Top: CheckBoxEnter(Redist4);
  1207. #ifdef Redist5
  1208. Redist5.Top: CheckBoxEnter(Redist5);
  1209. #endif
  1210. #endif
  1211. #endif
  1212. #endif
  1213. #endif
  1214. end;
  1215. end;
  1216.  
  1217. procedure CheckBoxOnLeave(Sender:TObject);
  1218. begin
  1219. case Sender of
  1220. DesktopChk.Top: CheckBoxLeave(DesktopChk);
  1221. #ifdef Redist1
  1222. Redist1.Top: CheckBoxLeave(Redist1);
  1223. #ifdef Redist2
  1224. Redist2.Top: CheckBoxLeave(Redist2);
  1225. #ifdef Redist3
  1226. Redist3.Top: CheckBoxLeave(Redist3);
  1227. #ifdef Redist4
  1228. Redist4.Top: CheckBoxLeave(Redist4);
  1229. #ifdef Redist5
  1230. Redist5.Top: CheckBoxLeave(Redist5);
  1231. #endif
  1232. #endif
  1233. #endif
  1234. #endif
  1235. #endif
  1236. end;
  1237. end;
  1238.  
  1239. procedure CheckBoxOnDown(Sender:TObject; CheckBox:TMouseButton; Shift:TShiftState; X, Y:Integer);
  1240. begin
  1241. case Sender of
  1242. DesktopChk.Top: CheckBoxDown(DesktopChk);
  1243. #ifdef Redist1
  1244. Redist1.Top: CheckBoxDown(Redist1);
  1245. #ifdef Redist2
  1246. Redist2.Top: CheckBoxDown(Redist2);
  1247. #ifdef Redist3
  1248. Redist3.Top: CheckBoxDown(Redist3);
  1249. #ifdef Redist4
  1250. Redist4.Top: CheckBoxDown(Redist4);
  1251. #ifdef Redist5
  1252. Redist5.Top: CheckBoxDown(Redist5);
  1253. #endif
  1254. #endif
  1255. #endif
  1256. #endif
  1257. #endif
  1258. end;
  1259. end;
  1260.  
  1261. procedure CheckBoxOnClick(Sender:TObject);
  1262. begin
  1263. case Sender of
  1264. DesktopChk.Top: CheckBoxClick(DesktopChk);
  1265. #ifdef Redist1
  1266. Redist1.Top: CheckBoxClick(Redist1);
  1267. #ifdef Redist2
  1268. Redist2.Top: CheckBoxClick(Redist2);
  1269. #ifdef Redist3
  1270. Redist3.Top: CheckBoxClick(Redist3);
  1271. #ifdef Redist4
  1272. Redist4.Top: CheckBoxClick(Redist4);
  1273. #ifdef Redist5
  1274. Redist5.Top: CheckBoxClick(Redist5);
  1275. #endif
  1276. #endif
  1277. #endif
  1278. #endif
  1279. #endif
  1280. end;
  1281. end;
  1282.  
  1283. procedure CheckBoxOnUp(Sender:TObject; CheckBox:TMouseButton; Shift:TShiftState; X, Y:Integer);
  1284. begin
  1285. case Sender of
  1286. DesktopChk.Top: CheckBoxUp(DesktopChk);
  1287. #ifdef Redist1
  1288. Redist1.Top: CheckBoxUp(Redist1);
  1289. #ifdef Redist2
  1290. Redist2.Top: CheckBoxUp(Redist2);
  1291. #ifdef Redist3
  1292. Redist3.Top: CheckBoxUp(Redist3);
  1293. #ifdef Redist4
  1294. Redist4.Top: CheckBoxUp(Redist4);
  1295. #ifdef Redist5
  1296. Redist5.Top: CheckBoxUp(Redist5);
  1297. #endif
  1298. #endif
  1299. #endif
  1300. #endif
  1301. #endif
  1302. end;
  1303. end;
  1304.  
  1305. procedure CheckBoxSetText(var CheckBox: TCusChk; hText: String);
  1306. begin
  1307. CheckBox.Top.Caption:=hText;
  1308. end;
  1309.  
  1310. procedure CheckBoxSetVisibility(var CheckBox: TCusChk; hVisible: Boolean);
  1311. begin
  1312. CheckBox.Base.Visible:=hVisible;
  1313. CheckBox.Labl.Visible:=hVisible;
  1314. end;
  1315.  
  1316. procedure CheckBoxSetEnabled(var CheckBox: TCusChk; hEnabled: Boolean);
  1317. begin
  1318. CheckBox.Base.Enabled:=hEnabled;
  1319. CheckBox.IsEnabled:=hEnabled;
  1320. if hEnabled then
  1321. begin
  1322. #ifdef Dark
  1323. CheckBox.Base.Color:=$FFFFFF;
  1324. CheckBox.Top.Color:=$FFFFFF;
  1325. CheckBox.Labl.Font.Color:=$FFFFFF;
  1326. #else
  1327. CheckBox.Base.Color:=$252525;
  1328. CheckBox.Top.Color:=$252525;
  1329. CheckBox.Labl.Font.Color:=$252525;
  1330. #endif
  1331. end else begin
  1332. if CheckBox.IsEnabled then
  1333. begin
  1334. CheckBox.Base.Color:=$AAAAAA;
  1335. CheckBox.Top.Color:=$AAAAAA;
  1336. CheckBox.Labl.Font.Color:=$AAAAAA;
  1337. end else begin
  1338. CheckBox.Base.Color:=$AAAAAA;
  1339. #ifdef Dark
  1340. CheckBox.Top.Color:=$252525;
  1341. #else
  1342. CheckBox.Top.Color:=$FFFFFF;
  1343. #endif
  1344. CheckBox.Labl.Font.Color:=$AAAAAA;
  1345. end;
  1346. end;
  1347. end;
  1348.  
  1349. procedure CheckBoxSetChecked(var CheckBox: TCusChk; hChecked: Boolean);
  1350. begin
  1351. CheckBox.IsChecked:= hChecked;
  1352. if CheckBox.IsEnabled then
  1353. begin
  1354. if hChecked then
  1355. begin
  1356. #ifdef Dark
  1357. CheckBox.Base.Color:=MetroColor(CurCol);
  1358. CheckBox.Top.Color:=MetroColor(CurCol);
  1359. CheckBox.Labl.Font.Color:=$FFFFFF;
  1360. #else
  1361. CheckBox.Base.Color:=MetroColor(CurCol);
  1362. CheckBox.Top.Color:=MetroColor(CurCol);
  1363. CheckBox.Labl.Font.Color:=$252525;
  1364. #endif
  1365. end else begin
  1366. #ifdef Dark
  1367. CheckBox.Base.Color:=$FFFFFF;
  1368. CheckBox.Top.Color:=$252525;
  1369. CheckBox.Labl.Font.Color:=$FFFFFF;
  1370. #else
  1371. CheckBox.Base.Color:=$252525;
  1372. CheckBox.Top.Color:=$FFFFFF;
  1373. CheckBox.Labl.Font.Color:=$252525;
  1374. #endif
  1375. end;
  1376. end else begin
  1377. if hChecked then
  1378. begin
  1379. CheckBox.Base.Color:=$AAAAAA;
  1380. CheckBox.Top.Color:=$AAAAAA;
  1381. CheckBox.Labl.Font.Color:=$AAAAAA;
  1382. end else begin
  1383. CheckBox.Base.Color:=$AAAAAA;
  1384. #ifdef Dark
  1385. CheckBox.Top.Color:=$252525;
  1386. #else
  1387. CheckBox.Top.Color:=$FFFFFF;
  1388. #endif
  1389. CheckBox.Labl.Font.Color:=$AAAAAA;
  1390. end;
  1391. end;
  1392. end;
  1393.  
  1394. function CheckBoxGetChecked(var CheckBox: TCusChk): Boolean;
  1395. begin
  1396. Result:=CheckBox.IsChecked;
  1397. end;
  1398.  
  1399. procedure CheckBoxSetEvent(var CheckBox: TCusChk; Event: TNotifyEvent);
  1400. begin
  1401. if CheckBox.IsChecked then
  1402. CheckBox.Top.OnClick:=Event;
  1403. end;
  1404.  
  1405. function CheckBoxCreate(hParent :TWinControl; hLeft, hTop, hWidth, hHeight: Integer; hText: String): TCusChk;
  1406. begin
  1407. Result.IsEnabled:=True;
  1408. Result.Base:= TPanel.Create(hParent);
  1409. with Result.Base do
  1410. begin
  1411. Parent:=hParent;
  1412. Left:=hLeft;
  1413. Top:=hTop;
  1414. Width:=hWidth;
  1415. Height:=hHeight;
  1416. #ifdef Dark
  1417. Color:=$FFFFFF;
  1418. #else
  1419. Color:=$252525;
  1420. #endif
  1421. BorderStyle := bsNone;
  1422. BevelInner := bvNone;
  1423. BevelOuter := bvNone;
  1424. BorderWidth := 0;
  1425. ParentBackground := False;
  1426. end;
  1427.  
  1428. Result.Mid:= TPanel.Create(Result.Base);
  1429. with Result.Mid do
  1430. begin
  1431. Parent:=Result.Base;
  1432. Left:=1;
  1433. Top:=1;
  1434. Width:=hWidth - 2;
  1435. Height:=hHeight - 2;
  1436. #ifdef Dark
  1437. Color:=$252525;
  1438. #else
  1439. Color:=$FFFFFF;
  1440. #endif
  1441. BorderStyle := bsNone;
  1442. BevelInner := bvNone;
  1443. BevelOuter := bvNone;
  1444. BorderWidth := 0;
  1445. ParentBackground := False;
  1446. end;
  1447.  
  1448. Result.Top:= TPanel.Create(Result.Mid);
  1449. with Result.Top do
  1450. begin
  1451. Parent:=Result.Mid;
  1452. Left:=1;
  1453. Top:=1;
  1454. Width:=hWidth - 4;
  1455. Height:=hHeight - 4;
  1456. OnMouseEnter:= @CheckBoxOnEnter;
  1457. OnMouseLeave:= @CheckBoxOnLeave;
  1458. OnMouseDown := @CheckBoxOnDown;
  1459. OnMouseUp := @CheckBoxOnUp;
  1460. OnClick := @CheckBoxOnClick;
  1461. #ifdef Dark
  1462. Color:=$252525;
  1463. #else
  1464. Color:=$FFFFFF;
  1465. #endif
  1466. BorderStyle := bsNone;
  1467. BevelInner := bvNone;
  1468. BevelOuter := bvNone;
  1469. BorderWidth := 0;
  1470. ParentBackground := False;
  1471. end;
  1472.  
  1473. Result.Labl:= TLabel.Create(hParent);
  1474. with Result.Labl do
  1475. begin
  1476. Parent:=hParent;
  1477. OnMouseEnter:= @CheckBoxOnEnter;
  1478. OnMouseLeave:= @CheckBoxOnLeave;
  1479. OnMouseDown := @CheckBoxOnDown;
  1480. OnMouseUp := @CheckBoxOnUp;
  1481. Layout:=tlCenter;
  1482. with Font do
  1483. begin
  1484. Name:='Segoe UI';
  1485. Size:=10;
  1486. #ifdef Dark
  1487. Color:=$FFFFFF;
  1488. #else
  1489. Color:=$252525;
  1490. #endif
  1491. end;
  1492. SetBounds((hLeft + hWidth) + 5,hTop,0,0);
  1493. Caption:=hText
  1494. end;
  1495. end;
  1496.  
  1497. function EditGetText(var Edit: TCusEdt):String;
  1498. begin
  1499. Result:=Edit.Top.Caption;
  1500. end;
  1501.  
  1502. procedure EditSetText(var Edit: TCusEdt; hText: String);
  1503. begin
  1504. Edit.Top.Caption:=hText;
  1505. end;
  1506.  
  1507. procedure EditSetVisibility(var Edit: TCusEdt; hVisible: Boolean);
  1508. begin
  1509. Edit.Base.Visible:=hVisible;
  1510. end;
  1511.  
  1512. procedure EditSetEvent(var Edit: TCusEdt; Event: TNotifyEvent);
  1513. begin
  1514. Edit.Top.OnClick:=Event;
  1515. end;
  1516.  
  1517. function EditCreate(hParent :TWinControl; hLeft, hTop, hWidth, hHeight: Integer): TCusEdt;
  1518. begin
  1519. Result.Base:= TPanel.Create(hParent);
  1520. with Result.Base do
  1521. begin
  1522. Parent:=hParent;
  1523. Left:=hLeft;
  1524. Top:=hTop;
  1525. Width:=hWidth;
  1526. Height:=hHeight;
  1527. Color:=MetroColor(CurCol);
  1528. BorderStyle := bsNone;
  1529. BevelInner := bvNone;
  1530. BevelOuter := bvNone;
  1531. BorderWidth := 0;
  1532. ParentBackground := False;
  1533. end;
  1534.  
  1535. Result.Top:= TPanel.Create(Result.Base);
  1536. with Result.Top do
  1537. begin
  1538. Parent:=Result.Base;
  1539. Alignment:=taLeftJustify;
  1540. Left:=1;
  1541. Top:=1;
  1542. Width:=hWidth - 2;
  1543. Height:=hHeight - 2;
  1544. with Font do
  1545. begin
  1546. Name:='Segoe UI Bold';
  1547. Size:=8;
  1548. Color:=MetroColor(CurCol);
  1549. end;
  1550. #ifdef Dark
  1551. Color:=$252525;
  1552. #else
  1553. Color:=$FFFFFF;
  1554. #endif
  1555. BorderStyle := bsNone;
  1556. BevelInner := bvNone;
  1557. BevelOuter := bvNone;
  1558. BorderWidth := 0;
  1559. ParentBackground := False;
  1560. end;
  1561. end;
  1562.  
  1563. function ProgressGetProgress(var Progress: TCusPBr): Extended;
  1564. begin
  1565. if Progress.Base.Width <> 0 then
  1566. Result:=(Progress.Top.Width * 100) / (Progress.Base.Width) - 6
  1567. else
  1568. Result:=0;
  1569. end;
  1570.  
  1571. procedure ProgressSetProgress(var Progress: TCusPBr; hValue: Extended);
  1572. begin
  1573. Progress.Top.Width:=Round(((Progress.Base.Width) - 6) * hValue / 100);
  1574. end;
  1575.  
  1576. procedure ProgressSetVisibility(var Progress: TCusPBr; hVisible: Boolean);
  1577. begin
  1578. Progress.Base.Visible:=hVisible;
  1579. end;
  1580.  
  1581. procedure ProgressSetEvent(var Progress: TCusPBr; Event: TNotifyEvent);
  1582. begin
  1583. Progress.Top.OnClick:=Event;
  1584. end;
  1585.  
  1586. function ProgressCreate(hParent :TWinControl; hLeft, hTop, hWidth, hHeight: Integer): TCusPBr;
  1587. begin
  1588. Result.Base:= TPanel.Create(hParent);
  1589. with Result.Base do
  1590. begin
  1591. Parent:=hParent;
  1592. Left:=hLeft;
  1593. Top:=hTop;
  1594. Width:=hWidth;
  1595. Height:=hHeight;
  1596. Color:=MetroColor(CurCol);
  1597. BorderStyle := bsNone;
  1598. BevelInner := bvNone;
  1599. BevelOuter := bvNone;
  1600. BorderWidth := 0;
  1601. ParentBackground := False;
  1602. end;
  1603.  
  1604. Result.Mid:= TPanel.Create(Result.Base);
  1605. with Result.Mid do
  1606. begin
  1607. Parent:=Result.Base;
  1608. Left:=1;
  1609. Top:=1;
  1610. Width:=hWidth - 2;
  1611. Height:=hHeight - 2;
  1612. #ifdef Dark
  1613. Color:=$252525;
  1614. #else
  1615. Color:=$FFFFFF;
  1616. #endif
  1617. BorderStyle := bsNone;
  1618. BevelInner := bvNone;
  1619. BevelOuter := bvNone;
  1620. BorderWidth := 0;
  1621. ParentBackground := False;
  1622. end;
  1623.  
  1624. Result.Top:= TPanel.Create(Result.Mid);
  1625. with Result.Top do
  1626. begin
  1627. Parent:=Result.Mid;
  1628. Left:=2;
  1629. Top:=2;
  1630. Width:=0;
  1631. Height:=hHeight - 6;
  1632. with Font do
  1633. begin
  1634. Name:='Segoe UI Bold';
  1635. Size:=8;
  1636. #ifdef Dark
  1637. Color:=$252525;
  1638. #else
  1639. Color:=$FFFFFF;
  1640. #endif
  1641. end;
  1642. Color:=MetroColor(CurCol);
  1643. BorderStyle := bsNone;
  1644. BevelInner := bvNone;
  1645. BevelOuter := bvNone;
  1646. BorderWidth := 0;
  1647. ParentBackground := False;
  1648. end;
  1649. end;
  1650.  
  1651. procedure AniTimer(var AniBar: TAniBar);
  1652. begin
  1653. if (AniBar.Dots[4].Left = AniBar.Left) or ((AniBar.Dots[4].Left > AniBar.Left) and (AniBar.Dots[3].Left <> AniBar.Left)) then
  1654. begin
  1655. if (AniBar.Dots[0].Left < (AniBar.Width * 4/9)) or (AniBar.Dots[0].Left = (AniBar.Width * 4/9)) then
  1656. AniBar.Dots[0].Left:= AniBar.Dots[0].Left + 4;
  1657. if (AniBar.Dots[0].Left > (AniBar.Width * 4/9)) and (AniBar.Dots[0].Left < (AniBar.Width * 5/9)) then
  1658. AniBar.Dots[0].Left:= AniBar.Dots[0].Left + 1;
  1659. if (AniBar.Dots[0].Left > (AniBar.Width * 5/9)) or (AniBar.Dots[0].Left = (AniBar.Width * 5/9)) then
  1660. AniBar.Dots[0].Left:= AniBar.Dots[0].Left + 4;
  1661. if (AniBar.Dots[0].Left = AniBar.Width) or (AniBar.Dots[0].Left > AniBar.Width) then
  1662. AniBar.Dots[0].Left:=AniBar.Left;
  1663. end;
  1664.  
  1665. if (AniBar.Dots[0].Left > (AniBar.Dots[0].Width * 8)) or ((AniBar.Dots[0].Left = AniBar.Left) and (AniBar.Dots[1].Left > AniBar.Left)) then
  1666. begin
  1667. if (AniBar.Dots[1].Left < (AniBar.Width * 4/9)) or (AniBar.Dots[1].Left = (AniBar.Width * 4/9)) then
  1668. AniBar.Dots[1].Left:= AniBar.Dots[1].Left + 4;
  1669. if (AniBar.Dots[1].Left > (AniBar.Width * 4/9)) and (AniBar.Dots[1].Left < (AniBar.Width * 5/9)) then
  1670. AniBar.Dots[1].Left:= AniBar.Dots[1].Left + 1;
  1671. if (AniBar.Dots[1].Left > (AniBar.Width * 5/9)) or (AniBar.Dots[1].Left = (AniBar.Width * 5/9)) then
  1672. AniBar.Dots[1].Left:= AniBar.Dots[1].Left + 4;
  1673. if (AniBar.Dots[1].Left = AniBar.Width) or (AniBar.Dots[1].Left > AniBar.Width) then
  1674. AniBar.Dots[1].Left:=AniBar.Left;
  1675. end;
  1676.  
  1677. if (AniBar.Dots[1].Left > (AniBar.Dots[1].Width * 8)) or ((AniBar.Dots[1].Left = AniBar.Left) and (AniBar.Dots[2].Left > AniBar.Left)) then
  1678. begin
  1679. if (AniBar.Dots[2].Left < (AniBar.Width * 4/9)) or (AniBar.Dots[2].Left = (AniBar.Width * 4/9)) then
  1680. AniBar.Dots[2].Left:= AniBar.Dots[2].Left + 4;
  1681. if (AniBar.Dots[2].Left > (AniBar.Width * 4/9)) and (AniBar.Dots[2].Left < (AniBar.Width * 5/9)) then
  1682. AniBar.Dots[2].Left:= AniBar.Dots[2].Left + 1;
  1683. if (AniBar.Dots[2].Left > (AniBar.Width * 5/9)) or (AniBar.Dots[2].Left = (AniBar.Width * 5/9)) then
  1684. AniBar.Dots[2].Left:= AniBar.Dots[2].Left + 4;
  1685. if (AniBar.Dots[2].Left = AniBar.Width) or (AniBar.Dots[2].Left > AniBar.Width) then
  1686. AniBar.Dots[2].Left:=AniBar.Left;
  1687. end;
  1688.  
  1689. if (AniBar.Dots[2].Left > (AniBar.Dots[2].Width * 8)) or ((AniBar.Dots[2].Left = AniBar.Left) and (AniBar.Dots[3].Left > AniBar.Left)) then
  1690. begin
  1691. if (AniBar.Dots[3].Left < (AniBar.Width * 4/9)) or (AniBar.Dots[3].Left = (AniBar.Width * 4/9)) then
  1692. AniBar.Dots[3].Left:= AniBar.Dots[3].Left + 4;
  1693. if (AniBar.Dots[3].Left > (AniBar.Width * 4/9)) and (AniBar.Dots[3].Left < (AniBar.Width * 5/9)) then
  1694. AniBar.Dots[3].Left:= AniBar.Dots[3].Left + 1;
  1695. if (AniBar.Dots[3].Left > (AniBar.Width * 5/9)) or (AniBar.Dots[3].Left = (AniBar.Width * 5/9)) then
  1696. AniBar.Dots[3].Left:= AniBar.Dots[3].Left + 4;
  1697. if (AniBar.Dots[3].Left = AniBar.Width) or (AniBar.Dots[3].Left > AniBar.Width) then
  1698. AniBar.Dots[3].Left:=AniBar.Left;
  1699. end;
  1700.  
  1701. if (AniBar.Dots[3].Left > (AniBar.Dots[3].Width * 8)) or ((AniBar.Dots[3].Left = AniBar.Left) and (AniBar.Dots[4].Left > AniBar.Left)) then
  1702. begin
  1703. if (AniBar.Dots[4].Left < (AniBar.Width * 4/9)) or (AniBar.Dots[4].Left = (AniBar.Width * 4/9)) then
  1704. AniBar.Dots[4].Left:= AniBar.Dots[4].Left + 4;
  1705. if (AniBar.Dots[4].Left > (AniBar.Width * 4/9)) and (AniBar.Dots[4].Left < (AniBar.Width * 5/9)) then
  1706. AniBar.Dots[4].Left:= AniBar.Dots[4].Left + 1;
  1707. if (AniBar.Dots[4].Left > (AniBar.Width * 5/9)) or (AniBar.Dots[4].Left = (AniBar.Width * 5/9)) then
  1708. AniBar.Dots[4].Left:= AniBar.Dots[4].Left + 4;
  1709. if (AniBar.Dots[4].Left = AniBar.Width) or (AniBar.Dots[4].Left > AniBar.Width) then
  1710. AniBar.Dots[4].Left:=AniBar.Left;
  1711. end;
  1712. end;
  1713.  
  1714. procedure AniOnTimer(Sender: TObject);
  1715. begin
  1716. case Sender of
  1717. AutorunAniBar.Tmr: AniTimer(AutorunAniBar);
  1718. WizardAniBar.Tmr: AniTimer(WizardAniBar);
  1719. LockScreenAniBar.Tmr: AniTimer(LockScreenAniBar);
  1720. #ifdef AppExe1
  1721. Launch1Tile.AniBar.Tmr: AniTimer(Launch1Tile.AniBar);
  1722. #ifdef AppExe2
  1723. Launch2Tile.AniBar.Tmr: AniTimer(Launch2Tile.AniBar);
  1724. #ifdef AppExe3
  1725. Launch3Tile.AniBar.Tmr: AniTimer(Launch3Tile.AniBar);
  1726. #ifdef AppExe4
  1727. Launch4Tile.AniBar.Tmr: AniTimer(Launch4Tile.AniBar);
  1728. #ifdef AppExe5
  1729. Launch5Tile.AniBar.Tmr: AniTimer(Launch5Tile.AniBar);
  1730. #ifdef AppExe6
  1731. Launch6Tile.AniBar.Tmr: AniTimer(Launch6Tile.AniBar);
  1732. #endif
  1733. #endif
  1734. #endif
  1735. #endif
  1736. #endif
  1737. #endif
  1738. end;
  1739. end;
  1740.  
  1741. (*procedure AniSetVisibility(var AniBar: TAniBar; hVisible: Boolean);
  1742. var
  1743. x: Integer;
  1744. begin
  1745. for x:=0 to 4 do
  1746. AniBar.Dots[x].Visible:=hVisible;
  1747. end;*)
  1748.  
  1749. (*procedure AniSetEnabled(var AniBar: TAniBar; hEnabled: Boolean);
  1750. begin
  1751. AniBar.Tmr.Enabled:=hEnabled;
  1752. end;
  1753. *)
  1754. procedure AniReset(var AniBar: TAniBar);
  1755. var
  1756. x: Integer;
  1757. begin
  1758. for x:=0 to 4 do
  1759. AniBar.Dots[x].Left:=AniBar.Left;
  1760. end;
  1761.  
  1762. function AniCreate(hParent :TWinControl; hLeft, hTop, hWidth, hHeight: Integer; WhiteCol: Boolean): TAniBar;
  1763. var
  1764. x: Integer;
  1765. begin
  1766. Result.Left:=hLeft;
  1767. Result.Top:=hTop;
  1768. Result.Width:=hWidth;
  1769. Result.Height:=hHeight;
  1770. SetArrayLength(Result.Dots,5);
  1771. for x:=0 to 4 do
  1772. begin
  1773. Result.Dots[x]:=TPanel.Create(hParent);
  1774. with Result.Dots[x] do
  1775. begin
  1776. Parent:=hParent;
  1777. Left:=hLeft;
  1778. Top:=hTop;
  1779. Width:=hHeight;
  1780. Height:=hHeight;
  1781. if WhiteCol then
  1782. Color:=$FFFFFF
  1783. else
  1784. Color:=MetroColor(CurCol);
  1785. BorderStyle := bsNone;
  1786. BevelInner := bvNone;
  1787. BevelOuter := bvNone;
  1788. BorderWidth := 0;
  1789. ParentBackground := False;
  1790. end;
  1791.  
  1792. Result.Tmr:= TTimer.Create(AutorunForm);
  1793. with Result.Tmr do
  1794. begin
  1795. OnTimer:=@AniOnTimer;
  1796. Interval:=10;
  1797. Enabled:=True;
  1798. end;
  1799. end;
  1800. end;
  1801.  
  1802. function SldPosX(var Slide: TCusSld; hValue: Longint):Longint;
  1803. begin
  1804. Result:=hValue;
  1805. case hValue of
  1806. -1: Result:=hValue - 3;
  1807. -2: Result:=hValue - 2;
  1808. -3: Result:=hValue - 1;
  1809. end;
  1810. case hValue of
  1811. 1: Result:=hValue + 3;
  1812. 2: Result:=hValue + 2;
  1813. 3: Result:=hValue + 1;
  1814. end;
  1815. case hValue of
  1816. Slide.ImageSize.Width - 1: Result:=hValue - 3;
  1817. Slide.ImageSize.Width - 2: Result:=hValue - 2;
  1818. Slide.ImageSize.Width - 3: Result:=hValue - 1;
  1819. end;
  1820. case hValue of
  1821. -(Slide.ImageSize.Width) + 1: Result:=hValue + 3;
  1822. -(Slide.ImageSize.Width) + 2: Result:=hValue + 2;
  1823. -(Slide.ImageSize.Width) + 3: Result:=hValue + 1;
  1824. end;
  1825. end;
  1826.  
  1827. function SldPosY(var Slide: TCusSld; hValue: Longint):Longint;
  1828. begin
  1829. Result:=hValue;
  1830. case hValue of
  1831. -1: Result:=hValue - 3;
  1832. -2: Result:=hValue - 2;
  1833. -3: Result:=hValue - 1;
  1834. end;
  1835. case hValue of
  1836. 1: Result:=hValue + 3;
  1837. 2: Result:=hValue + 2;
  1838. 3: Result:=hValue + 1;
  1839. end;
  1840. case hValue of
  1841. Slide.ImageSize.Height - 1: Result:=hValue - 3;
  1842. Slide.ImageSize.Height - 2: Result:=hValue - 2;
  1843. Slide.ImageSize.Height - 3: Result:=hValue - 1;
  1844. end;
  1845. case hValue of
  1846. -(Slide.ImageSize.Height) + 1: Result:=hValue + 3;
  1847. -(Slide.ImageSize.Height) + 2: Result:=hValue + 2;
  1848. -(Slide.ImageSize.Height) + 3: Result:=hValue + 1;
  1849. end;
  1850. end;
  1851.  
  1852. procedure SldTimer(var Slide: TCusSld);
  1853. begin
  1854. if Slide.Tmr2.Enabled then
  1855. begin
  1856. if Slide.Showing < Slide.Count then
  1857. Slide.Showing:=Slide.Showing + 1;
  1858. if Slide.Showing = Slide.Count then
  1859. Slide.Showing:=1;
  1860. if (Slide.Showing + 1) = Slide.Count then
  1861. begin
  1862. if Slide.Effect = 0 then
  1863. ImgSetVisibility(Slide.Img[0],True);
  1864. if Slide.Effect = 1 then
  1865. ImgSetTransparent(Slide.Img[0],255);
  1866. if Slide.Effect = 2 then
  1867. ImgSetVisiblePart(Slide.Img[0],-(Slide.ImageSize.Width),0,Slide.ImageSize.Width,Slide.ImageSize.Height);
  1868. if Slide.Effect = 3 then
  1869. ImgSetVisiblePart(Slide.Img[0],Slide.ImageSize.Width,0,Slide.ImageSize.Width,Slide.ImageSize.Height);
  1870. if Slide.Effect = 4 then
  1871. ImgSetVisiblePart(Slide.Img[0],0,-(Slide.ImageSize.Height),Slide.ImageSize.Width,Slide.ImageSize.Height);
  1872. if Slide.Effect = 5 then
  1873. ImgSetVisiblePart(Slide.Img[0],0,Slide.ImageSize.Height,Slide.ImageSize.Width,Slide.ImageSize.Height);
  1874. if Slide.Effect = 6 then
  1875. begin
  1876. ImgSetVisiblePart(Slide.Img[0],Slide.ImageSize.Width,0,Slide.ImageSize.Width,Slide.ImageSize.Height / 2);
  1877. ImgSetVisiblePart(Slide.Img2[0],-(Slide.ImageSize.Width),Slide.ImageSize.Height / 2,Slide.ImageSize.Width,Slide.ImageSize.Height / 2);
  1878. end;
  1879. if Slide.Effect = 7 then
  1880. begin
  1881. ImgSetVisiblePart(Slide.Img[0],0,Slide.ImageSize.Height,Slide.ImageSize.Width / 2,Slide.ImageSize.Height);
  1882. ImgSetVisiblePart(Slide.Img2[0],Slide.ImageSize.Width / 2,-(Slide.ImageSize.Height),Slide.ImageSize.Width / 2,Slide.ImageSize.Height);
  1883. end;
  1884. if Slide.Effect = 8 then
  1885. begin
  1886. ImgSetVisiblePart(Slide.Img[0],Slide.ImageSize.Width,0,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
  1887. ImgSetVisiblePart(Slide.Img2[0],-(Slide.ImageSize.Width),Slide.ImageSize.Height / 4 * 1,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
  1888. ImgSetVisiblePart(Slide.Img3[0],Slide.ImageSize.Width,Slide.ImageSize.Height / 4 * 2,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
  1889. ImgSetVisiblePart(Slide.Img4[0],-(Slide.ImageSize.Width),Slide.ImageSize.Height / 4 * 3,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
  1890. end;
  1891. if Slide.Effect = 9 then
  1892. begin
  1893. ImgSetVisiblePart(Slide.Img[0],0,Slide.ImageSize.Height,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
  1894. ImgSetVisiblePart(Slide.Img2[0],Slide.ImageSize.Width / 4 * 1,-(Slide.ImageSize.Height),Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
  1895. ImgSetVisiblePart(Slide.Img3[0],Slide.ImageSize.Width / 4 * 2,Slide.ImageSize.Height,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
  1896. ImgSetVisiblePart(Slide.Img4[0],Slide.ImageSize.Width / 4 * 3,-(Slide.ImageSize.Height),Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
  1897. end;
  1898. end;
  1899. ImgApplyChanges(Slide.Parent.Handle);
  1900. end else
  1901. Slide.Tmr2.Enabled:=True;
  1902. end;
  1903.  
  1904. procedure SldTimer2(var Slide: TCusSld);
  1905. var
  1906. Left,Top,Width,Height: Longint;
  1907. Left2,Top2,Width2,Height2: Longint;
  1908. Left3,Top3,Width3,Height3: Longint;
  1909. Left4,Top4,Width4,Height4: Longint;
  1910. Visible: Boolean;
  1911. Transparent: Integer;
  1912. begin
  1913. if Slide.Effect = 0 then
  1914. begin
  1915. Visible:=ImgGetVisibility(Slide.Img[(Slide.Showing - 1)]);
  1916. ImgSetVisiblePart(Slide.Img[(Slide.Showing - 1)],0,0,Slide.ImageSize.Width,Slide.ImageSize.Height);
  1917. ImgSetVisiblePart(Slide.Img[(Slide.Showing - 0)],0,0,Slide.ImageSize.Width,Slide.ImageSize.Height);
  1918. if Visible = True then
  1919. begin
  1920. ImgSetVisibility(Slide.Img[(Slide.Showing - 1)],False);
  1921. ImgSetVisibility(Slide.Img[(Slide.Showing - 0)],True);
  1922. end;
  1923. end;
  1924. if Slide.Effect = 1 then
  1925. begin
  1926. Transparent:=ImgGetTransparent(Slide.Img[(Slide.Showing - 1)]);
  1927. if Transparent > 0 then
  1928. begin
  1929. ImgSetTransparent(Slide.Img[(Slide.Showing - 1)],Transparent - 3);
  1930. ImgSetTransparent(Slide.Img[(Slide.Showing - 0)],-(Transparent - 255) + 3);
  1931. end;
  1932. end;
  1933. if Slide.Effect = 2 then
  1934. begin
  1935. ImgGetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top,Width,Height);
  1936. Left:= SldPosX(Slide,Left);
  1937. Top:= SldPosY(Slide,Top);
  1938. if ((Slide.Showing + 1) = Slide.Count) and ((Left - Slide.ImageSize.Width) <> 0) then
  1939. begin
  1940. ImgGetVisiblePart(Slide.Img[0],Left2,Top2,Width2,Height2);
  1941. Left2:= SldPosX(Slide,Left2);
  1942. Top2:= SldPosY(Slide,Top2);
  1943. ImgSetVisiblePart(Slide.Img[0],Left2 + 4,Top2,Slide.ImageSize.Width,Slide.ImageSize.Height);
  1944. end;
  1945. if (Left - Slide.ImageSize.Width) <> 0 then
  1946. begin
  1947. ImgSetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left + 4,Top,Slide.ImageSize.Width,Slide.ImageSize.Height);
  1948. ImgSetVisiblePart(Slide.Img[(Slide.Showing - 0)],Left - Slide.ImageSize.Width + 4,Top,Slide.ImageSize.Width,Slide.ImageSize.Height);
  1949. end;
  1950. end;
  1951. if Slide.Effect = 3 then
  1952. begin
  1953. ImgGetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top,Width,Height);
  1954. Left:= SldPosX(Slide,Left);
  1955. Top:= SldPosY(Slide,Top);
  1956. if ((Slide.Showing + 1) = Slide.Count) and ((Left + Slide.ImageSize.Width) <> 0) then
  1957. begin
  1958. ImgGetVisiblePart(Slide.Img[0],Left2,Top2,Width2,Height2);
  1959. Left2:= SldPosX(Slide,Left2);
  1960. Top2:= SldPosY(Slide,Top2);
  1961. ImgSetVisiblePart(Slide.Img[0],Left2 - 4,Top2,Slide.ImageSize.Width,Slide.ImageSize.Height);
  1962. end;
  1963. if (Left + Slide.ImageSize.Width) <> 0 then
  1964. begin
  1965. ImgSetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left - 4,Top,Slide.ImageSize.Width,Slide.ImageSize.Height);
  1966. ImgSetVisiblePart(Slide.Img[(Slide.Showing - 0)],Left + Slide.ImageSize.Width - 4,Top,Slide.ImageSize.Width,Slide.ImageSize.Height);
  1967. end;
  1968. end;
  1969. if Slide.Effect = 4 then
  1970. begin
  1971. ImgGetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top,Width,Height);
  1972. Left:= SldPosX(Slide,Left);
  1973. Top:= SldPosY(Slide,Top);
  1974. if ((Slide.Showing + 1) = Slide.Count) and ((Top - Slide.ImageSize.Height) <> 0) then
  1975. begin
  1976. ImgGetVisiblePart(Slide.Img[0],Left2,Top2,Width2,Height2);
  1977. Left2:= SldPosX(Slide,Left2);
  1978. Top2:= SldPosY(Slide,Top2);
  1979. ImgSetVisiblePart(Slide.Img[0],Left2,Top2 + 4,Slide.ImageSize.Width,Slide.ImageSize.Height);
  1980. end;
  1981. if (Top - Slide.ImageSize.Height) <> 0 then
  1982. begin
  1983. ImgGetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top,Width,Height);
  1984. Left:= SldPosX(Slide,Left);
  1985. Top:= SldPosY(Slide,Top);
  1986. ImgSetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top + 4,Slide.ImageSize.Width,Slide.ImageSize.Height);
  1987. ImgSetVisiblePart(Slide.Img[(Slide.Showing - 0)],Left,Top - Slide.ImageSize.Height + 4,Slide.ImageSize.Width,Slide.ImageSize.Height);
  1988. end;
  1989. end;
  1990. if Slide.Effect = 5 then
  1991. begin
  1992. ImgGetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top,Width,Height);
  1993. Left:= SldPosX(Slide,Left);
  1994. Top:= SldPosY(Slide,Top);
  1995. if ((Slide.Showing + 1) = Slide.Count) and ((Top + Slide.Height) <> 0) then
  1996. begin
  1997. ImgGetVisiblePart(Slide.Img[0],Left2,Top2,Width2,Height2);
  1998. Left2:= SldPosX(Slide,Left2);
  1999. Top2:= SldPosY(Slide,Top2);
  2000. ImgSetVisiblePart(Slide.Img[0],Left2,Top2 - 4,Slide.ImageSize.Width,Slide.ImageSize.Height);
  2001. end;
  2002. if (Top + Slide.Height) <> 0 then
  2003. begin
  2004. ImgSetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top - 4,Slide.ImageSize.Width,Slide.ImageSize.Height);
  2005. ImgSetVisiblePart(Slide.Img[(Slide.Showing - 0)],Left,Top + Slide.Height - 4,Slide.ImageSize.Width,Slide.ImageSize.Height);
  2006. end;
  2007. end;
  2008. if Slide.Effect = 6 then
  2009. begin
  2010. ImgGetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top,Width,Height);
  2011. Left:= SldPosX(Slide,Left);
  2012. Top:= SldPosY(Slide,Top);
  2013. ImgGetVisiblePart(Slide.Img2[(Slide.Showing - 1)],Left3,Top3,Width3,Height3);
  2014. Left3:= SldPosX(Slide,Left3);
  2015. Top3:= SldPosY(Slide,Top3);
  2016. if ((Slide.Showing + 1) = Slide.Count) and ((Left + Slide.ImageSize.Width) <> 0) then
  2017. begin
  2018. ImgGetVisiblePart(Slide.Img[0],Left2,Top2,Width2,Height2);
  2019. Left2:= SldPosX(Slide,Left2);
  2020. Top2:= SldPosY(Slide,Top2);
  2021. ImgGetVisiblePart(Slide.Img2[0],Left4,Top4,Width4,Height4);
  2022. Left4:= SldPosX(Slide,Left4);
  2023. Top4:= SldPosY(Slide,Top4);
  2024. ImgSetVisiblePart(Slide.Img[0],Left2 - 4,Top2,Slide.ImageSize.Width,Slide.ImageSize.Height / 2);
  2025. ImgSetVisiblePart(Slide.Img2[0],Left4 + 4,Top4,Slide.ImageSize.Width,Slide.ImageSize.Height / 2);
  2026. end;
  2027. if (Left + Slide.ImageSize.Width) <> 0 then
  2028. begin
  2029. ImgSetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left - 4,Top,Slide.ImageSize.Width,Slide.ImageSize.Height / 2);
  2030. ImgSetVisiblePart(Slide.Img[(Slide.Showing - 0)],Left + Slide.ImageSize.Width - 4,Top,Slide.ImageSize.Width,Slide.ImageSize.Height / 2);
  2031. ImgSetVisiblePart(Slide.Img2[(Slide.Showing - 1)],Left3 + 4,Top3,Slide.ImageSize.Width,Slide.ImageSize.Height / 2);
  2032. ImgSetVisiblePart(Slide.Img2[(Slide.Showing - 0)],Left3 - Slide.ImageSize.Width + 4,Top3,Slide.ImageSize.Width,Slide.ImageSize.Height / 2);
  2033. end;
  2034. end;
  2035. if Slide.Effect = 7 then
  2036. begin
  2037. ImgGetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top,Width,Height);
  2038. Left:= SldPosX(Slide,Left);
  2039. Top:= SldPosY(Slide,Top);
  2040. ImgGetVisiblePart(Slide.Img2[(Slide.Showing - 1)],Left3,Top3,Width3,Height3);
  2041. Left3:= SldPosX(Slide,Left3);
  2042. Top3:= SldPosY(Slide,Top3);
  2043. if ((Slide.Showing + 1) = Slide.Count) and ((Top + Slide.ImageSize.Height) <> 0) then
  2044. begin
  2045. ImgGetVisiblePart(Slide.Img[0],Left2,Top2,Width2,Height2);
  2046. Left2:= SldPosX(Slide,Left2);
  2047. Top2:= SldPosY(Slide,Top2);
  2048. ImgGetVisiblePart(Slide.Img2[0],Left4,Top4,Width4,Height4);
  2049. Left4:= SldPosX(Slide,Left4);
  2050. Top4:= SldPosY(Slide,Top4);
  2051. ImgSetVisiblePart(Slide.Img[0],Left2,Top2 - 4,Slide.ImageSize.Width / 2,Slide.ImageSize.Height);
  2052. ImgSetVisiblePart(Slide.Img2[0],Left4,Top4 + 4,Slide.ImageSize.Width / 2,Slide.ImageSize.Height);
  2053. end;
  2054. if (Top + Slide.ImageSize.Height) <> 0 then
  2055. begin
  2056. ImgSetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top - 4,Slide.ImageSize.Width / 2,Slide.ImageSize.Height);
  2057. ImgSetVisiblePart(Slide.Img[(Slide.Showing - 0)],Left,Top + Slide.ImageSize.Height - 4,Slide.ImageSize.Width / 2,Slide.ImageSize.Height);
  2058. ImgSetVisiblePart(Slide.Img2[(Slide.Showing - 1)],Left3,Top3 + 4,Slide.ImageSize.Width / 2,Slide.ImageSize.Height);
  2059. ImgSetVisiblePart(Slide.Img2[(Slide.Showing - 0)],Left3,Top3 - Slide.ImageSize.Height + 4,Slide.ImageSize.Width / 2,Slide.ImageSize.Height);
  2060. end;
  2061. end;
  2062. if Slide.Effect = 8 then
  2063. begin
  2064. ImgGetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top,Width,Height);
  2065. Left:= SldPosX(Slide,Left);
  2066. Top:= SldPosY(Slide,Top);
  2067. ImgGetVisiblePart(Slide.Img2[(Slide.Showing - 1)],Left3,Top3,Width3,Height3);
  2068. Left3:= SldPosX(Slide,Left3);
  2069. Top3:= SldPosY(Slide,Top3);
  2070. if ((Slide.Showing + 1) = Slide.Count) and ((Left + Slide.ImageSize.Width) <> 0) then
  2071. begin
  2072. ImgGetVisiblePart(Slide.Img[0],Left2,Top2,Width2,Height2);
  2073. Left2:= SldPosX(Slide,Left2);
  2074. Top2:= SldPosY(Slide,Top2);
  2075. ImgGetVisiblePart(Slide.Img2[0],Left4,Top4,Width4,Height4);
  2076. Left4:= SldPosX(Slide,Left4);
  2077. Top4:= SldPosY(Slide,Top4);
  2078. ImgSetVisiblePart(Slide.Img[0],Left2 - 4,Top2,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
  2079. ImgSetVisiblePart(Slide.Img2[0],Left4 + 4,Top4 * 1,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
  2080. ImgSetVisiblePart(Slide.Img3[0],Left2 - 4,Top4 * 2,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
  2081. ImgSetVisiblePart(Slide.Img4[0],Left4 + 4,Top4 * 3,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
  2082. end;
  2083. if (Left + Slide.ImageSize.Width) <> 0 then
  2084. begin
  2085. ImgSetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left - 4,Top,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
  2086. ImgSetVisiblePart(Slide.Img[(Slide.Showing - 0)],Left + Slide.ImageSize.Width - 4,Top,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
  2087. ImgSetVisiblePart(Slide.Img2[(Slide.Showing - 1)],Left3 + 4,Top3 * 1,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
  2088. ImgSetVisiblePart(Slide.Img2[(Slide.Showing - 0)],Left3 - Slide.ImageSize.Width + 4,Top3 * 1,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
  2089. ImgSetVisiblePart(Slide.Img3[(Slide.Showing - 1)],Left - 4,Top3 * 2,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
  2090. ImgSetVisiblePart(Slide.Img3[(Slide.Showing - 0)],Left + Slide.ImageSize.Width - 4,Top3 * 2,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
  2091. ImgSetVisiblePart(Slide.Img4[(Slide.Showing - 1)],Left3 + 4,Top3 * 3,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
  2092. ImgSetVisiblePart(Slide.Img4[(Slide.Showing - 0)],Left3 - Slide.ImageSize.Width + 4,Top3 * 3,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
  2093. end;
  2094. end;
  2095. if Slide.Effect = 9 then
  2096. begin
  2097. ImgGetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top,Width,Height);
  2098. Left:= SldPosX(Slide,Left);
  2099. Top:= SldPosY(Slide,Top);
  2100. ImgGetVisiblePart(Slide.Img2[(Slide.Showing - 1)],Left3,Top3,Width3,Height3);
  2101. Left3:= SldPosX(Slide,Left3);
  2102. Top3:= SldPosY(Slide,Top3);
  2103. if ((Slide.Showing + 1) = Slide.Count) and ((Top + Slide.ImageSize.Height) <> 0) then
  2104. begin
  2105. ImgGetVisiblePart(Slide.Img[0],Left2,Top2,Width2,Height2);
  2106. Left2:= SldPosX(Slide,Left2);
  2107. Top2:= SldPosY(Slide,Top2);
  2108. ImgGetVisiblePart(Slide.Img2[0],Left4,Top4,Width4,Height4);
  2109. Left4:= SldPosX(Slide,Left4);
  2110. Top4:= SldPosY(Slide,Top4);
  2111. ImgSetVisiblePart(Slide.Img[0],Left2,Top2 - 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
  2112. ImgSetVisiblePart(Slide.Img2[0],Left4 * 1,Top4 + 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
  2113. ImgSetVisiblePart(Slide.Img3[0],Left4 * 2,Top2 - 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
  2114. ImgSetVisiblePart(Slide.Img4[0],Left4 * 3,Top4 + 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
  2115. end;
  2116. if (Top + Slide.ImageSize.Height) <> 0 then
  2117. begin
  2118. ImgSetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top - 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
  2119. ImgSetVisiblePart(Slide.Img[(Slide.Showing - 0)],Left,Top + Slide.ImageSize.Height - 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
  2120. ImgSetVisiblePart(Slide.Img2[(Slide.Showing - 1)],Left3 * 1,Top3 + 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
  2121. ImgSetVisiblePart(Slide.Img2[(Slide.Showing - 0)],Left3 * 1,Top3 - Slide.ImageSize.Height + 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
  2122. ImgSetVisiblePart(Slide.Img3[(Slide.Showing - 1)],Left3 * 2,Top - 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
  2123. ImgSetVisiblePart(Slide.Img3[(Slide.Showing - 0)],Left3 * 2,Top + Slide.ImageSize.Height - 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
  2124. ImgSetVisiblePart(Slide.Img4[(Slide.Showing - 1)],Left3 * 3,Top3 + 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
  2125. ImgSetVisiblePart(Slide.Img4[(Slide.Showing - 0)],Left3 * 3,Top3 - Slide.ImageSize.Height + 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
  2126. end;
  2127. end;
  2128. ImgApplyChanges(Slide.Parent.Handle);
  2129. end;
  2130.  
  2131. procedure SldTimer3(var Slide: TCusSld);
  2132. begin
  2133. Slide.Tmr3.Enabled:=False;
  2134. Slide.Tmr.Enabled:=True;
  2135. if Slide.Tmr2.Enabled then
  2136. begin
  2137. if Slide.Showing < Slide.Count then
  2138. Slide.Showing:=Slide.Showing + 1;
  2139. if Slide.Showing = Slide.Count then
  2140. Slide.Showing:=1;
  2141. if (Slide.Showing + 1) = Slide.Count then
  2142. begin
  2143. if Slide.Effect = 0 then
  2144. ImgSetVisibility(Slide.Img[0],True);
  2145. if Slide.Effect = 1 then
  2146. ImgSetTransparent(Slide.Img[0],255);
  2147. if Slide.Effect = 2 then
  2148. ImgSetVisiblePart(Slide.Img[0],-(Slide.ImageSize.Width),0,Slide.ImageSize.Width,Slide.ImageSize.Height);
  2149. if Slide.Effect = 3 then
  2150. ImgSetVisiblePart(Slide.Img[0],Slide.ImageSize.Width,0,Slide.ImageSize.Width,Slide.ImageSize.Height);
  2151. if Slide.Effect = 4 then
  2152. ImgSetVisiblePart(Slide.Img[0],0,-(Slide.ImageSize.Height),Slide.ImageSize.Width,Slide.ImageSize.Height);
  2153. if Slide.Effect = 5 then
  2154. ImgSetVisiblePart(Slide.Img[0],0,Slide.ImageSize.Height,Slide.ImageSize.Width,Slide.ImageSize.Height);
  2155. if Slide.Effect = 6 then
  2156. begin
  2157. ImgSetVisiblePart(Slide.Img[0],Slide.ImageSize.Width,0,Slide.ImageSize.Width,Slide.ImageSize.Height / 2);
  2158. ImgSetVisiblePart(Slide.Img2[0],-(Slide.ImageSize.Width),Slide.ImageSize.Height / 2,Slide.ImageSize.Width,Slide.ImageSize.Height / 2);
  2159. end;
  2160. if Slide.Effect = 7 then
  2161. begin
  2162. ImgSetVisiblePart(Slide.Img[0],0,Slide.ImageSize.Height,Slide.ImageSize.Width / 2,Slide.ImageSize.Height);
  2163. ImgSetVisiblePart(Slide.Img2[0],Slide.ImageSize.Width / 2,-(Slide.ImageSize.Height),Slide.ImageSize.Width / 2,Slide.ImageSize.Height);
  2164. end;
  2165. if Slide.Effect = 8 then
  2166. begin
  2167. ImgSetVisiblePart(Slide.Img[0],Slide.ImageSize.Width,0,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
  2168. ImgSetVisiblePart(Slide.Img2[0],-(Slide.ImageSize.Width),Slide.ImageSize.Height / 4 * 1,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
  2169. ImgSetVisiblePart(Slide.Img3[0],Slide.ImageSize.Width,Slide.ImageSize.Height / 4 * 2,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
  2170. ImgSetVisiblePart(Slide.Img4[0],-(Slide.ImageSize.Width),Slide.ImageSize.Height / 4 * 3,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
  2171. end;
  2172. if Slide.Effect = 9 then
  2173. begin
  2174. ImgSetVisiblePart(Slide.Img[0],0,Slide.ImageSize.Height,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
  2175. ImgSetVisiblePart(Slide.Img2[0],Slide.ImageSize.Width / 4 * 1,-(Slide.ImageSize.Height),Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
  2176. ImgSetVisiblePart(Slide.Img3[0],Slide.ImageSize.Width / 4 * 2,Slide.ImageSize.Height,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
  2177. ImgSetVisiblePart(Slide.Img4[0],Slide.ImageSize.Width / 4 * 3,-(Slide.ImageSize.Height),Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
  2178. end;
  2179. end;
  2180. ImgApplyChanges(Slide.Parent.Handle);
  2181. end else
  2182. Slide.Tmr2.Enabled:=True;
  2183. end;
  2184.  
  2185. procedure SldOnTimer(Sender: TObject);
  2186. begin
  2187. case Sender of
  2188. #ifdef AppExe1
  2189. Launch1Tile.Slide.Tmr: SldTimer(Launch1Tile.Slide);
  2190. #ifdef AppExe2
  2191. Launch2Tile.Slide.Tmr: SldTimer(Launch2Tile.Slide);
  2192. #ifdef AppExe3
  2193. Launch3Tile.Slide.Tmr: SldTimer(Launch3Tile.Slide);
  2194. #ifdef AppExe4
  2195. Launch4Tile.Slide.Tmr: SldTimer(Launch4Tile.Slide);
  2196. #ifdef AppExe5
  2197. Launch5Tile.Slide.Tmr: SldTimer(Launch5Tile.Slide);
  2198. #ifdef AppExe6
  2199. Launch6Tile.Slide.Tmr: SldTimer(Launch6Tile.Slide);
  2200. #endif
  2201. #endif
  2202. #endif
  2203. #endif
  2204. #endif
  2205. #endif
  2206. AutorunSlide.Tmr: SldTimer(AutorunSlide);
  2207. WizardSlide.Tmr: SldTimer(WizardSlide);
  2208. end;
  2209. end;
  2210.  
  2211. procedure SldOnTimer2(Sender: TObject);
  2212. begin
  2213. case Sender of
  2214. #ifdef AppExe1
  2215. Launch1Tile.Slide.Tmr2: SldTimer2(Launch1Tile.Slide);
  2216. #ifdef AppExe2
  2217. Launch2Tile.Slide.Tmr2: SldTimer2(Launch2Tile.Slide);
  2218. #ifdef AppExe3
  2219. Launch3Tile.Slide.Tmr2: SldTimer2(Launch3Tile.Slide);
  2220. #ifdef AppExe4
  2221. Launch4Tile.Slide.Tmr2: SldTimer2(Launch4Tile.Slide);
  2222. #ifdef AppExe5
  2223. Launch5Tile.Slide.Tmr2: SldTimer2(Launch5Tile.Slide);
  2224. #ifdef AppExe6
  2225. Launch6Tile.Slide.Tmr2: SldTimer2(Launch6Tile.Slide);
  2226. #endif
  2227. #endif
  2228. #endif
  2229. #endif
  2230. #endif
  2231. #endif
  2232. AutorunSlide.Tmr2: SldTimer2(AutorunSlide);
  2233. WizardSlide.Tmr2: SldTimer2(WizardSlide);
  2234. end;
  2235. end;
  2236.  
  2237. procedure SldOnTimer3(Sender: TObject);
  2238. begin
  2239. case Sender of
  2240. #ifdef AppExe1
  2241. Launch1Tile.Slide.Tmr3: SldTimer3(Launch1Tile.Slide);
  2242. #ifdef AppExe2
  2243. Launch2Tile.Slide.Tmr3: SldTimer3(Launch2Tile.Slide);
  2244. #ifdef AppExe3
  2245. Launch3Tile.Slide.Tmr3: SldTimer3(Launch3Tile.Slide);
  2246. #ifdef AppExe4
  2247. Launch4Tile.Slide.Tmr3: SldTimer3(Launch4Tile.Slide);
  2248. #ifdef AppExe5
  2249. Launch5Tile.Slide.Tmr3: SldTimer3(Launch5Tile.Slide);
  2250. #ifdef AppExe6
  2251. Launch6Tile.Slide.Tmr3: SldTimer3(Launch6Tile.Slide);
  2252. #endif
  2253. #endif
  2254. #endif
  2255. #endif
  2256. #endif
  2257. #endif
  2258. AutorunSlide.Tmr3: SldTimer3(AutorunSlide);
  2259. WizardSlide.Tmr3: SldTimer3(WizardSlide);
  2260. end;
  2261. end;
  2262.  
  2263. function SlideCreate(hParent :TWinControl; ImgDir, ImgSfx: String; hImgTime, hLeft, hTop, hWidth, hHeight: Longint; hRTime: Boolean; hEffect: Integer): TCusSld;
  2264. var
  2265. x: Integer;
  2266. begin
  2267. if hEffect = 10 then
  2268. hEffect:=Random(10);
  2269. Result.Parent:=hParent;
  2270. Result.Effect:=hEffect;
  2271. Result.Left:=hLeft;
  2272. Result.Top:=hTop;
  2273. Result.Width:=hWidth;
  2274. Result.Height:=hHeight;
  2275. Result.ImageSize:=GetPictureSize(ImgDir + IntToStr(1) + ImgSfx);
  2276. x:=0;
  2277. repeat
  2278. x:= x + 1;
  2279. until FileExists(ImgDir + IntToStr(x) + ImgSfx) = False;
  2280. Result.Count:=x;
  2281. SetArrayLength(Result.Img,x + 1);
  2282. SetArrayLength(Result.Img2,x + 1);
  2283. SetArrayLength(Result.Img3,x + 1);
  2284. SetArrayLength(Result.Img4,x + 1);
  2285. x:=0;
  2286. repeat
  2287. x:= x + 1;
  2288. if x = 1 then
  2289. begin
  2290. if hEffect < 6 then
  2291. begin
  2292. Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth,hHeight,True,True);
  2293. ImgSetVisiblePart(Result.Img[x - 1],0,0,Result.ImageSize.Width,Result.ImageSize.Height);
  2294. end else begin
  2295. if hEffect = 6 then
  2296. begin
  2297. Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth,hHeight / 2,True,True);
  2298. Result.Img2[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop + (hHeight / 2),hWidth,hHeight / 2,True,True);
  2299. ImgSetVisiblePart(Result.Img[x - 1],0,0,Result.ImageSize.Width,Result.ImageSize.Height / 2);
  2300. ImgSetVisiblePart(Result.Img2[x - 1],0,Result.ImageSize.Height / 2,Result.ImageSize.Width,Result.ImageSize.Height / 2);
  2301. end;
  2302. if hEffect = 7 then
  2303. begin
  2304. Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth / 2,hHeight,True,True);
  2305. Result.Img2[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft + (hWidth / 2),hTop,hWidth / 2,hHeight,True,True);
  2306. ImgSetVisiblePart(Result.Img[x - 1],0,0,Result.ImageSize.Width / 2,Result.ImageSize.Height);
  2307. ImgSetVisiblePart(Result.Img2[x - 1],Result.ImageSize.Width / 2,0,Result.ImageSize.Width / 2,Result.ImageSize.Height);
  2308. end;
  2309. if hEffect = 8 then
  2310. begin
  2311. Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth,hHeight / 4,True,True);
  2312. Result.Img2[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop + (hHeight / 4 * 1),hWidth,hHeight / 4,True,True);
  2313. Result.Img3[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop + (hHeight / 4 * 2),hWidth,hHeight / 4,True,True);
  2314. Result.Img4[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop + (hHeight / 4 * 3),hWidth,hHeight / 4,True,True);
  2315. ImgSetVisiblePart(Result.Img[x - 1],0,0,Result.ImageSize.Width,Result.ImageSize.Height / 4);
  2316. ImgSetVisiblePart(Result.Img2[x - 1],0,Result.ImageSize.Height / 4 * 1,Result.ImageSize.Width,Result.ImageSize.Height / 4);
  2317. ImgSetVisiblePart(Result.Img3[x - 1],0,Result.ImageSize.Height / 4 * 2,Result.ImageSize.Width,Result.ImageSize.Height / 4);
  2318. ImgSetVisiblePart(Result.Img4[x - 1],0,Result.ImageSize.Height / 4 * 3,Result.ImageSize.Width,Result.ImageSize.Height / 4);
  2319. end;
  2320. if hEffect = 9 then
  2321. begin
  2322. Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth / 4,hHeight,True,True);
  2323. Result.Img2[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft + (hWidth / 4 * 1),hTop,hWidth / 4,hHeight,True,True);
  2324. Result.Img3[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft + (hWidth / 4 * 2),hTop,hWidth / 4,hHeight,True,True);
  2325. Result.Img4[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft + (hWidth / 4 * 3),hTop,hWidth / 4,hHeight,True,True);
  2326. ImgSetVisiblePart(Result.Img[x - 1],0,0,Result.ImageSize.Width / 4,Result.ImageSize.Height);
  2327. ImgSetVisiblePart(Result.Img2[x - 1],Result.ImageSize.Width / 4 * 1,0,Result.ImageSize.Width / 4,Result.ImageSize.Height);
  2328. ImgSetVisiblePart(Result.Img3[x - 1],Result.ImageSize.Width / 4 * 2,0,Result.ImageSize.Width / 4,Result.ImageSize.Height);
  2329. ImgSetVisiblePart(Result.Img4[x - 1],Result.ImageSize.Width / 4 * 3,0,Result.ImageSize.Width / 4,Result.ImageSize.Height);
  2330. end;
  2331. end;
  2332. end else begin
  2333. if hEffect = 0 then
  2334. begin
  2335. Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth,hHeight,True,True);
  2336. ImgSetVisiblePart(Result.Img[x - 1],0,0,Result.ImageSize.Width,Result.ImageSize.Height);
  2337. ImgSetVisibility(Result.Img[x - 1],False);
  2338. end;
  2339. if hEffect = 1 then
  2340. begin
  2341. Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth,hHeight,True,True);
  2342. ImgSetVisiblePart(Result.Img[x - 1],0,0,Result.ImageSize.Width,Result.ImageSize.Height);
  2343. ImgSetTransparent(Result.Img[x - 1],0);
  2344. end;
  2345. if hEffect = 2 then
  2346. begin
  2347. Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth,hHeight,True,True);
  2348. ImgSetVisiblePart(Result.Img[x - 1],-(Result.ImageSize.Width),0,Result.ImageSize.Width,Result.ImageSize.Height);
  2349. end;
  2350. if hEffect = 3 then
  2351. begin
  2352. Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth,hHeight,True,True);
  2353. ImgSetVisiblePart(Result.Img[x - 1],(Result.ImageSize.Width),0,Result.ImageSize.Width,Result.ImageSize.Height);
  2354. end;
  2355. if hEffect = 4 then
  2356. begin
  2357. Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth,hHeight,True,True);
  2358. ImgSetVisiblePart(Result.Img[x - 1],0,-(Result.ImageSize.Height),Result.ImageSize.Width,Result.ImageSize.Height);
  2359. end;
  2360. if hEffect = 5 then
  2361. begin
  2362. Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth,hHeight,True,True);
  2363. ImgSetVisiblePart(Result.Img[x - 1],0,(Result.ImageSize.Height),Result.ImageSize.Width,Result.ImageSize.Height);
  2364. end;
  2365. if hEffect = 6 then
  2366. begin
  2367. Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth,hHeight / 2,True,True);
  2368. Result.Img2[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop + (hHeight / 2),hWidth,hHeight / 2,True,True);
  2369. ImgSetVisiblePart(Result.Img[x - 1],(Result.ImageSize.Width),0,Result.ImageSize.Width,Result.ImageSize.Height / 2);
  2370. ImgSetVisiblePart(Result.Img2[x - 1],-(Result.ImageSize.Width),Result.ImageSize.Height / 2,Result.ImageSize.Width,Result.ImageSize.Height / 2);
  2371. end;
  2372. if hEffect = 7 then
  2373. begin
  2374. Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth / 2,hHeight,True,True);
  2375. Result.Img2[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft + (hWidth / 2),hTop,hWidth / 2,hHeight,True,True);
  2376. ImgSetVisiblePart(Result.Img[x - 1],0,(Result.ImageSize.Height),Result.ImageSize.Width / 2,Result.ImageSize.Height);
  2377. ImgSetVisiblePart(Result.Img2[x - 1],Result.ImageSize.Width / 2,-(Result.ImageSize.Height),Result.ImageSize.Width / 2,Result.ImageSize.Height);
  2378. end;
  2379. if hEffect = 8 then
  2380. begin
  2381. Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth,hHeight / 4,True,True);
  2382. Result.Img2[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop + (hHeight / 4) * 1,hWidth,hHeight / 4,True,True);
  2383. Result.Img3[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop + (hHeight / 4) * 2,hWidth,hHeight / 4,True,True);
  2384. Result.Img4[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop + (hHeight / 4) * 3,hWidth,hHeight / 4,True,True);
  2385. ImgSetVisiblePart(Result.Img[x - 1],(Result.ImageSize.Width),0,Result.ImageSize.Width,Result.ImageSize.Height / 4);
  2386. ImgSetVisiblePart(Result.Img2[x - 1],-(Result.ImageSize.Width),Result.ImageSize.Height / 4 * 1,Result.ImageSize.Width,Result.ImageSize.Height / 4);
  2387. ImgSetVisiblePart(Result.Img3[x - 1],(Result.ImageSize.Width),Result.ImageSize.Height / 4 * 2,Result.ImageSize.Width,Result.ImageSize.Height / 4);
  2388. ImgSetVisiblePart(Result.Img4[x - 1],-(Result.ImageSize.Width),Result.ImageSize.Height / 4 * 3,Result.ImageSize.Width,Result.ImageSize.Height / 4);
  2389. end;
  2390. if hEffect = 9 then
  2391. begin
  2392. Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth / 4,hHeight,True,True);
  2393. Result.Img2[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft + (hWidth / 4) * 1,hTop,hWidth / 4,hHeight,True,True);
  2394. Result.Img3[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft + (hWidth / 4) * 2,hTop,hWidth / 4,hHeight,True,True);
  2395. Result.Img4[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft + (hWidth / 4) * 3,hTop,hWidth / 4,hHeight,True,True);
  2396. ImgSetVisiblePart(Result.Img[x - 1],0,(Result.ImageSize.Height),Result.ImageSize.Width / 4,Result.ImageSize.Height);
  2397. ImgSetVisiblePart(Result.Img2[x - 1],Result.ImageSize.Width / 4 * 1,-(Result.ImageSize.Height),Result.ImageSize.Width / 4,Result.ImageSize.Height);
  2398. ImgSetVisiblePart(Result.Img3[x - 1],Result.ImageSize.Width / 4 * 2,(Result.ImageSize.Height),Result.ImageSize.Width / 4,Result.ImageSize.Height);
  2399. ImgSetVisiblePart(Result.Img4[x - 1],Result.ImageSize.Width / 4 * 3,-(Result.ImageSize.Height),Result.ImageSize.Width / 4,Result.ImageSize.Height);
  2400. end;
  2401. end;
  2402. until Result.Count = x;
  2403. Result.Showing:=1;
  2404. Result.Tmr:= TTimer.Create(hParent);
  2405. with Result.Tmr do
  2406. begin
  2407. Interval:=hImgTime;
  2408. OnTimer:=@SldOnTimer;
  2409. if hRTime then
  2410. Enabled:=False
  2411. else
  2412. Enabled:=True;
  2413. end;
  2414. Result.Tmr2:= TTimer.Create(hParent);
  2415. with Result.Tmr2 do
  2416. begin
  2417. Interval:=1;
  2418. OnTimer:=@SldOnTimer2;
  2419. Enabled:=False;
  2420. end;
  2421. if hRTime then
  2422. begin
  2423. Result.Tmr3:= TTimer.Create(hParent);
  2424. with Result.Tmr3 do
  2425. begin
  2426. Interval:=Random(hImgTime / 1000) * 1000;
  2427. OnTimer:=@SldOnTimer3;
  2428. Enabled:=True;
  2429. end;
  2430. end;
  2431. ImgApplyChanges(hParent.Handle);
  2432. end;
  2433.  
  2434. procedure TleTimer(var Tile: TCusTle);
  2435. begin
  2436. if Tile.Startup.Visible then
  2437. Tile.Timer:=Tile.Timer - 25;
  2438. if (Tile.Timer = 0) and (Tile.Startup.Visible = True) then
  2439. begin
  2440. Tile.Startup.Visible:=False;
  2441. Tile.Event(0);
  2442. end;
  2443. end;
  2444.  
  2445. procedure TleClick(var Tile: TCusTle);
  2446. var
  2447. x: Integer;
  2448. begin
  2449. Tile.Startup.BringToFront;
  2450. Tile.Timer:=20000;
  2451. for x:=0 to 4 do
  2452. Tile.AniBar.Dots[x].BringToFront;
  2453. Tile.Startup.Visible:=True;
  2454. //AniSetEnabled(Tile.AniBar,True);
  2455. end;
  2456.  
  2457. procedure TleMouseDown(var Tile: TCusTle);
  2458. begin
  2459. ReleaseCapture;
  2460. SendMessage(Tile.Base.Handle,$0112,$F012,0);
  2461. end;
  2462.  
  2463. procedure TleOnTimer(Sender: TObject);
  2464. begin
  2465. case Sender of
  2466. #ifdef AppExe1
  2467. Launch1Tile.Tmr: TleTimer(Launch1Tile);
  2468. #ifdef AppExe2
  2469. Launch2Tile.Tmr: TleTimer(Launch2Tile);
  2470. #ifdef AppExe3
  2471. Launch3Tile.Tmr: TleTimer(Launch3Tile);
  2472. #ifdef AppExe4
  2473. Launch4Tile.Tmr: TleTimer(Launch4Tile);
  2474. #ifdef AppExe5
  2475. Launch5Tile.Tmr: TleTimer(Launch5Tile);
  2476. #ifdef AppExe6
  2477. Launch6Tile.Tmr: TleTimer(Launch6Tile);
  2478. #endif
  2479. #endif
  2480. #endif
  2481. #endif
  2482. #endif
  2483. #endif
  2484. end;
  2485. ImgApplyChanges(AutorunForm.Handle);
  2486. end;
  2487.  
  2488. procedure TleOnClick(Sender: TObject);
  2489. begin
  2490. case Sender of
  2491. #ifdef AppExe1
  2492. Launch1Tile.Base: TleClick(Launch1Tile);
  2493. Launch1Tile.Labl: TleClick(Launch1Tile);
  2494. #ifdef AppExe2
  2495. Launch2Tile.Base: TleClick(Launch2Tile);
  2496. Launch2Tile.Labl: TleClick(Launch2Tile);
  2497. #ifdef AppExe3
  2498. Launch3Tile.Base: TleClick(Launch3Tile);
  2499. Launch3Tile.Labl: TleClick(Launch3Tile);
  2500. #ifdef AppExe4
  2501. Launch4Tile.Base: TleClick(Launch4Tile);
  2502. Launch4Tile.Labl: TleClick(Launch4Tile);
  2503. #ifdef AppExe5
  2504. Launch5Tile.Base: TleClick(Launch5Tile);
  2505. Launch5Tile.Labl: TleClick(Launch5Tile);
  2506. #ifdef AppExe6
  2507. Launch6Tile.Base: TleClick(Launch6Tile);
  2508. Launch6Tile.Labl: TleClick(Launch6Tile);
  2509. #endif
  2510. #endif
  2511. #endif
  2512. #endif
  2513. #endif
  2514. #endif
  2515. end;
  2516. end;
  2517.  
  2518. procedure TlcOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  2519. begin
  2520. case Sender of
  2521. InstallTile.Base: TleMouseDown(InstallTile);
  2522. InstallTile.Labl: TleMouseDown(InstallTile);
  2523. UninstallTile.Base: TleMouseDown(UninstallTile);
  2524. UninstallTile.Labl: TleMouseDown(UninstallTile);
  2525. ExitTile.Base: TleMouseDown(ExitTile);
  2526. ExitTile.Labl: TleMouseDown(ExitTile);
  2527. #ifdef AppExe1
  2528. Launch1Tile.Base: TleMouseDown(Launch1Tile);
  2529. Launch1Tile.Labl: TleMouseDown(Launch1Tile);
  2530. #ifdef AppExe2
  2531. Launch2Tile.Base: TleMouseDown(Launch2Tile);
  2532. Launch2Tile.Labl: TleMouseDown(Launch2Tile);
  2533. #ifdef AppExe3
  2534. Launch3Tile.Base: TleMouseDown(Launch3Tile);
  2535. Launch3Tile.Labl: TleMouseDown(Launch3Tile);
  2536. #ifdef AppExe4
  2537. Launch4Tile.Base: TleMouseDown(Launch4Tile);
  2538. Launch4Tile.Labl: TleMouseDown(Launch4Tile);
  2539. #ifdef AppExe5
  2540. Launch5Tile.Base: TleMouseDown(Launch5Tile);
  2541. Launch5Tile.Labl: TleMouseDown(Launch5Tile);
  2542. #ifdef AppExe6
  2543. Launch6Tile.Base: TleMouseDown(Launch6Tile);
  2544. Launch6Tile.Labl: TleMouseDown(Launch6Tile);
  2545. #endif
  2546. #endif
  2547. #endif
  2548. #endif
  2549. #endif
  2550. #endif
  2551. end;
  2552. end;
  2553.  
  2554. procedure TileSetEvent(var Tile: TCusTle; Event: TNotifyEvent);
  2555. begin
  2556. if Tile.Animation then
  2557. Tile.Event:=Event
  2558. else begin
  2559. Tile.Labl.OnClick:=Event;
  2560. Tile.Base.OnClick:=Event;
  2561. end;
  2562. end;
  2563.  
  2564. procedure TileModal(var Tile: TCusTle);
  2565. begin
  2566. Tile.ModalBtn.Click;
  2567. end;
  2568.  
  2569. function TileCreate(hParent :TWinControl; hLeft, hTop, hWidth, hHeight: Integer; hImg, hText: String; Modal: Integer; hAnimation: Boolean): TCusTle;
  2570. begin
  2571. Result.StartInfo:=hImg;
  2572. Result.Animation:=hAnimation;
  2573. Result.Timer:=10000;
  2574. Result.Base:= TListView.Create(hParent);
  2575. with Result.Base do
  2576. begin
  2577. Parent:=hParent;
  2578. Left:=hLeft;
  2579. Top:=hTop;
  2580. Width:=hWidth;
  2581. Height:=hHeight;
  2582. Color:=MetroColor(CurCol);
  2583. OnClick:=@TleOnClick;
  2584. end;
  2585. if hImg <> '' then
  2586. begin
  2587. if hAnimation then
  2588. begin
  2589. #ifdef Image
  2590. if FileExists(hImg + '_Icon2.png') then
  2591. Result.Slide:=SlideCreate(Result.Base,PAnsiChar(hImg) + '_Icon','.png',10000, 0, 0, hWidth, hHeight,True,SlideAuto)
  2592. else
  2593. Result.MImg:=ImgLoad(Result.Base.Handle, PAnsiChar(hImg + '_Icon1.png'), 2, 2, hWidth - 8, hHeight - 8, True, True);
  2594. #endif
  2595. end else begin
  2596. Result.MImg:=ImgLoad(Result.Base.Handle, PAnsiChar(hImg), 2, 2, hWidth - 8, hHeight - 8, True, True);
  2597. end;
  2598. ImgApplyChanges(Result.Base.Handle);
  2599. end;
  2600.  
  2601. Result.Labl:= TLabel.Create(Result.Base);
  2602. with Result.Labl do
  2603. begin
  2604. Parent:=Result.Base;
  2605. Autosize:= False;
  2606. Left:=4;
  2607. Top:=4;
  2608. Width:=hWidth - 8;
  2609. Height:=hHeight - 12;
  2610. Alignment:= taLeftJustify;
  2611. Layout:= tlBottom;
  2612. with Font do
  2613. begin
  2614. Name:='Segoe UI SemiBold';
  2615. Size:=9;
  2616. Color:=$FFFFFF;
  2617. end;
  2618. Caption:=hText;
  2619. OnClick:=@TleOnClick;
  2620. end;
  2621.  
  2622. if hAnimation then
  2623. begin
  2624. Result.Tmr:= TTimer.Create(hParent);
  2625. with Result.Tmr do
  2626. begin
  2627. OnTimer:=@TleOnTimer;
  2628. Interval:=10;
  2629. Enabled:=True;
  2630. end;
  2631.  
  2632. Result.Startup:= TListView.Create(hParent);
  2633. with Result.Startup do
  2634. begin
  2635. Parent:=hParent;
  2636. Left:=0;
  2637. Top:=0;
  2638. Width:=hParent.Width;
  2639. Height:=hParent.Height;
  2640. Color:=MetroColor(CurCol);
  2641. Visible:=False;
  2642. end;
  2643.  
  2644. Result.Labl2:= TLabel.Create(Result.Startup);
  2645. with Result.Labl2 do
  2646. begin
  2647. Parent:=Result.Startup;
  2648. Autosize:= False;
  2649. Left:=4;
  2650. Top:=4;
  2651. Width:=hParent.Width - 8;
  2652. Height:=hParent.Height - 20;
  2653. Alignment:= taCenter;
  2654. Layout:= tlBottom;
  2655. with Font do
  2656. begin
  2657. Name:='Segoe UI Light';
  2658. Size:=27;
  2659. Color:=$FFFFFF;
  2660. end;
  2661. Caption:=hText;
  2662. end;
  2663. #ifdef Image
  2664. ImgLoad(Result.Startup.Handle, PAnsiChar(hImg) + '_Background.jpg', 0, 0, hParent.Width - 4, hParent.Height - 4, True, True);
  2665. #ifdef Dark
  2666. ImgLoad(Result.Startup.Handle,ExpandConstant('{tmp}\Dark.png'),0,0,AutorunForm.ClientWidth,AutorunForm.ClientHeight,True,True);
  2667. #else
  2668. ImgLoad(Result.Startup.Handle,ExpandConstant('{tmp}\Light.png'),0,0,AutorunForm.ClientWidth,AutorunForm.ClientHeight,True,True);
  2669. #endif
  2670. Result.AniBar:= AniCreate(Result.Startup,0,0,hParent.Width,4,False);
  2671. #else
  2672. Result.AniBar:= AniCreate(Result.Startup,0,0,hParent.Width,4,True);
  2673. #endif
  2674. //AniSetEnabled(Result.AniBar,False);
  2675. ImgApplyChanges(Result.Startup.Handle);
  2676. end;
  2677.  
  2678. Result.ModalBtn:= TButton.Create(hParent);
  2679. with Result.ModalBtn do
  2680. begin
  2681. SetBounds(0,0,0,0);
  2682. ModalResult:=Modal;
  2683. Parent:= hParent;
  2684. end;
  2685. end;
  2686.  
  2687. procedure LockDeactivate(Sender: TObject);forward;
  2688.  
  2689. procedure LockOnKeyDown(var Lock: TCusLck);
  2690. begin
  2691. Lock.Dirct:= 'Up';
  2692. end;
  2693.  
  2694. procedure LockOnDeactivate(var Lock: TCusLck);
  2695. begin
  2696. Lock.Dirct:='Down'
  2697. end;
  2698.  
  2699. procedure LockOnActivate(var Lock: TCusLck);
  2700. begin
  2701. if Lock.Locked = False then
  2702. Application.OnDeactivate:=@LockDeactivate;
  2703. Lock.Locked:=True;
  2704. end;
  2705.  
  2706. procedure LockOnFocus(var Lock: TCusLck);
  2707. begin
  2708. ReleaseCapture;
  2709. SendMessage(Lock.Parent.Handle,$0112,$F012,0);
  2710. Lock.Tile.SetFocus;
  2711. end;
  2712.  
  2713. function LockPosY(var Lock: TCusLck; hValue: Longint):Longint;
  2714. begin
  2715. Result:=hValue;
  2716. case hValue of
  2717. -1: Result:=hValue - 7;
  2718. -2: Result:=hValue - 6;
  2719. -3: Result:=hValue - 5;
  2720. -4: Result:=hValue - 4;
  2721. -5: Result:=hValue - 3;
  2722. -6: Result:=hValue - 2;
  2723. -7: Result:=hValue - 1;
  2724. end;
  2725. case hValue of
  2726. 1: Result:=hValue + 7;
  2727. 2: Result:=hValue + 6;
  2728. 3: Result:=hValue + 5;
  2729. 4: Result:=hValue + 4;
  2730. 5: Result:=hValue + 3;
  2731. 6: Result:=hValue + 2;
  2732. 7: Result:=hValue + 1;
  2733. end;
  2734. case hValue of
  2735. Lock.Tile.Height - 1: Result:=hValue - 7;
  2736. Lock.Tile.Height - 2: Result:=hValue - 6;
  2737. Lock.Tile.Height - 3: Result:=hValue - 5;
  2738. Lock.Tile.Height - 4: Result:=hValue - 4;
  2739. Lock.Tile.Height - 5: Result:=hValue - 3;
  2740. Lock.Tile.Height - 6: Result:=hValue - 2;
  2741. Lock.Tile.Height - 7: Result:=hValue - 1;
  2742. end;
  2743. case hValue of
  2744. -(Lock.Tile.Height) + 1: Result:=hValue + 7;
  2745. -(Lock.Tile.Height) + 2: Result:=hValue + 6;
  2746. -(Lock.Tile.Height) + 3: Result:=hValue + 5;
  2747. -(Lock.Tile.Height) + 4: Result:=hValue + 4;
  2748. -(Lock.Tile.Height) + 5: Result:=hValue + 3;
  2749. -(Lock.Tile.Height) + 6: Result:=hValue + 2;
  2750. -(Lock.Tile.Height) + 7: Result:=hValue + 1;
  2751. end;
  2752. end;
  2753.  
  2754. procedure LockOnTimer(var Lock: TCusLck);
  2755. begin
  2756. Lock.LTime.Caption:=MetroTime;
  2757. Lock.LDate.Caption:=MetroDate;
  2758. if not (Lock.Tile.Top = -(Lock.Tile.Height)) then
  2759. begin
  2760. if Lock.Labl.Top > (Lock.Parent.ClientHeight - 40) then
  2761. Lock.Labl.Top:=Lock.Labl.Top - 1;
  2762. if (Lock.Dirct = 'Up') then
  2763. Lock.Tile.Top:=LockPosY(Lock,Lock.Tile.Top) - 8;
  2764. end;
  2765. if not (Lock.Tile.Top = 0) then
  2766. begin
  2767. if Lock.Labl.Top < (Lock.Parent.ClientHeight + 60) then
  2768. Lock.Labl.Top:=Lock.Labl.Top + 1;
  2769. if (Lock.Dirct = 'Down') then
  2770. Lock.Tile.Top:=LockPosY(Lock,Lock.Tile.Top) + 8;
  2771. end;
  2772. end;
  2773.  
  2774. procedure LockKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
  2775. begin
  2776. if Key = 38 then
  2777. begin
  2778. case Sender of
  2779. AutorunLock.Tile: LockOnKeyDown(AutorunLock);
  2780. WizardLock.Tile: LockOnKeyDown(WizardLock);
  2781. end;
  2782. end;
  2783. end;
  2784.  
  2785. procedure LockDeactivate(Sender: TObject);
  2786. begin
  2787. case Sender of
  2788. Application:
  2789. begin
  2790. LockOnDeactivate(AutorunLock);
  2791. LockOnDeactivate(WizardLock);
  2792. end;
  2793. end;
  2794. end;
  2795.  
  2796. procedure LockActivate(Sender: TObject);
  2797. begin
  2798. case Sender of
  2799. Application:
  2800. begin
  2801. LockOnActivate(AutorunLock);
  2802. LockOnActivate(WizardLock);
  2803. end;
  2804. end;
  2805. end;
  2806.  
  2807. procedure LockFocus(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  2808. begin
  2809. case Sender of
  2810. AutorunLock.Tile: LockOnFocus(AutorunLock);
  2811. AutorunLock.LTime: LockOnFocus(AutorunLock);
  2812. AutorunLock.LDate: LockOnFocus(AutorunLock);
  2813. AutorunLock.Labl: LockOnFocus(AutorunLock);
  2814. WizardLock.Tile: LockOnFocus(WizardLock);
  2815. WizardLock.LTime: LockOnFocus(WizardLock);
  2816. WizardLock.LDate: LockOnFocus(WizardLock);
  2817. WizardLock.Labl: LockOnFocus(WizardLock);
  2818. end;
  2819. end;
  2820.  
  2821. procedure LockTimer(Sender: TObject);
  2822. begin
  2823. case Sender of
  2824. AutorunLock.Tmr: LockOnTimer(AutorunLock);
  2825. WizardLock.Tmr: LockOnTimer(WizardLock);
  2826. end;
  2827. end;
  2828.  
  2829. (*function LockCreate(hParent :TSetupForm; hImg: String; hLock: Boolean): TCusLck;
  2830. begin
  2831. Result.Parent:=hParent;
  2832. Result.Tile:=TListView.Create(hParent);
  2833. Result.Locked:=hLock;
  2834. with Result.Tile do
  2835. begin
  2836. Parent:=hParent;
  2837. Left:=0;
  2838. if hLock then
  2839. Top:=0
  2840. else
  2841. Top:=-(hParent.ClientHeight);
  2842. Width:=hParent.ClientWidth;
  2843. Height:=hParent.ClientHeight;
  2844. Color:=MetroColor(CurCol);
  2845. OnKeyDown:=@LockKeyDown;
  2846. OnMouseDown:=@LockFocus;
  2847. end;
  2848.  
  2849. if hLock then
  2850. Application.OnDeactivate:=@LockDeactivate
  2851. else
  2852. Application.OnDeactivate:=nil;
  2853. Application.OnActivate:=@LockActivate;
  2854. if hLock then
  2855. Result.Dirct:='Down'
  2856. else
  2857. Result.Dirct:='Up';
  2858.  
  2859. #ifdef Image
  2860. ImgLoad(Result.Tile.Handle, PAnsiChar(hImg), 2, 2, hParent.ClientWidth - 8, hParent.ClientHeight - 8, True, True);
  2861. ImgApplyChanges(Result.Tile.Handle);
  2862. #endif
  2863.  
  2864. Result.LTime:=TLabel.Create(Result.Tile);
  2865. with Result.LTime do
  2866. begin
  2867. Parent:=Result.Tile;
  2868. SetBounds(40,Result.Parent.ClientHeight - 170,0,0);
  2869. with Font do
  2870. begin
  2871. Name:='Segoe UI Light';
  2872. Size:=52;
  2873. Color:=$FFFFFF;
  2874. end;
  2875. Caption:=MetroTime;
  2876. OnMouseDown:=@LockFocus;
  2877. end;
  2878.  
  2879. Result.LDate:=TLabel.Create(Result.Tile);
  2880. with Result.LDate do
  2881. begin
  2882. Parent:=Result.Tile;
  2883. SetBounds(40,Result.Parent.ClientHeight - 100,0,0);
  2884. with Font do
  2885. begin
  2886. Name:='Segoe UI Light';
  2887. Size:=36;
  2888. Color:=$FFFFFF;
  2889. end;
  2890. Caption:=MetroDate;
  2891. OnMouseDown:=@LockFocus;
  2892. end;
  2893.  
  2894. Result.Labl:= TLabel.Create(Result.Tile);
  2895. with Result.Labl do
  2896. begin
  2897. Parent:=Result.Tile;
  2898. SetBounds(40,Result.Parent.ClientHeight + 60,0,0);
  2899. with Font do
  2900. begin
  2901. Name:='Segoe UI Light';
  2902. Size:=13;
  2903. Color:=$FFFFFF;
  2904. end;
  2905. Caption:=Lowercase('Press up to unlock this screen');
  2906. OnMouseDown:=@LockFocus;
  2907. end;
  2908.  
  2909. Result.Tmr:= TTimer.Create(hParent);
  2910. with Result.Tmr do begin
  2911. OnTimer:=@LockTimer;
  2912. Interval:=1;
  2913. Enabled:=True;
  2914. end;
  2915. end;*)
  2916. //Windows Phone Technology v4.1 created by Razor12911
  2917.  
  2918. function InstallRedist(Redist: Integer):Boolean;
  2919. begin
  2920. case Redist of
  2921. 1: Result:= CheckBoxGetChecked(Redist1);
  2922. 2: Result:= CheckBoxGetChecked(Redist2);
  2923. 3: Result:= CheckBoxGetChecked(Redist3);
  2924. 4: Result:= CheckBoxGetChecked(Redist4);
  2925. 5: Result:= CheckBoxGetChecked(Redist5);
  2926. end;
  2927. end;
  2928.  
  2929. #ifdef AppExe1
  2930. procedure Launch1TileClick(Sender: TObject);
  2931. var
  2932. InstallDir: String;
  2933. ResultCode: Integer;
  2934. begin
  2935. if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#AppName}_is1','Inno Setup: App Path', InstallDir) then
  2936. begin
  2937. if Exec(AddBackslash(InstallDir) + '{#E1[60]}\{#E1[61]}', '', '', SW_SHOW,ewNoWait, ResultCode) then
  2938. TileModal(Launch1Tile)
  2939. else
  2940. MsgBox('Failed to initiate program. Application executable not found.', mbError, MB_OK);
  2941. end else
  2942. MsgBox('Program is currently not installed.', mbInformation, MB_OK);
  2943. end;
  2944.  
  2945. #ifdef AppExe2
  2946. procedure Launch2TileClick(Sender: TObject);
  2947. var
  2948. InstallDir: String;
  2949. ResultCode: Integer;
  2950. begin
  2951. if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#AppName}_is1','Inno Setup: App Path', InstallDir) then
  2952. begin
  2953. if Exec(AddBackslash(InstallDir) + '{#E2[60]}\{#E2[61]}', '', '', SW_SHOW,ewNoWait, ResultCode) then
  2954. TileModal(Launch2Tile)
  2955. else
  2956. MsgBox('Failed to initiate program. Application executable not found.', mbError, MB_OK);
  2957. end else
  2958. MsgBox('Program is currently not installed.', mbInformation, MB_OK);
  2959. end;
  2960.  
  2961. #ifdef AppExe3
  2962. procedure Launch3TileClick(Sender: TObject);
  2963. var
  2964. InstallDir: String;
  2965. ResultCode: Integer;
  2966. begin
  2967. if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#AppName}_is1','Inno Setup: App Path', InstallDir) then
  2968. begin
  2969. if Exec(AddBackslash(InstallDir) + '{#E3[60]}\{#E3[61]}', '', '', SW_SHOW,ewNoWait, ResultCode) then
  2970. TileModal(Launch3Tile)
  2971. else
  2972. MsgBox('Failed to initiate program. Application executable not found.', mbError, MB_OK);
  2973. end else
  2974. MsgBox('Program is currently not installed.', mbInformation, MB_OK);
  2975. end;
  2976.  
  2977. #ifdef AppExe4
  2978. procedure Launch4TileClick(Sender: TObject);
  2979. var
  2980. InstallDir: String;
  2981. ResultCode: Integer;
  2982. begin
  2983. if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#AppName}_is1','Inno Setup: App Path', InstallDir) then
  2984. begin
  2985. if Exec(AddBackslash(InstallDir) + '{#E4[60]}\{#E4[61]}', '', '', SW_SHOW,ewNoWait, ResultCode) then
  2986. TileModal(Launch4Tile)
  2987. else
  2988. MsgBox('Failed to initiate program. Application executable not found.', mbError, MB_OK);
  2989. end else
  2990. MsgBox('Program is currently not installed.', mbInformation, MB_OK);
  2991. end;
  2992.  
  2993. #ifdef AppExe5
  2994. procedure Launch5TileClick(Sender: TObject);
  2995. var
  2996. InstallDir: String;
  2997. ResultCode: Integer;
  2998. begin
  2999. if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#AppName}_is1','Inno Setup: App Path', InstallDir) then
  3000. begin
  3001. if Exec(AddBackslash(InstallDir) + '{#E5[60]}\{#E5[61]}', '', '', SW_SHOW,ewNoWait, ResultCode) then
  3002. TileModal(Launch5Tile)
  3003. else
  3004. MsgBox('Failed to initiate program. Application executable not found.', mbError, MB_OK);
  3005. end else
  3006. MsgBox('Program is currently not installed.', mbInformation, MB_OK);
  3007. end;
  3008.  
  3009. #ifdef AppExe6
  3010. procedure Launch6TileClick(Sender: TObject);
  3011. var
  3012. InstallDir: String;
  3013. ResultCode: Integer;
  3014. begin
  3015. if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#AppName}_is1','Inno Setup: App Path', InstallDir) then
  3016. begin
  3017. if Exec(AddBackslash(InstallDir) + '{#E6[60]}\{#E6[61]}', '', '', SW_SHOW,ewNoWait, ResultCode) then
  3018. TileModal(Launch6Tile)
  3019. else
  3020. MsgBox('Failed to initiate program. Application executable not found.', mbError, MB_OK);
  3021. end else
  3022. MsgBox('Program is currently not installed.', mbInformation, MB_OK);
  3023. end;
  3024.  
  3025. #endif
  3026. #endif
  3027. #endif
  3028. #endif
  3029. #endif
  3030. #endif
  3031.  
  3032. procedure InstallTileClick(Sender: TObject);
  3033. begin
  3034. TileModal(InstallTile);
  3035. end;
  3036.  
  3037. procedure UninstallTileClick(Sender: TObject);
  3038. var
  3039. UninstallExe: String;
  3040. ResultCode: Integer;
  3041. begin
  3042. if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#AppName}_is1','UninstallString', UninstallExe) then
  3043. begin
  3044. if Exec(RemoveQuotes(UninstallExe), '', '', SW_SHOW,ewNoWait, ResultCode) then
  3045. TileModal(UninstallTile)
  3046. else
  3047. MsgBox('Failed to initiate uninstaller. Unsinatller executable not found.', mbInformation, MB_OK);
  3048. end else
  3049. MsgBox('Program is currently not installed.', mbInformation, MB_OK);
  3050. end;
  3051.  
  3052. procedure ExitTileClick(Sender: TObject);
  3053. begin
  3054. TileModal(ExitTile);
  3055. end;
  3056.  
  3057. procedure AFMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);forward;
  3058.  
  3059. function InitializeSetup:Boolean;
  3060. begin
  3061. SetPriorityClass(GetCurrentProcess, HIGH_PRIORITY_CLASS);
  3062. #ifdef CurColor
  3063. CurCol:={#CurColor};
  3064. #else
  3065. CurCol:=1;
  3066. #endif
  3067. ExtractTemporaryFile('botva2.dll');
  3068. #ifdef Image
  3069. ExtractTemporaryFile('Dark.png');
  3070. ExtractTemporaryFile('Light.png');
  3071. #ifexist "Graphics\Images\Lockscreen.jpg"
  3072. ExtractTemporaryFile('Lockscreen.jpg');
  3073. #endif
  3074. #sub ExtractFile2
  3075. ExtractTemporaryFile('Setup{#i}.jpg');
  3076. #endsub
  3077. #for {i = 1; FileExists(StringChange("Graphics\Images\SetupFileName.jpg", "FileName", Str(i))) != 0; i++} ExtractFile2
  3078. #ifdef Autorun
  3079. #sub ExtractFile1
  3080. ExtractTemporaryFile('Autorun{#i}.jpg');
  3081. #endsub
  3082. #for {i = 1; FileExists(StringChange("Graphics\Images\AutorunFileName.jpg", "FileName", Str(i))) != 0; i++} ExtractFile1
  3083. #endif
  3084. #endif
  3085. #ifdef Autorun
  3086. ExtractTemporaryFile('Exit.png');
  3087. ExtractTemporaryFile('Install.png');
  3088. ExtractTemporaryFile('Uninstall.png');
  3089. #ifdef Image
  3090. #ifdef AppExe1
  3091. ExtractTemporaryFile('Tile1_Background.jpg');
  3092. #sub ExtractExeIcon1
  3093. ExtractTemporaryFile('Tile1_Icon{#i}.png');
  3094. #endsub
  3095. #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile1_IconFileName.png", "FileName", Str(i))) != 0; i++} ExtractExeIcon1
  3096. #ifdef AppExe2
  3097. ExtractTemporaryFile('Tile2_Background.jpg');
  3098. #sub ExtractExeIcon2
  3099. ExtractTemporaryFile('Tile2_Icon{#i}.png');
  3100. #endsub
  3101. #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile2_IconFileName.png", "FileName", Str(i))) != 0; i++} ExtractExeIcon2
  3102. #ifdef AppExe3
  3103. ExtractTemporaryFile('Tile3_Background.jpg');
  3104. #sub ExtractExeIcon3
  3105. ExtractTemporaryFile('Tile3_Icon{#i}.png');
  3106. #endsub
  3107. #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile3_IconFileName.png", "FileName", Str(i))) != 0; i++} ExtractExeIcon3
  3108. #ifdef AppExe4
  3109. ExtractTemporaryFile('Tile4_Background.jpg');
  3110. #sub ExtractExeIcon4
  3111. ExtractTemporaryFile('Tile4_Icon{#i}.png');
  3112. #endsub
  3113. #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile4_IconFileName.png", "FileName", Str(i))) != 0; i++} ExtractExeIcon4
  3114. #ifdef AppExe5
  3115. ExtractTemporaryFile('Tile5_Background.jpg');
  3116. #sub ExtractExeIcon5
  3117. ExtractTemporaryFile('Tile5_Icon{#i}.png');
  3118. #endsub
  3119. #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile5_IconFileName.png", "FileName", Str(i))) != 0; i++} ExtractExeIcon5
  3120. #ifdef AppExe6
  3121. ExtractTemporaryFile('Tile6_Background.jpg');
  3122. #sub ExtractExeIcon6
  3123. ExtractTemporaryFile('Tile6_Icon{#i}.png');
  3124. #endsub
  3125. #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile6_IconFileName.png", "FileName", Str(i))) != 0; i++} ExtractExeIcon6
  3126. #endif
  3127. #endif
  3128. #endif
  3129. #endif
  3130. #endif
  3131. #endif
  3132. #endif
  3133. #endif
  3134.  
  3135. AutorunForm:= CreateCustomForm();
  3136. with AutorunForm do begin
  3137. BorderStyle:=bsNone;
  3138. ClientWidth:=800;
  3139. ClientHeight:=448;
  3140. Center;
  3141. #ifdef Dark
  3142. Color:=$252525;
  3143. #else
  3144. Color:=$FFFFFF;
  3145. #endif
  3146. end;
  3147.  
  3148. with TPanel.Create(AutorunForm) do
  3149. begin
  3150. Parent:=AutorunForm;
  3151. Left:=0;
  3152. Top:=15;
  3153. Width:=10;
  3154. Height:=50;
  3155. Color:=MetroColor(CurCol);
  3156. BorderStyle := bsNone;
  3157. BevelInner := bvNone;
  3158. BevelOuter := bvNone;
  3159. BorderWidth := 0;
  3160. ParentBackground := False;
  3161. end;
  3162.  
  3163. with TPanel.Create(AutorunForm) do
  3164. begin
  3165. Parent:=AutorunForm;
  3166. Left:=0;
  3167. Top:=AutorunForm.ClientHeight - 5;
  3168. Width:=AutorunForm.ClientWidth;
  3169. Height:=5;
  3170. Color:=MetroColor(CurCol);
  3171. BorderStyle := bsNone;
  3172. BevelInner := bvNone;
  3173. BevelOuter := bvNone;
  3174. BorderWidth := 0;
  3175. ParentBackground := False;
  3176. end;
  3177.  
  3178. with TLabel.Create(AutorunForm) do
  3179. begin
  3180. Parent:=AutorunForm;
  3181. SetBounds(20,10,0,0);
  3182. with Font do
  3183. begin
  3184. Name:='Segoe UI';
  3185. Size:=11;
  3186. Color:=MetroColor(CurCol);
  3187. end;
  3188. Caption:=Uppercase('{#AppName}');
  3189. end;
  3190.  
  3191. with TLabel.Create(AutorunForm) do
  3192. begin
  3193. Parent:=AutorunForm;
  3194. AutoSize:=False;
  3195. SetBounds(2,AutorunForm.ClientHeight-18,AutorunForm.ClientWidth-4,18);
  3196. with Font do
  3197. begin
  3198. Name:='Segoe UI SemiBold';
  3199. Size:=7;
  3200. Color:=MetroColor(CurCol);
  3201. end;
  3202. Alignment:=taRightJustify;
  3203. Caption:=Uppercase('{#Watermark}');
  3204. end;
  3205.  
  3206. with TLabel.Create(AutorunForm) do
  3207. begin
  3208. Parent:=AutorunForm;
  3209. SetBounds(20,20,0,0);
  3210. with Font do
  3211. begin
  3212. Name:='Segoe UI Light';
  3213. Size:=27;
  3214. Color:=MetroColor(CurCol);
  3215. end;
  3216. Caption:='Start';
  3217. end;
  3218. with TLabel.Create(AutorunForm) do
  3219. begin
  3220. Parent:= AutorunForm;
  3221. Left:= 0;
  3222. Top:= 0;
  3223. Width:= AutorunForm.ClientWidth;
  3224. Height:= AutorunForm.ClientHeight;
  3225. AutoSize:= false;
  3226. Transparent:= true;
  3227. WordWrap:= False;
  3228. OnMouseDown:=@AFMouseDown;
  3229. end;
  3230.  
  3231. #ifdef Image
  3232. if FileExists(ExpandConstant('{tmp}\Autorun2.jpg')) then
  3233. begin
  3234. AutorunSlide:=SlideCreate(AutorunForm,ExpandConstant('{tmp}\Autorun'),'.jpg',10000,0,0,AutorunForm.ClientWidth,AutorunForm.ClientHeight,False,SlideAuto);
  3235. end else begin
  3236. ImgLoad(AutorunForm.Handle,ExpandConstant('{tmp}\Autorun1.jpg'),0,0,AutorunForm.ClientWidth,AutorunForm.ClientHeight,True,True);
  3237. end;
  3238. #ifdef Dark
  3239. ImgLoad(AutorunForm.Handle,ExpandConstant('{tmp}\Dark.png'),0,0,AutorunForm.ClientWidth,AutorunForm.ClientHeight,True,True);
  3240. #else
  3241. ImgLoad(AutorunForm.Handle,ExpandConstant('{tmp}\Light.png'),0,0,AutorunForm.ClientWidth,AutorunForm.ClientHeight,True,True);
  3242. #endif
  3243. ImgApplyChanges(AutorunForm.Handle);
  3244. #endif
  3245.  
  3246. #ifdef AppExe1
  3247. #ifdef AppExe4
  3248. InstallTile:=TileCreate(AutorunForm,412,80,108,108,ExpandConstant('{tmp}\Install.png'),'Install',mrOk, False);
  3249. TileSetEvent(InstallTile,@InstallTileClick);
  3250. UninstallTile:=TileCreate(AutorunForm,412,192,108,108,ExpandConstant('{tmp}\Uninstall.png'),'Uninstall',mrNone, False);
  3251. TileSetEvent(UninstallTile,@UninstallTileClick);
  3252. ExitTile:=TileCreate(AutorunForm,412,304,108,108,ExpandConstant('{tmp}\Exit.png'),'Exit',mrCancel, False);
  3253. TileSetEvent(ExitTile,@ExitTileClick);
  3254. #else
  3255. InstallTile:=TileCreate(AutorunForm,216,80,108,108,ExpandConstant('{tmp}\Install.png'),'Install',mrOk, False);
  3256. TileSetEvent(InstallTile,@InstallTileClick);
  3257. UninstallTile:=TileCreate(AutorunForm,216,192,108,108,ExpandConstant('{tmp}\Uninstall.png'),'Uninstall',mrNone, False);
  3258. TileSetEvent(UninstallTile,@UninstallTileClick);
  3259. ExitTile:=TileCreate(AutorunForm,216,304,108,108,ExpandConstant('{tmp}\Exit.png'),'Exit',mrCancel, False);
  3260. TileSetEvent(ExitTile,@ExitTileClick);
  3261. #endif
  3262. #else
  3263. InstallTile:=TileCreate(AutorunForm,20,80,108,108,ExpandConstant('{tmp}\Install.png'),'Install',mrOk, False);
  3264. TileSetEvent(InstallTile,@InstallTileClick);
  3265. UninstallTile:=TileCreate(AutorunForm,20,192,108,108,ExpandConstant('{tmp}\Uninstall.png'),'Uninstall',mrNone, False);
  3266. TileSetEvent(UninstallTile,@UninstallTileClick);
  3267. ExitTile:=TileCreate(AutorunForm,20,304,108,108,ExpandConstant('{tmp}\Exit.png'),'Exit',mrCancel, False);
  3268. TileSetEvent(ExitTile,@ExitTileClick);
  3269. #endif
  3270.  
  3271. #ifdef AppExe1
  3272. Launch1Tile:=TileCreate(AutorunForm,20,80,192,108,ExpandConstant('{tmp}\Tile1'),'{#E1[59]}',mrCancel, True);
  3273. TileSetEvent(Launch1Tile,@Launch1TileClick);
  3274. #ifdef AppExe2
  3275. Launch2Tile:=TileCreate(AutorunForm,20,192,192,108,ExpandConstant('{tmp}\Tile2'),'{#E2[59]}',mrCancel, True);
  3276. TileSetEvent(Launch2Tile,@Launch2TileClick);
  3277. #ifdef AppExe3
  3278. Launch3Tile:=TileCreate(AutorunForm,20,304,192,108,ExpandConstant('{tmp}\Tile3'),'{#E3[59]}',mrCancel, True);
  3279. TileSetEvent(Launch3Tile,@Launch3TileClick);
  3280. #ifdef AppExe4
  3281. Launch4Tile:=TileCreate(AutorunForm,216,80,192,108,ExpandConstant('{tmp}\Tile4'),'{#E4[59]}',mrCancel, True);
  3282. TileSetEvent(Launch4Tile,@Launch4TileClick);
  3283. #ifdef AppExe5
  3284. Launch5Tile:=TileCreate(AutorunForm,216,192,192,108,ExpandConstant('{tmp}\Tile5'),'{#E5[59]}',mrCancel, True);
  3285. TileSetEvent(Launch5Tile,@Launch5TileClick);
  3286. #ifdef AppExe6
  3287. Launch6Tile:=TileCreate(AutorunForm,216,304,192,108,ExpandConstant('{tmp}\Tile6'),'{#E6[59]}',mrCancel, True);
  3288. TileSetEvent(Launch6Tile,@Launch6TileClick);
  3289. #endif
  3290. #endif
  3291. #endif
  3292. #endif
  3293. #endif
  3294. #endif
  3295. // AutorunLock:=LockCreate(AutorunForm,ExpandConstant('{tmp}\Lockscreen.jpg'),True);
  3296. #ifdef Autorun
  3297. Result:=AutorunForm.ShowModal = mrOk;
  3298. #else
  3299. Result:=True;
  3300. #endif
  3301. end;
  3302.  
  3303. procedure AFMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  3304. begin
  3305. ReleaseCapture;
  3306. SendMessage(AutorunForm.Handle,$0112,$F012,0);
  3307. end;
  3308.  
  3309. procedure WFMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  3310. begin
  3311. ReleaseCapture;
  3312. SendMessage(WizardForm.Handle,$0112,$F012,0);
  3313. end;
  3314.  
  3315. procedure CFMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  3316. begin
  3317. ReleaseCapture;
  3318. SendMessage(CancelForm.Handle,$0112,$F012,0);
  3319. end;
  3320.  
  3321. function CreateShortcuts:Boolean;
  3322. begin
  3323. if ISDoneError then
  3324. Result:=False
  3325. else
  3326. Result:=CheckBoxGetChecked(DesktopChk);
  3327. end;
  3328.  
  3329. procedure DirEditOnChange(Sender: TObject);
  3330. begin
  3331. EditSetText(SelectDirEdt,MinimizePathName(WizardForm.DirEdit.Text, SelectDirEdt.Top.Font, SelectDirEdt.Top.Width));
  3332. end;
  3333.  
  3334. procedure CFShow(Sender: TObject);
  3335. begin
  3336. SetWindowPos(CancelForm.Handle,0,WizardForm.Left,WizardForm.Top,0,0,$515);
  3337. end;
  3338.  
  3339. procedure CFMoved(Sender: TObject);
  3340. begin
  3341. if CancelForm.Showing then
  3342. SetWindowPos(WizardForm.Handle,0,CancelForm.Left,CancelForm.Top,0,0,$515);
  3343. end;
  3344.  
  3345. procedure MinimizeBtnClick(Sender: Tobject);
  3346. begin
  3347. SendMessage(WizardForm.Handle,$112,61472,0);
  3348. end;
  3349.  
  3350. procedure CloseBtnClick(Sender: Tobject);
  3351. begin
  3352. WizardForm.CancelButton.Click;
  3353. end;
  3354.  
  3355. procedure BackBtnClick(Sender: Tobject);
  3356. var
  3357. n: Integer;
  3358. begin
  3359. if WizardForm.CurPageID = wpWelcome then
  3360. WizardForm.CancelButton.Click;
  3361. if WizardForm.CurPageID = wpSelectDir then
  3362. WizardForm.BackButton.Click;
  3363. if WizardForm.CurPageID = wpInstalling then
  3364. WizardForm.CancelButton.Click;
  3365. if WizardForm.CurPageID = wpFinished then
  3366. begin
  3367. Exec(ExpandConstant('{uninstallexe}'), '/Silent','', sw_Show, ewWaitUntilTerminated, n);
  3368. ButtonSetEnabled(BackBtn,False);
  3369. end
  3370. end;
  3371.  
  3372. procedure NextBtnClick(Sender: Tobject);
  3373. begin
  3374. if WizardForm.CurPageID = wpInstalling then
  3375. WizardForm.CancelButton.Click
  3376. else
  3377. WizardForm.NextButton.Click;
  3378. end;
  3379.  
  3380. procedure BrowseBtnClick(Sender: Tobject);
  3381. begin
  3382. WizardForm.DirBrowseButton.Click;
  3383. end;
  3384.  
  3385. procedure CancelYesBtnClick(Sender: Tobject);
  3386. begin
  3387. ButtonModal(CancelYesBtn);
  3388. end;
  3389.  
  3390. procedure CancelNoBtnClick(Sender: Tobject);
  3391. begin
  3392. ButtonModal(CancelNoBtn);
  3393. end;
  3394.  
  3395. procedure InstallOnTimer(Sender: TObject);
  3396. var
  3397. pr, i1, i2: Extended;
  3398. begin
  3399. if (WizardForm.ProgressGauge.Position>WizardForm.ProgressGauge.Min) then begin
  3400. i1:=WizardForm.ProgressGauge.Position-WizardForm.ProgressGauge.Min;
  3401. i2:=WizardForm.ProgressGauge.Max-WizardForm.ProgressGauge.Min;
  3402. pr:=i1*100/i2;
  3403. ProgressSetProgress(InstallPBr,pr);
  3404. end;
  3405. if WizardForm.StatusLabel.Caption <> '' then
  3406. InstallLabel4.Caption:=WizardForm.StatusLabel.Caption;
  3407. end;
  3408.  
  3409. procedure InitializeWizard;
  3410. var
  3411. Str: String;
  3412. AppSize2: Integer;
  3413. begin
  3414. #ifdef CurColor
  3415. CurCol:={#CurColor};
  3416. #else
  3417. CurCol:=1;
  3418. #endif
  3419. with WizardForm do
  3420. begin
  3421. BorderStyle:=bsNone;
  3422. ClientWidth:=800;
  3423. ClientHeight:=448;
  3424. Center;
  3425. #ifdef Dark
  3426. Color:=$252525;
  3427. #else
  3428. Color:=$FFFFFF;
  3429. #endif
  3430. OuterNotebook.Hide;
  3431. InnerNotebook.Hide;
  3432. Bevel.Hide;
  3433. PageNameLabel.Hide;
  3434. PageDescriptionLabel.Hide;
  3435. MainPanel.Hide;
  3436. BackButton.SetBounds(0,0,0,0);
  3437. NextButton.SetBounds(0,0,0,0);
  3438. CancelButton.SetBounds(0,0,0,0);
  3439. DirBrowseButton.SetBounds(0,0,0,0);
  3440. GroupBrowseButton.SetBounds(0,0,0,0);
  3441. DirEdit.OnChange:=@DirEditOnChange;
  3442. end;
  3443.  
  3444. #ifdef Image
  3445. if FileExists(ExpandConstant('{tmp}\Setup2.jpg')) then
  3446. begin
  3447. #if ReadIni(SourcePath + "\WindowsPhone.iss", "Archives", "Archive1Type", "") != ""
  3448. WizardSlide:=SlideCreate(WizardForm,ExpandConstant('{tmp}\Setup'),'.jpg',10000,0,0,WizardForm.ClientWidth,WizardForm.ClientHeight,False,SlideNone);
  3449. #else
  3450. WizardSlide:=SlideCreate(WizardForm,ExpandConstant('{tmp}\Setup'),'.jpg',10000,0,0,WizardForm.ClientWidth,WizardForm.ClientHeight,False,SlideAuto);
  3451. #endif
  3452. end else begin
  3453. ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Setup1.jpg'),0,0,WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
  3454. end;
  3455. #ifdef Dark
  3456. ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Dark.png'),0,0,WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
  3457. #else
  3458. ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Light.png'),0,0,WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
  3459. #endif
  3460. ImgApplyChanges(WizardForm.Handle);
  3461. #endif
  3462.  
  3463. with TLabel.Create(WizardForm) do
  3464. begin
  3465. Parent:= WizardForm;
  3466. Left:= 0;
  3467. Top:= 0;
  3468. Width:= WizardForm.ClientWidth;
  3469. Height:= WizardForm.ClientHeight;
  3470. AutoSize:= false;
  3471. Transparent:= true;
  3472. WordWrap:= False;
  3473. OnMouseDown:=@WFMouseDown;
  3474. end;
  3475.  
  3476. TopLeftPanel:= TPanel.Create(WizardForm);
  3477. with TopLeftPanel do
  3478. begin
  3479. Parent:=WizardForm;
  3480. Left:=0;
  3481. Top:=15;
  3482. Width:=10;
  3483. Height:=50;
  3484. Color:=MetroColor(CurCol);
  3485. BorderStyle := bsNone;
  3486. BevelInner := bvNone;
  3487. BevelOuter := bvNone;
  3488. BorderWidth := 0;
  3489. ParentBackground := False;
  3490. OnMouseDown:=@WFMouseDown;
  3491. end;
  3492.  
  3493. BottomPanel:= TPanel.Create(WizardForm);
  3494. with BottomPanel do
  3495. begin
  3496. Parent:=WizardForm;
  3497. Left:=0;
  3498. Top:=WizardForm.ClientHeight - 5;
  3499. Width:=WizardForm.ClientWidth;
  3500. Height:=5;
  3501. Color:=MetroColor(CurCol);
  3502. BorderStyle := bsNone;
  3503. BevelInner := bvNone;
  3504. BevelOuter := bvNone;
  3505. BorderWidth := 0;
  3506. ParentBackground := False;
  3507. OnMouseDown:=@WFMouseDown;
  3508. end;
  3509.  
  3510. TitleLabel1:= TLabel.Create(WizardForm);
  3511. with TitleLabel1 do
  3512. begin
  3513. Parent:=WizardForm;
  3514. SetBounds(20,10,0,0);
  3515. with Font do
  3516. begin
  3517. Name:='Segoe UI';
  3518. Size:=11;
  3519. Color:=MetroColor(CurCol);
  3520. end;
  3521. Caption:=Uppercase('{#AppName}');
  3522. OnMouseDown:=@WFMouseDown;
  3523. end;
  3524.  
  3525. TitleLabel2:= TLabel.Create(WizardForm);
  3526. with TitleLabel2 do
  3527. begin
  3528. Parent:=WizardForm;
  3529. AutoSize:=False;
  3530. SetBounds(2,WizardForm.ClientHeight-18,WizardForm.ClientWidth-4,18);
  3531. with Font do
  3532. begin
  3533. Name:='Segoe UI SemiBold';
  3534. Size:=7;
  3535. Color:=MetroColor(CurCol);
  3536. end;
  3537. Alignment:=taRightJustify;
  3538. Caption:=Uppercase('{#Watermark}');
  3539. OnMouseDown:=@WFMouseDown;
  3540. end;
  3541.  
  3542. StatusLabel1:= TLabel.Create(WizardForm);
  3543. with StatusLabel1 do
  3544. begin
  3545. Parent:=WizardForm;
  3546. SetBounds(20,20,0,0);
  3547. with Font do
  3548. begin
  3549. Name:='Segoe UI Light';
  3550. Size:=27;
  3551. Color:=MetroColor(CurCol);
  3552. end;
  3553. Caption:='Repack';
  3554. OnMouseDown:=@WFMouseDown;
  3555. end;
  3556.  
  3557. StatusLabel2:= TLabel.Create(WizardForm);
  3558. with StatusLabel2 do
  3559. begin
  3560. Parent:=WizardForm;
  3561. SetBounds((StatusLabel1.Left + StatusLabel1.Width) + 10,20,0,0);
  3562. with Font do
  3563. begin
  3564. Name:='Segoe UI Light';
  3565. Size:=27;
  3566. #ifdef Dark
  3567. Color:=$AAAAAA;
  3568. #else
  3569. Color:=$222222;
  3570. #endif
  3571. end;
  3572. Caption:='by';
  3573. OnMouseDown:=@WFMouseDown;
  3574. end;
  3575.  
  3576. StatusLabel3:= TLabel.Create(WizardForm);
  3577. with StatusLabel3 do
  3578. begin
  3579. Parent:=WizardForm;
  3580. SetBounds((StatusLabel2.Left + StatusLabel2.Width) + 10,20,0,0);
  3581. with Font do
  3582. begin
  3583. Name:='Segoe UI Light';
  3584. Size:=27;
  3585. #ifdef Dark
  3586. Color:=$AAAAAA;
  3587. #else
  3588. Color:=$222222;
  3589. #endif
  3590. end;
  3591. Caption:='{#Repacker}';
  3592. OnMouseDown:=@WFMouseDown;
  3593. end;
  3594.  
  3595. StatusLabel4:= TLabel.Create(WizardForm);
  3596. with StatusLabel4 do
  3597. begin
  3598. Parent:=WizardForm;
  3599. SetBounds((StatusLabel3.Left + StatusLabel3.Width) + 10,20,0,0);
  3600. with Font do
  3601. begin
  3602. Name:='Segoe UI Light';
  3603. Size:=27;
  3604. #ifdef Dark
  3605. Color:=$AAAAAA;
  3606. #else
  3607. Color:=$222222;
  3608. #endif
  3609. end;
  3610. Caption:='';
  3611. OnMouseDown:=@WFMouseDown;
  3612. end;
  3613.  
  3614. WelcomeLabel1:= TLabel.Create(WizardForm);
  3615. with WelcomeLabel1 do
  3616. begin
  3617. Parent:=WizardForm;
  3618. SetBounds(20,70,0,0);
  3619. with Font do
  3620. begin
  3621. Name:='Segoe UI Light';
  3622. Size:=18;
  3623. #ifdef Dark
  3624. Color:=$FFFFFF;
  3625. #else
  3626. Color:=$252525
  3627. #endif
  3628. end;
  3629. Caption:='Welcome to {#AppName} Installer Wizard';
  3630. OnMouseDown:=@WFMouseDown;
  3631. end;
  3632.  
  3633. WelcomeLabel2:= TLabel.Create(WizardForm);
  3634. with WelcomeLabel2 do
  3635. begin
  3636. Parent:=WizardForm;
  3637. SetBounds(20,110,0,0);
  3638. with Font do
  3639. begin
  3640. Name:='Segoe UI Light';
  3641. Size:=11;
  3642. #ifdef Dark
  3643. Color:=$AAAAAA;
  3644. #else
  3645. Color:=$222222;
  3646. #endif
  3647. end;
  3648. Caption:='You are installing {#AppName} on your computer.'+#13+
  3649. 'It is highly recommended that you close all programs'+#13+
  3650. 'that may interfere with the installation progress.';
  3651. OnMouseDown:=@WFMouseDown;
  3652. end;
  3653.  
  3654. WelcomeLabel3:= TLabel.Create(WizardForm);
  3655. with WelcomeLabel3 do begin
  3656. Parent:=WizardForm;
  3657. SetBounds(20,370,0,0);
  3658. with Font do
  3659. begin
  3660. Name:='Segoe UI Light';
  3661. Size:=13;
  3662. Color:=MetroColor(CurCol);
  3663. end;
  3664. Caption:=Lowercase('When ready click Proceed to continue with installation or close to exit installation.');
  3665. OnMouseDown:=@WFMouseDown;
  3666. end;
  3667.  
  3668. SelectDirLabel1:= TLabel.Create(WizardForm);
  3669. with SelectDirLabel1 do
  3670. begin
  3671. Parent:=WizardForm;
  3672. SetBounds(20,70,0,0);
  3673. with Font do
  3674. begin
  3675. Name:='Segoe UI Light';
  3676. Size:=18;
  3677. #ifdef Dark
  3678. Color:=$FFFFFF;
  3679. #else
  3680. Color:=$252525
  3681. #endif
  3682. end;
  3683. Caption:='Select the destination of the product you are installing';
  3684. OnMouseDown:=@WFMouseDown;
  3685. end;
  3686.  
  3687. SelectDirLabel2:= TLabel.Create(WizardForm);
  3688. with SelectDirLabel2 do
  3689. begin
  3690. Parent:=WizardForm;
  3691. SetBounds(20,110,0,0);
  3692. with Font do
  3693. begin
  3694. Name:='Segoe UI Light';
  3695. Size:=11;
  3696. #ifdef Dark
  3697. Color:=$AAAAAA;
  3698. #else
  3699. Color:=$222222;
  3700. #endif
  3701. end;
  3702. Caption:='{#AppName} will be installed in this Directory.'+#13+
  3703. 'You can select a different directory by clicking the browse button.'+#13+
  3704. 'Make sure you have enough space before installing.';
  3705. OnMouseDown:=@WFMouseDown;
  3706. end;
  3707.  
  3708. SelectDirLabel3:= TLabel.Create(WizardForm);
  3709. with SelectDirLabel3 do
  3710. begin
  3711. Parent:=WizardForm;
  3712. SetBounds(20,176,0,0);
  3713. with Font do
  3714. begin
  3715. Name:='Segoe UI Bold';
  3716. Size:=8;
  3717. Color:=MetroColor(CurCol);
  3718. end;
  3719. Str:=SetupMessage(msgDiskSpaceMBLabel);
  3720. StringChange(Str,'[mb]', '{#AppSize}');
  3721. Caption:=Str;
  3722. OnMouseDown:=@WFMouseDown;
  3723. end;
  3724.  
  3725. InstallLabel1:= TLabel.Create(WizardForm);
  3726. with InstallLabel1 do
  3727. begin
  3728. Parent:=WizardForm;
  3729. SetBounds(20,70,0,0);
  3730. with Font do
  3731. begin
  3732. Name:='Segoe UI Light';
  3733. Size:=18;
  3734. #ifdef Dark
  3735. Color:=$FFFFFF;
  3736. #else
  3737. Color:=$252525
  3738. #endif
  3739. end;
  3740. Caption:='Installing {#AppName}';
  3741. OnMouseDown:=@WFMouseDown;
  3742. end;
  3743.  
  3744. InstallLabel2:= TLabel.Create(WizardForm);
  3745. with InstallLabel2 do
  3746. begin
  3747. Parent:=WizardForm;
  3748. SetBounds(20,110,0,0);
  3749. with Font do
  3750. begin
  3751. Name:='Segoe UI Light';
  3752. Size:=11;
  3753. #ifdef Dark
  3754. Color:=$AAAAAA;
  3755. #else
  3756. Color:=$222222;
  3757. #endif
  3758. end;
  3759. Caption:='Installer Wizard is installing the product.'+#13+
  3760. 'This might take a while.';
  3761. OnMouseDown:=@WFMouseDown;
  3762. end;
  3763.  
  3764. InstallLabel3:= TLabel.Create(WizardForm);
  3765. with InstallLabel3 do
  3766. begin
  3767. Parent:=WizardForm;
  3768. SetBounds(20,175,0,0);
  3769. with Font do
  3770. begin
  3771. Name:='Segoe UI SemiBold';
  3772. Size:=9;
  3773. #ifdef Dark
  3774. Color:=$AAAAAA;
  3775. #else
  3776. Color:=$222222;
  3777. #endif
  3778. end;
  3779. Caption:='Status:';
  3780. OnMouseDown:=@WFMouseDown;
  3781. end;
  3782.  
  3783. InstallLabel4:= TLabel.Create(WizardForm);
  3784. with InstallLabel4 do
  3785. begin
  3786. Parent:=WizardForm;
  3787. SetBounds((InstallLabel3.Left + InstallLabel3.Width) + 2,176,0,0);
  3788. with Font do
  3789. begin
  3790. Name:='Segoe UI Bold';
  3791. Size:=8;
  3792. Color:=MetroColor(CurCol);
  3793. end;
  3794. Caption:='Installing...';
  3795. OnMouseDown:=@WFMouseDown;
  3796. end;
  3797.  
  3798. InstallTimer:= TTimer.Create(WizardForm);
  3799. with InstallTimer do
  3800. begin
  3801. OnTimer:=@InstallOnTimer
  3802. Interval:=10;
  3803. Enabled:=True;
  3804. end;
  3805.  
  3806. FinishLabel1:= TLabel.Create(WizardForm);
  3807. with FinishLabel1 do
  3808. begin
  3809. Parent:=WizardForm;
  3810. SetBounds(20,70,0,0);
  3811. with Font do
  3812. begin
  3813. Name:='Segoe UI Light';
  3814. Size:=18;
  3815. #ifdef Dark
  3816. Color:=$FFFFFF;
  3817. #else
  3818. Color:=$252525
  3819. #endif
  3820. end;
  3821. Caption:='Completing the {#AppName} Install Wizard';
  3822. OnMouseDown:=@WFMouseDown;
  3823. end;
  3824.  
  3825. FinishLabel2:= TLabel.Create(WizardForm);
  3826. with FinishLabel2 do
  3827. begin
  3828. Parent:=WizardForm;
  3829. SetBounds(20,110,0,0);
  3830. with Font do
  3831. begin
  3832. Name:='Segoe UI Light';
  3833. Size:=11;
  3834. #ifdef Dark
  3835. Color:=$AAAAAA;
  3836. #else
  3837. Color:=$222222;
  3838. #endif
  3839. end;
  3840. Caption:='Installer has finished installing the product on your computer'+#13+
  3841. '{#AppName} has been installed successfully.';
  3842. OnMouseDown:=@WFMouseDown;
  3843. end;
  3844.  
  3845. FinishLabel3:= TLabel.Create(WizardForm);
  3846. with FinishLabel3 do begin
  3847. Parent:=WizardForm;
  3848. SetBounds(20,370,0,0);
  3849. with Font do
  3850. begin
  3851. Name:='Segoe UI Light';
  3852. Size:=13;
  3853. Color:=MetroColor(CurCol);
  3854. end;
  3855. Caption:=Lowercase('Click Finish to Close Install Wizard or Uninstall to Rollback changes made.');
  3856. OnMouseDown:=@WFMouseDown;
  3857. end;
  3858.  
  3859. NextBtn:=ButtonCreate(WizardForm,692,400,88,26,False,mrNone);
  3860. ButtonSetText(NextBtn,'Proceed');
  3861. ButtonSetEvent(NextBtn,@NextBtnClick);
  3862. BackBtn:=ButtonCreate(WizardForm,20,400,88,26,False,mrNone);
  3863. ButtonSetText(BackBtn,'Close');
  3864. ButtonSetEvent(BackBtn,@BackBtnClick);
  3865. BrowseBtn:=ButtonCreate(WizardForm,SelectDirLabel2.Width - 5,195,30,20,False,mrNone);
  3866. ButtonSetText(BrowseBtn,'...');
  3867. ButtonSetEvent(BrowseBtn,@BrowseBtnClick);
  3868.  
  3869. DesktopChk:=CheckBoxCreate(WizardForm,40,225,16,16,'Create a desktop icon');
  3870. CheckBoxSetChecked(DesktopChk,True);
  3871. #ifdef Redist1
  3872. Redist1:=CheckBoxCreate(WizardForm,240,225,16,16,'Install {#R1[59]}');
  3873. CheckBoxSetChecked(Redist1,True);
  3874. #ifdef Redist2
  3875. Redist2:=CheckBoxCreate(WizardForm,240,245,16,16,'Install {#R2[59]}');
  3876. CheckBoxSetChecked(Redist2,True);
  3877. #ifdef Redist3
  3878. Redist3:=CheckBoxCreate(WizardForm,240,265,16,16,'Install {#R3[59]}');
  3879. CheckBoxSetChecked(Redist3,True);
  3880. #ifdef Redist4
  3881. Redist4:=CheckBoxCreate(WizardForm,240,285,16,16,'Install {#R4[59]}');
  3882. CheckBoxSetChecked(Redist4,True);
  3883. #ifdef Redist5
  3884. Redist5:=CheckBoxCreate(WizardForm,240,305,16,16,'Install {#R5[59]}');
  3885. CheckBoxSetChecked(Redist5,True);
  3886. #endif
  3887. #endif
  3888. #endif
  3889. #endif
  3890. #endif
  3891.  
  3892. SelectDirEdt:=EditCreate(WizardForm,20,195,SelectDirLabel2.Width - 30,20);
  3893. EditSetText(SelectDirEdt,MinimizePathName(WizardForm.DirEdit.Text, SelectDirEdt.Top.Font, SelectDirEdt.Top.Width));
  3894.  
  3895. InstallPBr:=ProgressCreate(WizardForm,20,195,400,16);
  3896. ProgressSetProgress(InstallPBr,0);
  3897.  
  3898. {Cancel Form}
  3899. CancelForm:= CreateCustomForm();
  3900. with CancelForm do
  3901. begin
  3902. BorderStyle:= bsNone;
  3903. ClientWidth:=800;
  3904. ClientHeight:=448;
  3905. Center;
  3906. FormStyle:= fsStayOnTop;
  3907. #ifdef Dark
  3908. Color:=$252525;
  3909. #else
  3910. Color:=$FFFFFF;
  3911. #endif
  3912. BringToFront;
  3913. Caption:=WizardForm.Caption;
  3914. OnShow:=@CFShow;
  3915. end;
  3916.  
  3917. #ifdef Image
  3918. ImgLoad(CancelForm.Handle,ExpandConstant('{tmp}\Setup1.jpg'),0,0,CancelForm.ClientWidth,CancelForm.ClientHeight,True,True);
  3919. #ifdef Dark
  3920. ImgLoad(CancelForm.Handle,ExpandConstant('{tmp}\Dark.png'),0,0,CancelForm.ClientWidth,CancelForm.ClientHeight,True,True);
  3921. #else
  3922. ImgLoad(CancelForm.Handle,ExpandConstant('{tmp}\Light.png'),0,0,CancelForm.ClientWidth,CancelForm.ClientHeight,True,True);
  3923. #endif
  3924. ImgApplyChanges(CancelForm.Handle);
  3925. #endif
  3926.  
  3927. with TTimer.Create(CancelForm) do
  3928. begin
  3929. OnTimer:=@CFMoved;
  3930. Interval:=2;
  3931. Enabled:=True;
  3932. end;
  3933.  
  3934. with TLabel.Create(CancelForm) do
  3935. begin
  3936. Parent:= CancelForm;
  3937. Left:= 0;
  3938. Top:= 0;
  3939. Width:= CancelForm.ClientWidth;
  3940. Height:= CancelForm.ClientHeight;
  3941. AutoSize:= false;
  3942. Transparent:= true;
  3943. WordWrap:= False;
  3944. OnMouseDown:=@CFMouseDown;
  3945. end;
  3946.  
  3947. with TPanel.Create(CancelForm) do
  3948. begin
  3949. Parent:=CancelForm;
  3950. Left:=0;
  3951. Top:=15;
  3952. Width:=10;
  3953. Height:=50;
  3954. Color:=MetroColor(CurCol);
  3955. BorderStyle := bsNone;
  3956. BevelInner := bvNone;
  3957. BevelOuter := bvNone;
  3958. BorderWidth := 0;
  3959. ParentBackground := False;
  3960. OnMouseDown:=@CFMouseDown;
  3961. end;
  3962.  
  3963. with TPanel.Create(CancelForm) do
  3964. begin
  3965. Parent:=CancelForm;
  3966. Left:=0;
  3967. Top:=CancelForm.ClientHeight - 5;
  3968. Width:=CancelForm.ClientWidth;
  3969. Height:=5;
  3970. Color:=MetroColor(CurCol);
  3971. BorderStyle := bsNone;
  3972. BevelInner := bvNone;
  3973. BevelOuter := bvNone;
  3974. BorderWidth := 0;
  3975. ParentBackground := False;
  3976. OnMouseDown:=@CFMouseDown;
  3977. end;
  3978.  
  3979. with TLabel.Create(CancelForm) do
  3980. begin
  3981. Parent:=CancelForm;
  3982. SetBounds(20,10,0,0);
  3983. with Font do
  3984. begin
  3985. Name:='Segoe UI';
  3986. Size:=11;
  3987. Color:=MetroColor(CurCol);
  3988. end;
  3989. Caption:=Uppercase('{#AppName}');
  3990. OnMouseDown:=@CFMouseDown;
  3991. end;
  3992.  
  3993. with TLabel.Create(CancelForm) do
  3994. begin
  3995. Parent:=CancelForm;
  3996. AutoSize:=False;
  3997. SetBounds(2,CancelForm.ClientHeight-18,CancelForm.ClientWidth-4,18);
  3998. with Font do
  3999. begin
  4000. Name:='Segoe UI SemiBold';
  4001. Size:=7;
  4002. Color:=MetroColor(CurCol);
  4003. end;
  4004. Alignment:=taRightJustify;
  4005. Caption:=Uppercase('{#Watermark}');
  4006. OnMouseDown:=@CFMouseDown;
  4007. end;
  4008.  
  4009. with TLabel.Create(CancelForm) do
  4010. begin
  4011. Parent:=CancelForm;
  4012. SetBounds(20,20,0,0);
  4013. with Font do
  4014. begin
  4015. Name:='Segoe UI Light';
  4016. Size:=27;
  4017. Color:=MetroColor(CurCol);
  4018. end;
  4019. Caption:='Cancel';
  4020. OnMouseDown:=@CFMouseDown;
  4021. end;
  4022.  
  4023. with TLabel.Create(CancelForm) do
  4024. begin
  4025. Parent:=CancelForm;
  4026. SetBounds(20,70,0,0);
  4027. with Font do
  4028. begin
  4029. Name:='Segoe UI Light';
  4030. Size:=18;
  4031. #ifdef Dark
  4032. Color:=$FFFFFF;
  4033. #else
  4034. Color:=$252525;
  4035. #endif
  4036. end;
  4037. Caption:='Are you sure that you want to close installer wizard?';
  4038. OnMouseDown:=@CFMouseDown;
  4039. end;
  4040.  
  4041. with TLabel.Create(CancelForm) do
  4042. begin
  4043. Parent:=CancelForm;
  4044. SetBounds(20,110,0,0);
  4045. with Font do
  4046. begin
  4047. Name:='Segoe UI Light';
  4048. Size:=11;
  4049. #ifdef Dark
  4050. Color:=$AAAAAA;
  4051. #else
  4052. Color:=$222222;
  4053. #endif
  4054. end;
  4055. Caption:='This action closes installer wizard.'+#13+
  4056. 'The product you are installing would not be installed.'+#13+
  4057. 'You can re-install this product later on if not now.';
  4058. OnMouseDown:=@CFMouseDown;
  4059. end;
  4060.  
  4061. CancelYesBtn:=ButtonCreate(CancelForm,692,400,88,26,False,mrYes);
  4062. ButtonSetText(CancelYesBtn,'Yes');
  4063. ButtonSetEvent(CancelYesBtn,@CancelYesBtnClick);
  4064. CancelNoBtn:=ButtonCreate(CancelForm,592,400,88,26,False,mrNo);
  4065. ButtonSetText(CancelNoBtn,'No');
  4066. ButtonSetEvent(CancelNoBtn,@CancelNoBtnClick);
  4067.  
  4068. TitleLabel3:= TLabel.Create(WizardForm);
  4069. with TitleLabel3 do
  4070. begin
  4071. Parent:=WizardForm;
  4072. SetBounds(690,10,0,0);
  4073. with Font do
  4074. begin
  4075. Name:='Segoe UI';
  4076. Size:=11;
  4077. Color:=MetroColor(CurCol);
  4078. end;
  4079. OnClick:=@MinimizeBtnClick;
  4080. Caption:=Uppercase('Minimize');
  4081. BringToFront;
  4082. end;
  4083.  
  4084. TitleLabel4:= TLabel.Create(WizardForm);
  4085. with TitleLabel4 do
  4086. begin
  4087. Parent:=WizardForm;
  4088. SetBounds((TitleLabel3.Left + TitleLabel3.Width) + 5,10,0,0);
  4089. with Font do
  4090. begin
  4091. Name:='Segoe UI';
  4092. Size:=11;
  4093. Color:=MetroColor(CurCol);
  4094. end;
  4095. OnClick:=@CloseBtnClick;
  4096. Caption:=Uppercase('Exit');
  4097. BringToFront;
  4098. end;
  4099. end;
  4100.  
  4101. function ShowCancelBox:Integer;
  4102. begin
  4103. Result:=CancelForm.ShowModal;
  4104. end;
  4105.  
  4106. procedure CurPageChanged(CurPageID: Integer);
  4107. begin
  4108. WelcomeLabel1.Hide;
  4109. WelcomeLabel2.Hide;
  4110. WelcomeLabel3.Hide;
  4111. SelectDirLabel1.Hide;
  4112. SelectDirLabel2.Hide;
  4113. SelectDirLabel3.Hide;
  4114. InstallLabel1.Hide;
  4115. InstallLabel2.Hide;
  4116. InstallLabel3.Hide;
  4117. InstallLabel4.Hide;
  4118. FinishLabel1.Hide;
  4119. FinishLabel2.Hide;
  4120. FinishLabel3.Hide;
  4121. WizardForm.DirEdit.Hide;
  4122. ButtonSetVisibility(BrowseBtn,False);
  4123. CheckBoxSetVisibility(DesktopChk,False);
  4124. #ifdef Redist1
  4125. CheckBoxSetVisibility(Redist1,False);
  4126. #ifdef Redist2
  4127. CheckBoxSetVisibility(Redist2,False);
  4128. #ifdef Redist3
  4129. CheckBoxSetVisibility(Redist3,False);
  4130. #ifdef Redist4
  4131. CheckBoxSetVisibility(Redist4,False);
  4132. #ifdef Redist5
  4133. CheckBoxSetVisibility(Redist5,False);
  4134. #endif
  4135. #endif
  4136. #endif
  4137. #endif
  4138. #endif
  4139. EditSetVisibility(SelectDirEdt,False);
  4140. ProgressSetVisibility(InstallPBr,False);
  4141. case CurPageID of
  4142. wpWelcome:
  4143. begin
  4144. WelcomeLabel1.Show;
  4145. WelcomeLabel2.Show;
  4146. WelcomeLabel3.Show;
  4147. StatusLabel1.Left:=20;
  4148. StatusLabel1.Font.Color:=MetroColor(CurCol);
  4149. StatusLabel2.Left:=(StatusLabel1.Left + StatusLabel1.Width) + 10;
  4150. #ifdef Dark
  4151. StatusLabel2.Font.Color:=$AAAAAA;
  4152. #else
  4153. StatusLabel2.Font.Color:=$222222;
  4154. #endif
  4155. StatusLabel3.Left:=(StatusLabel2.Left + StatusLabel2.Width) + 10;
  4156. #ifdef Dark
  4157. StatusLabel3.Font.Color:=$AAAAAA;
  4158. #else
  4159. StatusLabel3.Font.Color:=$222222;
  4160. #endif
  4161. StatusLabel4.Left:=(StatusLabel3.Left + StatusLabel3.Width) + 10;
  4162. #ifdef Dark
  4163. StatusLabel4.Font.Color:=$AAAAAA;
  4164. #else
  4165. StatusLabel4.Font.Color:=$222222;
  4166. #endif
  4167. ButtonSetText(BackBtn,'Close');
  4168. ButtonSetText(NextBtn,'Proceed');
  4169. end;
  4170. wpSelectDir:
  4171. begin
  4172. SelectDirLabel1.Show;
  4173. SelectDirLabel2.Show;
  4174. SelectDirLabel3.Show;
  4175. StatusLabel1.Font.Color:=MetroColor(CurCol);
  4176. StatusLabel2.Left:=(StatusLabel1.Left + StatusLabel1.Width) + 10;
  4177. #ifdef Dark
  4178. StatusLabel2.Font.Color:=$AAAAAA;
  4179. #else
  4180. StatusLabel2.Font.Color:=$222222;
  4181. #endif
  4182. StatusLabel3.Left:=(StatusLabel2.Left + StatusLabel2.Width) + 10;
  4183. #ifdef Dark
  4184. StatusLabel3.Font.Color:=$AAAAAA;
  4185. #else
  4186. StatusLabel3.Font.Color:=$222222;
  4187. #endif
  4188. StatusLabel4.Left:=(StatusLabel3.Left + StatusLabel3.Width) + 10;
  4189. #ifdef Dark
  4190. StatusLabel4.Font.Color:=$AAAAAA;
  4191. #else
  4192. StatusLabel4.Font.Color:=$222222;
  4193. #endif
  4194. ButtonSetVisibility(BrowseBtn,True);
  4195. CheckBoxSetVisibility(DesktopChk,True);
  4196. #ifdef Redist1
  4197. CheckBoxSetVisibility(Redist1,True);
  4198. #ifdef Redist2
  4199. CheckBoxSetVisibility(Redist2,True);
  4200. #ifdef Redist3
  4201. CheckBoxSetVisibility(Redist3,True);
  4202. #ifdef Redist4
  4203. CheckBoxSetVisibility(Redist4,True);
  4204. #ifdef Redist5
  4205. CheckBoxSetVisibility(Redist5,True);
  4206. #endif
  4207. #endif
  4208. #endif
  4209. #endif
  4210. #endif
  4211. EditSetVisibility(SelectDirEdt,True);
  4212. ButtonSetText(BackBtn,'Back');
  4213. ButtonSetText(NextBtn,'Install');
  4214. end;
  4215. wpInstalling:
  4216. begin
  4217. InstallLabel1.Show;
  4218. InstallLabel2.Show;
  4219. InstallLabel3.Show;
  4220. InstallLabel4.Show;
  4221. StatusLabel1.Font.Color:=MetroColor(CurCol);
  4222. StatusLabel2.Left:=(StatusLabel1.Left + StatusLabel1.Width) + 10;
  4223. #ifdef Dark
  4224. StatusLabel2.Font.Color:=$AAAAAA;
  4225. #else
  4226. StatusLabel2.Font.Color:=$222222;
  4227. #endif
  4228. StatusLabel3.Left:=(StatusLabel2.Left + StatusLabel2.Width) + 10;
  4229. #ifdef Dark
  4230. StatusLabel3.Font.Color:=$AAAAAA;
  4231. #else
  4232. StatusLabel3.Font.Color:=$222222;
  4233. #endif
  4234. StatusLabel4.Left:=(StatusLabel3.Left + StatusLabel3.Width) + 10;
  4235. #ifdef Dark
  4236. StatusLabel4.Font.Color:=$AAAAAA;
  4237. #else
  4238. StatusLabel4.Font.Color:=$222222;
  4239. #endif
  4240. ButtonSetVisibility(BackBtn,False);
  4241. ButtonSetText(NextBtn,'Cancel');
  4242. ProgressSetVisibility(InstallPBr,True);
  4243. end;
  4244. wpFinished:
  4245. begin
  4246. FinishLabel1.Show;
  4247. FinishLabel2.Show;
  4248. FinishLabel3.Show;
  4249. StatusLabel1.Font.Color:=MetroColor(CurCol);
  4250. StatusLabel2.Left:=(StatusLabel1.Left + StatusLabel1.Width) + 10;
  4251. #ifdef Dark
  4252. StatusLabel2.Font.Color:=$AAAAAA;
  4253. #else
  4254. StatusLabel2.Font.Color:=$222222;
  4255. #endif
  4256. StatusLabel3.Left:=(StatusLabel2.Left + StatusLabel2.Width) + 10;
  4257. #ifdef Dark
  4258. StatusLabel3.Font.Color:=$AAAAAA;
  4259. #else
  4260. StatusLabel3.Font.Color:=$222222;
  4261. #endif
  4262. StatusLabel4.Left:=(StatusLabel3.Left + StatusLabel3.Width) + 10;
  4263. #ifdef Dark
  4264. StatusLabel4.Font.Color:=$AAAAAA;
  4265. #else
  4266. StatusLabel4.Font.Color:=$222222;
  4267. #endif
  4268. ButtonSetVisibility(BackBtn,True);
  4269. ButtonSetText(BackBtn,'Uninstall');
  4270. ButtonSetText(NextBtn,'Finish');
  4271. end;
  4272. end;
  4273. end;
  4274.  
  4275. procedure CurStepChanged(CurStep: TSetupStep);
  4276. var
  4277. ResultCode, i, x: Integer;
  4278. MsgResult: INT_PTR;
  4279. PCF, sourcedir, arcstr: String;
  4280. begin
  4281. if CurStep = ssInstall then
  4282. begin
  4283. #if ReadIni(SourcePath + "\WindowsPhone.iss", "Archives", "Archive1Type", "") != ""
  4284.  
  4285.  
  4286. // Reflate Tools's Extraction
  4287. (*
  4288. ExtractTemporaryFile('7z.dll');
  4289. ExtractTemporaryFile('reflate.exe');
  4290. ExtractTemporaryFile('rawdet.exe');
  4291. ExtractTemporaryFile('rawrest.exe');
  4292. ExtractTemporaryFile('raw2hif.exe'); *)
  4293.  
  4294. // Core Files
  4295. ExtractTemporaryFile('unarc.dll');
  4296. ExtractTemporaryFile('unrar.dll');
  4297. ExtractTemporaryFile('zlib1.dll');
  4298. ExtractTemporaryFile('arc.ini');
  4299. ExtractTemporaryFile('english.ini');
  4300. ExtractTemporaryFile('CLS-MSC.dll');
  4301. ExtractTemporaryFile('CLS-precomp.dll');
  4302. ExtractTemporaryFile('CLS-srep.dll');
  4303. ExtractTemporaryFile('facompress.dll');
  4304. ExtractTemporaryFile('facompress_mt.dll');
  4305.  
  4306.  
  4307. // External Support Files
  4308. ExtractTemporaryFile('lzt.exe');
  4309. ExtractTemporaryFile('nz64.exe');
  4310. ExtractTemporaryFile('srep.exe');
  4311. ExtractTemporaryFile('srep64.exe');
  4312. ExtractTemporaryFile('zstd.exe');
  4313. ExtractTemporaryFile('dec.exe');
  4314. ExtractTemporaryFile('packjpg.exe');
  4315. ExtractTemporaryFile('packjpg_dll.dll');
  4316. ExtractTemporaryFile('packjpg_dll1.dll');
  4317. ExtractTemporaryFile('precomp.exe');
  4318.  
  4319.  
  4320. #endif
  4321. #if ReadIni(SourcePath + "\WindowsPhone.iss", "Archives", "Archive1Type", "") != ""
  4322. #define PCF ReadIni(AddBackSlash(SourcePath) + "WindowsPhone.iss", "Archives", "PrecompVer", "0.42")
  4323. PCF:='{#PCF}';
  4324. if PCF = '0.38' then
  4325. FileCopy(ExpandConstant('{tmp}\precomp038.exe'),ExpandConstant('{tmp}\precomp.exe'),False);
  4326. if PCF = '0.40' then
  4327. FileCopy(ExpandConstant('{tmp}\precomp040.exe'),ExpandConstant('{tmp}\precomp.exe'),False);
  4328. if PCF = '0.41' then
  4329. FileCopy(ExpandConstant('{tmp}\precomp041.exe'),ExpandConstant('{tmp}\precomp.exe'),False);
  4330. if PCF = '0.42' then
  4331. FileCopy(ExpandConstant('{tmp}\precomp042.exe'),ExpandConstant('{tmp}\precomp.exe'),False);
  4332. if PCF = '0.43' then
  4333. FileCopy(ExpandConstant('{tmp}\precomp043.exe'),ExpandConstant('{tmp}\precomp.exe'),False);
  4334. #if ReadIni(AddBackSlash(SourcePath) + "WindowsPhone.iss", "Archives", "Archive1Type", "") != ""
  4335. ISDoneError:=false;
  4336. if ISDoneInit(ExpandConstant('{tmp}\records.inf'), $F777, 0,0,0, MainForm.Handle, 512, @ProgressCallback) then begin
  4337. repeat
  4338. ChangeLanguage('English');
  4339. if not SrepInit('',512,0) then
  4340. ISDoneError := True;
  4341. if not PrecompInit('',128,0) then
  4342. ISDoneError := True;
  4343. if not FileSearchInit(true) then
  4344. ISDoneError := True;
  4345. #sub Data1
  4346. SetArrayLength(Data,{#i});
  4347. SetArrayLength(Data[{#i} - 1].Arc,5);
  4348. #endsub
  4349. #if ReadIni(AddBackSlash(SourcePath) + "WindowsPhone.iss", "Archives", "Archive1Type", "") != ""
  4350. #for {i = 1; ReadIni(AddBackSlash(SourcePath) + "WindowsPhone.iss", "Archives", StringChange("ArchiveIntType","Int", Str(i)), "") !=""; i++} Data1
  4351. #endif
  4352. #sub Data2
  4353. #define DataInf1 ReadIni(AddBackSlash(SourcePath) + "WindowsPhone.iss", "Archives", "Archive" + Str(i) + "Type", "")
  4354. #define DataInf2 ReadIni(AddBackSlash(SourcePath) + "WindowsPhone.iss", "Archives", "Archive" + Str(i) + "Source", "")
  4355. #define DataInf3 ReadIni(AddBackSlash(SourcePath) + "WindowsPhone.iss", "Archives", "Archive" + Str(i) + "Output", "")
  4356. #define DataInf4 ReadIni(AddBackSlash(SourcePath) + "WindowsPhone.iss", "Archives", "Archive" + Str(i) + "Disk", "1")
  4357. #define DataInf5 ReadIni(AddBackSlash(SourcePath) + "WindowsPhone.iss", "Archives", "Archive" + Str(i) + "Password", "")
  4358. Data[{#i} - 1].Arc[0]:='{#DataInf1}';
  4359. Data[{#i} - 1].Arc[1]:=ExpandConstant('{#DataInf2}');
  4360. Data[{#i} - 1].Arc[2]:=ExpandConstant('{#DataInf3}');
  4361. Data[{#i} - 1].Arc[3]:='{#DataInf4}';
  4362. Data[{#i} - 1].Arc[4]:='{#DataInf5}';
  4363. #endsub
  4364. #if ReadIni(AddBackSlash(SourcePath) + "WindowsPhone.iss", "Archives", "Archive1Type", "") != ""
  4365. #for {i = 1; ReadIni(AddBackSlash(SourcePath) + "WindowsPhone.iss", "Archives", StringChange("ArchiveIntType","Int", Str(i)), "") !=""; i++} Data2
  4366. #endif
  4367.  
  4368. Wizardform.ProgressGauge.Max:=0;
  4369. x:=0;
  4370. if Data[0].Arc[0] <> '' then
  4371. begin
  4372. repeat
  4373. x:= x + 1;
  4374. Wizardform.ProgressGauge.Max:=Wizardform.ProgressGauge.Max + 1000;
  4375. until x = GetArrayLength(Data);
  4376. end;
  4377. sourcedir:=ExpandConstant('{src}');
  4378. i := 0;
  4379. if Data[0].Arc[0] <> '' then
  4380. begin
  4381. repeat
  4382. i:= i + 1;
  4383. if Pos('{src}',Data[i - 1].Arc[1]) <> 0 then
  4384. arcstr:=ConstConv(Data[i - 1].Arc[1],sourcedir)
  4385. else
  4386. arcstr:=ExpandConstant(Data[i - 1].Arc[1]);
  4387. if Data[i - 1].Arc[0] = 'Freearc' then
  4388. begin
  4389. if not FileExists(arcstr) then
  4390. begin
  4391. repeat
  4392. MsgResult:=MsgBox(ExtractFileName(Data[i - 1].Arc[1]) + ' was not found.'+#13 +
  4393. 'Please Insert disc ' + Data[i - 1].Arc[3] + ' with ' + ExtractFileName(Data[i - 1].Arc[1]) + ' file', mbConfirmation, MB_ABORTRETRYIGNORE);
  4394. if MsgResult = mrAbort then
  4395. ISDoneError := True;
  4396. if MsgResult = mrIgnore then
  4397. Break;
  4398. if Pos('{src}',Data[i - 1].Arc[1]) <> 0 then
  4399. arcstr:=ConstConv(Data[i - 1].Arc[1],sourcedir)
  4400. else
  4401. arcstr:=ExpandConstant(Data[i - 1].Arc[1]);
  4402. until (FileExists(arcstr) = True) or (ISDoneError = True)
  4403. end else
  4404. if ISDoneError = False then
  4405. if not ISArcExtract ( 0, 0, arcstr, Data[i - 1].Arc[2], '', false, Data[i - 1].Arc[4], ExpandConstant('{tmp}\arc.ini'), Data[i - 1].Arc[2], false) then
  4406. ISDoneError := True;
  4407. end;
  4408.  
  4409. if Data[i - 1].Arc[0] = 'WinRAR' then
  4410. begin
  4411. if not FileExists(arcstr) then
  4412. begin
  4413. repeat
  4414. MsgResult:=MsgBox(ExtractFileName(Data[i - 1].Arc[1]) + ' was not found.'+#13 +
  4415. 'Please Insert disc ' + Data[i - 1].Arc[3] + ' with ' + ExtractFileName(Data[i - 1].Arc[1]) + ' file', mbConfirmation, MB_ABORTRETRYIGNORE);
  4416. if MsgResult = mrAbort then
  4417. ISDoneError := True;
  4418. if MsgResult = mrIgnore then
  4419. Break;
  4420. if Pos('{src}',Data[i - 1].Arc[1]) <> 0 then
  4421. arcstr:=ConstConv(Data[i - 1].Arc[1],sourcedir)
  4422. else
  4423. arcstr:=ExpandConstant(Data[i - 1].Arc[1]);
  4424. until (FileExists(arcstr) = True) or (ISDoneError = True)
  4425. end else
  4426. if ISDoneError = False then
  4427. if not ISRarExtract ( 0, 0, arcstr, Data[i - 1].Arc[2], false, Data[i - 1].Arc[4]) then
  4428. ISDoneError := True;
  4429. end;
  4430.  
  4431. if Data[i - 1].Arc[0] = '7Zip' then
  4432. begin
  4433. if not FileExists(arcstr) then
  4434. begin
  4435. repeat
  4436. MsgResult:=MsgBox(ExtractFileName(Data[i - 1].Arc[1]) + ' was not found.'+#13 +
  4437. 'Please Insert disc ' + Data[i - 1].Arc[3] + ' with ' + ExtractFileName(Data[i - 1].Arc[1]) + ' file', mbConfirmation, MB_ABORTRETRYIGNORE);
  4438. if MsgResult = mrAbort then
  4439. ISDoneError := True;
  4440. if MsgResult = mrIgnore then
  4441. Break;
  4442. if Pos('{src}',Data[i - 1].Arc[1]) <> 0 then
  4443. arcstr:=ConstConv(Data[i - 1].Arc[1],sourcedir)
  4444. else
  4445. arcstr:=ExpandConstant(Data[i - 1].Arc[1]);
  4446. until (FileExists(arcstr) = True) or (ISDoneError = True)
  4447. end else
  4448. if ISDoneError = False then
  4449. if not IS7ZipExtract ( 0, 0, arcstr, Data[i - 1].Arc[2], false, Data[i - 1].Arc[4]) then
  4450. ISDoneError := True;
  4451. end;
  4452.  
  4453. if ISDoneError = True then
  4454. break;
  4455. until i = GetArrayLength(Data);
  4456. end;
  4457. until true;
  4458. ISDoneStop;
  4459. end;
  4460. #endif
  4461. #endif
  4462. end;
  4463. if (CurStep = ssPostInstall) and ISDoneError then
  4464. begin
  4465. Exec(ExpandConstant('{uninstallexe}'),'/verysilent','',SW_HIDE, ewWaitUntilTerminated, ResultCode);
  4466. DelTree(ExpandConstant('{app}'), True, True, True);
  4467. end;
  4468. if (CurStep = ssPostInstall) and not ISDoneError then
  4469. begin
  4470. #ifdef Redist1
  4471. #ifdef Image
  4472. WizardAniBar:=AniCreate(WizardForm,0,0,650,4,False);
  4473. #else
  4474. WizardAniBar:=AniCreate(WizardForm,0,0,WizardLock.Tile.Width,4,False);
  4475. #endif
  4476. if InstallRedist(1) then
  4477. begin
  4478. InstallLabel4.Caption:='Installing {#R1[59]}';
  4479. Exec(ExpandConstant('{src}\{#R1[60]}'), '{#R1[61]}', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
  4480. end;
  4481. #ifdef Redist2
  4482. if InstallRedist(2) then
  4483. begin
  4484. InstallLabel4.Caption:='Installing {#R2[59]}';
  4485. Exec(ExpandConstant('{src}\{#R2[60]}'), '{#R2[61]}', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
  4486. end;
  4487. #ifdef Redist3
  4488. if InstallRedist(3) then
  4489. begin
  4490. InstallLabel4.Caption:='Installing {#R3[59]}';
  4491. Exec(ExpandConstant('{src}\{#R3[60]}'), '{#R3[61]}', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
  4492. end;
  4493. #ifdef Redist4
  4494. if InstallRedist(4) then
  4495. begin
  4496. InstallLabel4.Caption:='Installing {#R4[59]}';
  4497. Exec(ExpandConstant('{src}\{#R4[60]}'), '{#R4[61]}', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
  4498. end;
  4499. #ifdef Redist5
  4500. if InstallRedist(5) then
  4501. begin
  4502. InstallLabel4.Caption:='Installing {#R5[59]}';
  4503. Exec(ExpandConstant('{src}\{#R5[60]}'), '{#R5[61]}', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
  4504. end;
  4505. #endif
  4506. #endif
  4507. #endif
  4508. #endif
  4509. //AniSetVisibility(WizardAniBar,False);
  4510. //AniSetVisibility(LockScreenAniBar,False);
  4511. //AniSetEnabled(WizardAniBar,False);
  4512. //AniSetEnabled(LockScreenAniBar,False);
  4513. #endif
  4514. end;
  4515. end;
  4516.  
  4517. procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
  4518. var
  4519. ResultCode: Integer;
  4520. begin
  4521. SuspendProc;
  4522. Confirm:=False;
  4523. if ShowCancelBox = mrYes then
  4524. Cancel:=True
  4525. else
  4526. Cancel:=False;
  4527. if Cancel then
  4528. InstallLabel4.Caption:='Rolling back changes...';
  4529. if CurPageID=wpInstalling then
  4530. begin
  4531. if Cancel then
  4532. begin
  4533. ISDoneError:=True;
  4534. ISDoneCancel:=1;
  4535. WizardForm.CancelButton.Enabled:=False;
  4536. ButtonSetEnabled(NextBtn,False);
  4537. end;
  4538. end;
  4539. ResumeProc;
  4540. end;
  4541.  
  4542. function ShouldSkipPage(PageID: Integer): Boolean;
  4543. begin
  4544. if (PageID <> wpWelcome) and (PageID <> wpSelectDir) and (PageID <> wpInstalling) and (PageID <> wpFinished) then
  4545. Result:=True
  4546. else
  4547. Result:=False;
  4548. if (ISDoneError = True) and (PageID = wpFinished) then
  4549. Result:=True;
  4550. end;
  4551.  
  4552. procedure DeinitializeSetup;
  4553. begin
  4554. if FileExists(ExpandConstant('{tmp}\botva2.dll')) then
  4555. gdipShutdown;
  4556. end;
  4557.  
  4558. procedure UninstallOnTimer(Sender: TObject);
  4559. var
  4560. pr, i1, i2: Extended;
  4561. begin
  4562. if (UninstallProgressForm.ProgressBar.Position>UninstallProgressForm.ProgressBar.Min) then begin
  4563. i1:=UninstallProgressForm.ProgressBar.Position-UninstallProgressForm.ProgressBar.Min;
  4564. i2:=UninstallProgressForm.ProgressBar.Max-UninstallProgressForm.ProgressBar.Min;
  4565. pr:=i1*100/i2;
  4566. ProgressSetProgress(InstallPBr,pr);
  4567. end;
  4568. end;
  4569.  
  4570. function InitializeUninstall: Boolean;
  4571. begin
  4572. FileCopy(ExpandConstant('{app}\Uninstall\botva2.dll'),ExpandConstant('{tmp}\botva2.dll'),False);
  4573. FileCopy(ExpandConstant('{app}\Uninstall\dark.png'),ExpandConstant('{tmp}\dark.png'),False);
  4574. FileCopy(ExpandConstant('{app}\Uninstall\light.png'),ExpandConstant('{tmp}\light.png'),False);
  4575. FileCopy(ExpandConstant('{app}\Uninstall\Setup1.jpg'),ExpandConstant('{tmp}\Setup1.jpg'),False);
  4576. Result:=True;
  4577. end;
  4578.  
  4579. procedure InitializeUninstallProgressForm;
  4580. begin
  4581. #ifdef CurColor
  4582. CurCol:={#CurColor};
  4583. #else
  4584. CurCol:=1;
  4585. #endif
  4586. with UninstallProgressForm do
  4587. begin
  4588. BorderStyle:=bsNone;
  4589. ClientWidth:=800;
  4590. ClientHeight:=448;
  4591. Center;
  4592. #ifdef Dark
  4593. Color:=$252525;
  4594. #else
  4595. Color:=$FFFFFF;
  4596. #endif
  4597. OuterNotebook.Hide;
  4598. InnerNotebook.Hide;
  4599. Bevel.Hide;
  4600. PageNameLabel.Hide;
  4601. PageDescriptionLabel.Hide;
  4602. MainPanel.Hide;
  4603. ProgressBar.Hide;
  4604. CancelButton.Visible:=False;
  4605. end;
  4606.  
  4607. #ifdef Image
  4608. ImgLoad(UninstallProgressForm.Handle,ExpandConstant('{tmp}\Setup1.jpg'),0,0,UninstallProgressForm.ClientWidth,UninstallProgressForm.ClientHeight,True,True);
  4609. #ifdef Dark
  4610. ImgLoad(UninstallProgressForm.Handle,ExpandConstant('{tmp}\Dark.png'),0,0,UninstallProgressForm.ClientWidth,UninstallProgressForm.ClientHeight,True,True);
  4611. #else
  4612. ImgLoad(UninstallProgressForm.Handle,ExpandConstant('{tmp}\Light.png'),0,0,UninstallProgressForm.ClientWidth,UninstallProgressForm.ClientHeight,True,True);
  4613. #endif
  4614. ImgApplyChanges(UninstallProgressForm.Handle);
  4615. #endif
  4616.  
  4617. with TPanel.Create(UninstallProgressForm) do
  4618. begin
  4619. Parent:=UninstallProgressForm;
  4620. Left:=0;
  4621. Top:=15;
  4622. Width:=10;
  4623. Height:=50;
  4624. Color:=MetroColor(CurCol);
  4625. BorderStyle := bsNone;
  4626. BevelInner := bvNone;
  4627. BevelOuter := bvNone;
  4628. BorderWidth := 0;
  4629. ParentBackground := False;
  4630. end;
  4631.  
  4632. with TPanel.Create(UninstallProgressForm) do
  4633. begin
  4634. Parent:=UninstallProgressForm;
  4635. Left:=0;
  4636. Top:=UninstallProgressForm.ClientHeight - 5;
  4637. Width:=UninstallProgressForm.ClientWidth;
  4638. Height:=5;
  4639. Color:=MetroColor(CurCol);
  4640. BorderStyle := bsNone;
  4641. BevelInner := bvNone;
  4642. BevelOuter := bvNone;
  4643. BorderWidth := 0;
  4644. ParentBackground := False;
  4645. end;
  4646.  
  4647. with TLabel.Create(UninstallProgressForm) do
  4648. begin
  4649. Parent:=UninstallProgressForm;
  4650. SetBounds(20,10,0,0);
  4651. with Font do
  4652. begin
  4653. Name:='Segoe UI';
  4654. Size:=11;
  4655. Color:=MetroColor(CurCol);
  4656. end;
  4657. Caption:=Uppercase('{#AppName}');
  4658. end;
  4659.  
  4660. with TLabel.Create(UninstallProgressForm) do
  4661. begin
  4662. Parent:=UninstallProgressForm;
  4663. AutoSize:=False;
  4664. SetBounds(2,UninstallProgressForm.ClientHeight-18,UninstallProgressForm.ClientWidth-4,18);
  4665. with Font do
  4666. begin
  4667. Name:='Segoe UI SemiBold';
  4668. Size:=7;
  4669. Color:=MetroColor(CurCol);
  4670. end;
  4671. Alignment:=taRightJustify;
  4672. Caption:=Uppercase('{#Watermark}');
  4673. end;
  4674.  
  4675. with TLabel.Create(UninstallProgressForm) do
  4676. begin
  4677. Parent:=UninstallProgressForm;
  4678. SetBounds(20,20,0,0);
  4679. with Font do
  4680. begin
  4681. Name:='Segoe UI Light';
  4682. Size:=27;
  4683. Color:=MetroColor(CurCol);
  4684. end;
  4685. Caption:='Uninstallation';
  4686. end;
  4687.  
  4688. with TLabel.Create(UninstallProgressForm) do
  4689. begin
  4690. Parent:=UninstallProgressForm;
  4691. SetBounds(20,70,0,0);
  4692. with Font do
  4693. begin
  4694. Name:='Segoe UI Light';
  4695. Size:=18;
  4696. #ifdef Dark
  4697. Color:=$FFFFFF;
  4698. #else
  4699. Color:=$252525
  4700. #endif
  4701. end;
  4702. end;
  4703.  
  4704. with TLabel.Create(UninstallProgressForm) do
  4705. begin
  4706. Parent:=UninstallProgressForm;
  4707. SetBounds(20,110,0,0);
  4708. with Font do
  4709. begin
  4710. Name:='Segoe UI Light';
  4711. Size:=11;
  4712. #ifdef Dark
  4713. Color:=$AAAAAA;
  4714. #else
  4715. Color:=$222222;
  4716. #endif
  4717. end;
  4718. Caption:='Uninstaller Wizard is uninstalling the product.'+#13+
  4719. 'This might take a while.';
  4720. end;
  4721.  
  4722. InstallLabel3:= TLabel.Create(UninstallProgressForm);
  4723. with InstallLabel3 do
  4724. begin
  4725. Parent:=UninstallProgressForm;
  4726. SetBounds(20,175,0,0);
  4727. with Font do
  4728. begin
  4729. Name:='Segoe UI SemiBold';
  4730. Size:=9;
  4731. #ifdef Dark
  4732. Color:=$AAAAAA;
  4733. #else
  4734. Color:=$222222;
  4735. #endif
  4736. end;
  4737. Caption:='Status:';
  4738. end;
  4739.  
  4740. with TLabel.Create(UninstallProgressForm) do
  4741. begin
  4742. Parent:=UninstallProgressForm;
  4743. SetBounds((InstallLabel3.Left + InstallLabel3.Width) + 2,176,0,0);
  4744. with Font do
  4745. begin
  4746. Name:='Segoe UI Bold';
  4747. Size:=8;
  4748. Color:=MetroColor(CurCol);
  4749. end;
  4750. Caption:='Uninstalling...';
  4751. end;
  4752.  
  4753. InstallPBr:=ProgressCreate(UninstallProgressForm,20,195,400,16);
  4754. ProgressSetProgress(InstallPBr,0);
  4755.  
  4756. with TTimer.Create(UninstallProgressForm) do
  4757. begin
  4758. OnTimer:=@UninstallOnTimer;
  4759. Interval:=10;
  4760. Enabled:=True;
  4761. end;
  4762. end;
  4763.  
  4764. procedure DeinitializeUninstall;
  4765. begin
  4766. if FileExists(ExpandConstant('{tmp}\botva2.dll')) then
  4767. gdipShutdown;
  4768. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement