Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Windows Phone Installer v3.1 with Windows Phone Technology v4.2 based on Windows Phone 8
- //Script created by Razor12911
- //Inno Setup Enhanced Edition Unicode is Required for Script Compilation
- //Save script before compiling to update the changes since this is used as ini
- //For non-commercial use
- // Edited
- // This Script is totally by RAZOR12911
- // But I made some small Changes
- // --> Fasten Up Startup of Setup Wizard
- // --> Removed Lockscreen
- // --> Change some Label according to COREPACK Repacks
- // --> Added Red Colour (21)
- [Installer]
- Name=Far Cry 3 by WiNT3R Repack
- Publisher=WiNT3R
- Version=1.0.0
- Size=5088
- ;Files=D:\Far Cry 3 Complete Collection\Far Cry 3
- Watermark=Repacked by WiNT3R
- Autorun=0
- ;Enter Your Name
- Repacker=WiNT3R
- [Theme]
- ;Interface either be in dark or light
- ;Colors are Originally from OS Windows Phone 8 (01-21)
- ;21th is pure Red
- Image=1
- Dark=1
- Color=21
- [Execs]
- ;Tile Caption|Exec Directory|Exec File|Shortcut Name/Action Name
- AppExe1=Far Cry 3 All DLC||farcry3.exe|Far Cry 3
- ;AppExe2=Battlefield 4 (64-Bit)||bf4.exe|Play Battlefield(TM) 4 (64-Bit)
- [Redists]
- ;Redist Caption|Exec Directory + File|Arguments
- ;Redist1=Visual C 32|2010\vcredist_x86.exe|/silent
- ;Redist2=Visual C 64|2010\vcredist_x64.exe|/silent
- [Archives]
- ;Precomp 0.38
- ;Archive Types 7Zip, Freearc and WinRAR
- Precomp=0.38
- Archive1Type=Freearc
- Archive1Source={src}\data1.bin
- Archive1Output={app}
- Archive1Disk=1
- Archive1Password=Yourpassword
- [UninstallDelete]
- Type: filesandordirs; Name: {app}
- [Registry]
- ////////////////////////////////////////////////////////////////////////////////////////////
- /////////////////////////////////ADVANCED USERS CAN PROCEED/////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////////////
- #define i 0
- #define AppName ReadIni(SourcePath + "\WindowsPhone.iss", "Installer", "Name", "")
- #define AppPublisher ReadIni(SourcePath + "\WindowsPhone.iss", "Installer", "Publisher", "")
- #define AppVersion ReadIni(SourcePath + "\WindowsPhone.iss", "Installer", "Version", "1.0.0")
- #if ReadIni(SourcePath + "\WindowsPhone.iss", "Installer", "Files", "") != ""
- #define AppFiles ReadIni(SourcePath + "\WindowsPhone.iss", "Installer", "Files", "")
- #endif
- #define AppSize Int(ReadIni(SourcePath + "\WindowsPhone.iss", "Installer", "Size", "0"))
- #if ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe1", "") != ""
- #define AppExe1 ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe1", "")
- #if ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe2", "") != ""
- #define AppExe2 ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe2", "")
- #if ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe3", "") != ""
- #define AppExe3 ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe3", "")
- #if ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe4", "") != ""
- #define AppExe4 ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe4", "")
- #if ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe5", "") != ""
- #define AppExe5 ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe5", "")
- #if ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe6", "") != ""
- #define AppExe6 ReadIni(SourcePath + "\WindowsPhone.iss", "Execs", "AppExe6", "")
- #endif
- #endif
- #endif
- #endif
- #endif
- #endif
- #if ReadIni(SourcePath + "\WindowsPhone.iss", "Redists", "Redist1", "") != ""
- #define Redist1 ReadIni(SourcePath + "\WindowsPhone.iss", "Redists", "Redist1", "")
- #if ReadIni(SourcePath + "\WindowsPhone.iss", "Redists", "Redist2", "") != ""
- #define Redist2 ReadIni(SourcePath + "\WindowsPhone.iss", "Redists", "Redist2", "")
- #if ReadIni(SourcePath + "\WindowsPhone.iss", "Redists", "Redist3", "") != ""
- #define Redist3 ReadIni(SourcePath + "\WindowsPhone.iss", "Redists", "Redist3", "")
- #if ReadIni(SourcePath + "\WindowsPhone.iss", "Redists", "Redist4", "") != ""
- #define Redist4 ReadIni(SourcePath + "\WindowsPhone.iss", "Redists", "Redist4", "")
- #if ReadIni(SourcePath + "\WindowsPhone.iss", "Redists", "Redist5", "") != ""
- #define Redist5 ReadIni(SourcePath + "\WindowsPhone.iss", "Redists", "Redist5", "")
- #endif
- #endif
- #endif
- #endif
- #endif
- #if ReadIni(SourcePath + "\WindowsPhone.iss", "Installer", "Autorun", "0") == "1"
- #define Autorun
- #endif
- #if ReadIni(SourcePath + "\WindowsPhone.iss", "Theme", "Dark", "1") == "1"
- #define Dark
- #endif
- #if ReadIni(SourcePath + "\WindowsPhone.iss", "Theme", "Image", "0") == "1"
- #define Image
- #endif
- #define CurColor ReadIni(SourcePath + "\WindowsPhone.iss", "Theme", "Color", "05")
- #define Repacker ReadIni(SourcePath + "\WindowsPhone.iss", "Installer", "Repacker", "")
- #define Watermark ReadIni(SourcePath + "\WindowsPhone.iss", "Installer", "Watermark", "Script: Razor12911|Windows Phone Installer: v3.1|Windows Phone Technology: v4.2")
- [Setup]
- AppName={#AppName}
- AppPublisher={#AppPublisher}
- AppVersion={#AppVersion}
- DefaultDirName={pf}\{#AppName}
- DefaultGroupName={#AppName}
- SetupIconFile=Graphics\Icon.ico
- OutputBaseFilename=Start
- OutputDir=Output
- UninstallFilesDir={app}\Uninstall
- DiskSpanning=no
- EnableDirDoesntExistWarning=no
- InternalCompressLevel=max
- [Files]
- #if ReadIni(SourcePath + "\WindowsPhone.iss", "Archives", "Archive1Type", "") != ""
- ; Cls Files + Ini
- Source: Resources\arc.ini; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\english.ini; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\facompress.dll; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\facompress_mt.dll; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\unarc.dll; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\unrar.dll; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\zlib1.dll; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\CLS-MSC.dll; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\CLS-precomp.dll; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\CLS-srep.dll; DestDir: {tmp}; Flags: dontcopy;
- ; Srep + Precomp Support
- Source: Resources\srep.exe; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\srep64.exe; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\packjpg.exe; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\packjpg_dll1.dll; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\precomp.exe; DestDir: {tmp}; Flags: dontcopy;
- ; Core Unpackers
- Source: Resources\nz64.exe; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\zstd.exe; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\dec.exe; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\lzt.exe; DestDir: {tmp}; Flags: dontcopy;
- ; Reflate Support
- ;Source: Resources\7z.dll; DestDir: {tmp}; Flags: dontcopy;
- ;Source: Resources\reflate.exe; DestDir: {tmp}; Flags: dontcopy;
- ;Source: Resources\raw2hif.exe; DestDir: {tmp}; Flags: dontcopy;
- ;Source: Resources\rawrest.exe; DestDir: {tmp}; Flags: dontcopy;
- ;Source: Resources\rawdet.exe; DestDir: {tmp}; Flags: dontcopy;
- #endif
- Source: Resources\ISDone.dll; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\botva2.dll; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\botva2.dll; DestDir: {app}\Uninstall; Attribs: hidden system;
- Source: Resources\Exit.png; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\Install.png; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\Uninstall.png; DestDir: {tmp}; Flags: dontcopy;
- #ifdef Image
- #define i 0
- #ifexist "Graphics\Images\Lockscreen.jpg"
- Source: Graphics\Images\Lockscreen.jpg; DestDir: {tmp}; Flags: dontcopy;
- #endif
- #ifdef Autorun
- #sub AddFile1
- Source: Graphics\Images\Autorun{#i}.jpg; DestDir: {tmp}; Flags: dontcopy;
- #endsub
- #for {i = 1; FileExists(StringChange("Graphics\Images\AutorunFileName.jpg", "FileName", Str(i))) != 0; i++} AddFile1
- #endif
- #sub AddFile2
- Source: Graphics\Images\Setup{#i}.jpg; DestDir: {tmp}; Flags: dontcopy;
- #endsub
- #for {i = 1; FileExists(StringChange("Graphics\Images\SetupFileName.jpg", "FileName", Str(i))) != 0; i++} AddFile2
- Source: Resources\Dark.png; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\Light.png; DestDir: {tmp}; Flags: dontcopy;
- Source: Resources\Dark.png; DestDir: {app}\Uninstall; Attribs: hidden system;
- Source: Resources\Light.png; DestDir: {app}\Uninstall; Attribs: hidden system;
- Source: Graphics\Images\Setup1.jpg; DestDir: {app}\Uninstall; Attribs: hidden system;
- Source: Graphics\Images\Setup2.jpg; DestDir: {app}\Uninstall; Attribs: hidden system;
- #endif
- #ifdef AppFiles
- Source: {#AppFiles}\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: unins*;
- #endif
- #ifdef Redist1
- #dim R1[64]
- #for {R1[0] = 59; Pos('|', Redist1); R1[0]++} R1[R1[0]] = Copy(Redist1,,Pos('|', Redist1)-1), Redist1 = Copy(Redist1,Pos('|', Redist1)+1)
- #expr R1[R1[0]] = Redist1
- #ifdef Redist2
- #dim R2[64]
- #for {R2[0] = 59; Pos('|', Redist2); R2[0]++} R2[R2[0]] = Copy(Redist2,,Pos('|', Redist2)-1), Redist2 = Copy(Redist2,Pos('|', Redist2)+1)
- #expr R2[R2[0]] = Redist2
- #ifdef Redist3
- #dim R3[64]
- #for {R3[0] = 59; Pos('|', Redist3); R3[0]++} R3[R3[0]] = Copy(Redist3,,Pos('|', Redist3)-1), Redist3 = Copy(Redist3,Pos('|', Redist3)+1)
- #expr R3[R3[0]] = Redist3
- #ifdef Redist4
- #dim R4[64]
- #for {R4[0] = 59; Pos('|', Redist4); R4[0]++} R4[R4[0]] = Copy(Redist4,,Pos('|', Redist4)-1), Redist4 = Copy(Redist4,Pos('|', Redist4)+1)
- #expr R4[R4[0]] = Redist4
- #ifdef Redist5
- #dim R5[64]
- #for {R5[0] = 59; Pos('|', Redist5); R5[0]++} R5[R5[0]] = Copy(Redist5,,Pos('|', Redist5)-1), Redist5 = Copy(Redist5,Pos('|', Redist5)+1)
- #expr R5[R5[0]] = Redist5
- #endif
- #endif
- #endif
- #endif
- #endif
- #ifdef AppExe1
- #dim E1[64]
- #for {E1[0] = 59; Pos('|', AppExe1); E1[0]++} E1[E1[0]] = Copy(AppExe1,,Pos('|', AppExe1)-1), AppExe1 = Copy(AppExe1,Pos('|', AppExe1)+1)
- #expr E1[E1[0]] = AppExe1
- #ifdef AppExe2
- #dim E2[64]
- #for {E2[0] = 59; Pos('|', AppExe2); E2[0]++} E2[E2[0]] = Copy(AppExe2,,Pos('|', AppExe2)-1), AppExe2 = Copy(AppExe2,Pos('|', AppExe2)+1)
- #expr E2[E2[0]] = AppExe2
- #ifdef AppExe3
- #dim E3[64]
- #for {E3[0] = 59; Pos('|', AppExe3); E3[0]++} E3[E3[0]] = Copy(AppExe3,,Pos('|', AppExe3)-1), AppExe3 = Copy(AppExe3,Pos('|', AppExe3)+1)
- #expr E3[E3[0]] = AppExe3
- #ifdef AppExe4
- #dim E4[64]
- #for {E4[0] = 59; Pos('|', AppExe4); E4[0]++} E4[E4[0]] = Copy(AppExe4,,Pos('|', AppExe4)-1), AppExe4 = Copy(AppExe4,Pos('|', AppExe4)+1)
- #expr E4[E4[0]] = AppExe4
- #ifdef AppExe5
- #dim E5[64]
- #for {E5[0] = 59; Pos('|', AppExe5); E5[0]++} E5[E5[0]] = Copy(AppExe5,,Pos('|', AppExe5)-1), AppExe5 = Copy(AppExe5,Pos('|', AppExe5)+1)
- #expr E5[E5[0]] = AppExe5
- #ifdef AppExe6
- #dim E6[64]
- #for {E6[0] = 59; Pos('|', AppExe6); E6[0]++} E6[E6[0]] = Copy(AppExe6,,Pos('|', AppExe6)-1), AppExe6 = Copy(AppExe6,Pos('|', AppExe6)+1)
- #expr E6[E6[0]] = AppExe6
- #endif
- #endif
- #endif
- #endif
- #endif
- #endif
- #ifdef Autorun
- #ifdef Image
- #ifdef AppExe1
- Source: Graphics\Tiles\Tile1_Background.jpg; DestDir: {tmp}; Flags: dontcopy;
- #sub AddExeIcon1
- Source: Graphics\Tiles\Tile1_Icon{#i}.png; DestDir: {tmp}; Flags: dontcopy;
- #endsub
- #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile1_IconFileName.png", "FileName", Str(i))) != 0; i++} AddExeIcon1
- #ifdef AppExe2
- Source: Graphics\Tiles\Tile2_Background.jpg; DestDir: {tmp}; Flags: dontcopy;
- #sub AddExeIcon2
- Source: Graphics\Tiles\Tile2_Icon{#i}.png; DestDir: {tmp}; Flags: dontcopy;
- #endsub
- #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile2_IconFileName.png", "FileName", Str(i))) != 0; i++} AddExeIcon2
- #ifdef AppExe3
- Source: Graphics\Tiles\Tile3_Background.jpg; DestDir: {tmp}; Flags: dontcopy;
- #sub AddExeIcon3
- Source: Graphics\Tiles\Tile3_Icon{#i}.png; DestDir: {tmp}; Flags: dontcopy;
- #endsub
- #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile3_IconFileName.png", "FileName", Str(i))) != 0; i++} AddExeIcon3
- #ifdef AppExe4
- Source: Graphics\Tiles\Tile4_Background.jpg; DestDir: {tmp}; Flags: dontcopy;
- #sub AddExeIcon4
- Source: Graphics\Tiles\Tile4_Icon{#i}.png; DestDir: {tmp}; Flags: dontcopy;
- #endsub
- #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile4_IconFileName.png", "FileName", Str(i))) != 0; i++} AddExeIcon4
- #ifdef AppExe5
- Source: Graphics\Tiles\Tile5_Background.jpg; DestDir: {tmp}; Flags: dontcopy;
- #sub AddExeIcon5
- Source: Graphics\Tiles\Tile5_Icon{#i}.png; DestDir: {tmp}; Flags: dontcopy;
- #endsub
- #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile5_IconFileName.png", "FileName", Str(i))) != 0; i++} AddExeIcon5
- #ifdef AppExe6
- Source: Graphics\Tiles\Tile6_Background.jpg; DestDir: {tmp}; Flags: dontcopy;
- #sub AddExeIcon6
- Source: Graphics\Tiles\Tile6_Icon{#i}.png; DestDir: {tmp}; Flags: dontcopy;
- #endsub
- #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile6_IconFileName.png", "FileName", Str(i))) != 0; i++} AddExeIcon6
- #endif
- #endif
- #endif
- #endif
- #endif
- #endif
- #endif
- #endif
- [Icons]
- #ifdef AppExe1
- Name: {group}\{#E1[62]}; Filename: {app}\{#E1[60]}\{#E1[61]}; WorkingDir: {app}\{#E1[60]}; Comment: {#E1[59]};
- Name: {commondesktop}\{#E1[62]}; Filename: {app}\{#E1[60]}\{#E1[61]}; WorkingDir: {app}\{#E1[60]}; Check: CreateShortcuts;
- #ifdef AppExe2
- Name: {group}\{#E2[62]}; Filename: {app}\{#E2[60]}\{#E2[61]}; WorkingDir: {app}\{#E2[60]}; Comment: {#E2[59]};
- Name: {commondesktop}\{#E2[62]}; Filename: {app}\{#E2[60]}\{#E2[61]}; WorkingDir: {app}\{#E2[60]}; Check: CreateShortcuts;
- #ifdef AppExe3
- Name: {group}\{#E3[62]}; Filename: {app}\{#E3[60]}\{#E3[61]}; WorkingDir: {app}\{#E3[60]}; Comment: {#E3[59]};
- Name: {commondesktop}\{#E3[62]}; Filename: {app}\{#E3[60]}\{#E3[61]}; WorkingDir: {app}\{#E3[60]}; Check: CreateShortcuts;
- #ifdef AppExe4
- Name: {group}\{#E4[62]}; Filename: {app}\{#E4[60]}\{#E4[61]}; WorkingDir: {app}\{#E4[60]}; Comment: {#E4[59]};
- Name: {commondesktop}\{#E4[62]}; Filename: {app}\{#E4[60]}\{#E4[61]}; WorkingDir: {app}\{#E4[60]}; Check: CreateShortcuts;
- #ifdef AppExe5
- Name: {group}\{#E5[62]}; Filename: {app}\{#E5[60]}\{#E5[61]}; WorkingDir: {app}\{#E5[60]}; Comment: {#E5[59]};
- Name: {commondesktop}\{#E5[62]}; Filename: {app}\{#E5[60]}\{#E5[61]}; WorkingDir: {app}\{#E5[60]}; Check: CreateShortcuts;
- #ifdef AppExe6
- Name: {group}\{#E6[62]}; Filename: {app}\{#E6[60]}\{#E6[61]}; WorkingDir: {app}\{#E6[60]}; Comment: {#E6[59]};
- Name: {commondesktop}\{#E6[62]}; Filename: {app}\{#E6[60]}\{#E6[61]}; WorkingDir: {app}\{#E6[60]}; Check: CreateShortcuts;
- #endif
- #endif
- #endif
- #endif
- #endif
- #endif
- Name: {group}\Uninstall; Filename: {uninstallexe}; Comment: Uninstall {#AppName};
- [Code]
- const
- SlideNone = 0;
- SlideFade = 1;
- SlideLeft = 2;
- SlideRight = 3;
- SlideUp = 4;
- SlideDown = 5;
- SlideSplitX = 6;
- SlideSplitY = 7;
- SlideSliceX = 8;
- SlideSliceY = 9;
- SlideAuto = 10;
- type
- TCallback = function (OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
- TCallback2 = function (OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
- TData = record
- Arc: array of String;
- end;
- TSize = record
- Width, Height: UINT;
- end;
- type
- TCusBtn = record
- Base, Top: TPanel;
- ModalBtn : TButton;
- end;
- type
- TCusChk = record
- Base, Mid, Top: TPanel;
- Labl: TLabel;
- IsChecked, IsEnabled: Boolean;
- end;
- type
- TCusPBR = record
- Base, Mid, Top: TPanel;
- end;
- type
- TCusEdt = record
- Base, Top: TPanel;
- end;
- type
- TAniBar = record
- Tmr: TTimer;
- Dots: Array of TPanel;
- Left, Top, Width, Height: Integer;
- end;
- type
- TCusSld = record
- Img, Img2, Img3, Img4: array of Longint;
- Tmr, Tmr2, Tmr3: TTimer;
- Count, ImgTime, EftTime, Showing: Longint;
- Parent: TWinControl;
- Effect: Integer;
- Left, Top, Width, Height: Longint;
- ImageSize : TSize;
- end;
- type
- TCusTle = record
- Tmr: TTimer;
- Base: TListView;
- Labl, Labl2: TLabel;
- MImg: Longint;
- Slide: TCusSld;
- ModalBtn : TButton;
- StartInfo: String;
- Animation: Boolean;
- Wait, Timer: Longint;
- AniBar: TAniBar;
- Startup: TListView;
- Event: TNotifyEvent;
- end;
- type
- TCusLck = record
- Parent: TSetupForm;
- Tile: TListView;
- LTime, LDate, Labl: TLabel;
- Tmr: TTimer;
- Dirct: String;
- Locked: Boolean;
- end;
- var
- TitleLabel1, TitleLabel2, TitleLabel3, TitleLabel4,
- StatusLabel1, StatusLabel2, StatusLabel3, StatusLabel4,
- WelcomeLabel1, WelcomeLabel2, WelcomeLabel3,
- SelectDirLabel1, SelectDirLabel2, SelectDirLabel3,
- InstallLabel1, InstallLabel2, InstallLabel3, InstallLabel4,
- FinishLabel1, FinishLabel2, FinishLabel3: TLabel;
- TopLeftPanel, BottomPanel: TPanel;
- CurCol: Integer;
- BackBtn, NextBtn, BrowseBtn,
- CancelYesBtn, CancelNoBtn: TCusBtn;
- AutorunForm, CancelForm: TSetupForm;
- DesktopChk, Redist1, Redist2, Redist3, Redist4, Redist5: TCusChk;
- SelectDirEdt: TCusEdt;
- InstallPBr: TCusPBr;
- Launch1Tile, Launch2Tile, Launch3Tile, Launch4Tile, Launch5Tile, Launch6Tile, InstallTile, UninstallTile, ExitTile: TCusTle;
- InstallTimer: TTimer;
- AutorunAniBar, WizardAniBar, LockScreenAniBar: TAniBar;
- AutorunSlide, WizardSlide: TCusSld;
- AutorunLock, WizardLock: TCusLck;
- ISDoneCancel: Integer;
- ISDoneError: Boolean;
- Data: array of TData;
- const
- NORMAL_PRIORITY_CLASS = $00000020;
- {$EXTERNALSYM NORMAL_PRIORITY_CLASS}
- IDLE_PRIORITY_CLASS = $00000040;
- {$EXTERNALSYM IDLE_PRIORITY_CLASS}
- HIGH_PRIORITY_CLASS = $00000080;
- {$EXTERNALSYM HIGH_PRIORITY_CLASS}
- REALTIME_PRIORITY_CLASS = $00000100;
- {$EXTERNALSYM REALTIME_PRIORITY_CLASS}
- {$EXTERNALSYM MOUSEEVENTF_MOVE}
- MOUSEEVENTF_MOVE = $0001; { mouse move }
- {$EXTERNALSYM MOUSEEVENTF_LEFTDOWN}
- MOUSEEVENTF_LEFTDOWN = $0002; { left button down }
- {$EXTERNALSYM MOUSEEVENTF_LEFTUP}
- MOUSEEVENTF_LEFTUP = $0004; { left button up }
- {$EXTERNALSYM MOUSEEVENTF_RIGHTDOWN}
- MOUSEEVENTF_RIGHTDOWN = $0008; { right button down }
- {$EXTERNALSYM MOUSEEVENTF_RIGHTUP}
- MOUSEEVENTF_RIGHTUP = $0010; { right button up }
- {$EXTERNALSYM MOUSEEVENTF_MIDDLEDOWN}
- MOUSEEVENTF_MIDDLEDOWN = $0020; { middle button down }
- {$EXTERNALSYM MOUSEEVENTF_MIDDLEUP}
- MOUSEEVENTF_MIDDLEUP = $0040; { middle button up }
- {$EXTERNALSYM MOUSEEVENTF_WHEEL}
- MOUSEEVENTF_WHEEL = $0800; { wheel button rolled }
- {$EXTERNALSYM MOUSEEVENTF_HWHEEL}
- MOUSEEVENTF_HWHEEL = $1000; { hwheel button rolled }
- {$EXTERNALSYM MOUSEEVENTF_MOVE_NOCOALESCE}
- MOUSEEVENTF_MOVE_NOCOALESCE = $2000; { hwheel button rolled }
- {$EXTERNALSYM MOUSEEVENTF_ABSOLUTE}
- MOUSEEVENTF_ABSOLUTE = $8000; { absolute move }
- AW_FADE_IN = $00080000;
- AW_FADE_OUT = $00090000;
- AW_SLIDE_IN_LEFT = $00040001;
- AW_SLIDE_OUT_LEFT = $00050002;
- AW_SLIDE_IN_RIGHT = $00040002;
- AW_SLIDE_OUT_RIGHT = $00050001;
- AW_SLIDE_IN_TOP = $00040004;
- AW_SLIDE_OUT_TOP = $00050008;
- AW_SLIDE_IN_BOTTOM = $00040008;
- AW_SLIDE_OUT_BOTTOM = $00050004;
- AW_DIAG_SLIDE_IN_TOPLEFT = $00040005;
- AW_DIAG_SLIDE_OUT_TOPLEFT = $0005000a;
- AW_DIAG_SLIDE_IN_TOPRIGHT = $00040006;
- AW_DIAG_SLIDE_OUT_TOPRIGHT = $00050009;
- AW_DIAG_SLIDE_IN_BOTTOMLEFT = $00040009;
- AW_DIAG_SLIDE_OUT_BOTTOMLEFT = $00050006;
- AW_DIAG_SLIDE_IN_BOTTOMRIGHT = $0004000a;
- AW_DIAG_SLIDE_OUT_BOTTOMRIGHT = $00050005;
- AW_EXPLODE = $00040010;
- AW_IMPLODE = $00050010;
- function AnimateWindow(hWnd: HWND; dwTime: DWORD; dwFlags: DWORD): Boolean;
- external 'AnimateWindow@user32 stdcall';
- function ReleaseCapture: Longint;
- external 'ReleaseCapture@user32.dll stdcall';
- function SetWindowPos(hWnd, hWndInsertAfter, X, Y, cx, cy, wFlags: Longint):Boolean;
- external 'SetWindowPos@user32.dll stdcall';
- function ImgLoad(Wnd :HWND; FileName :PAnsiChar; Left, Top, Width, Height :integer; Stretch, IsBkg :boolean) :Longint;
- external 'ImgLoad@{tmp}\botva2.dll stdcall delayload';
- procedure ImgSetVisiblePart(img:Longint; NewLeft, NewTop, NewWidth, NewHeight : integer);
- external 'ImgSetVisiblePart@{tmp}\botva2.dll stdcall delayload';
- procedure ImgGetVisiblePart(img:Longint; var Left, Top, Width, Height : integer);
- external 'ImgGetVisiblePart@{tmp}\botva2.dll stdcall delayload';
- procedure ImgSetPosition(img :Longint; NewLeft, NewTop, NewWidth, NewHeight :integer);
- external 'ImgSetPosition@{tmp}\botva2.dll stdcall delayload';
- procedure ImgGetPosition(img:Longint; var Left, Top, Width, Height:integer);
- external 'ImgGetPosition@{tmp}\botva2.dll stdcall delayload';
- procedure ImgSetVisibility(img :Longint; Visible :boolean);
- external 'ImgSetVisibility@{tmp}\botva2.dll stdcall delayload';
- function ImgGetVisibility(img:Longint):boolean;
- external 'ImgGetVisibility@{tmp}\botva2.dll stdcall delayload';
- procedure ImgSetTransparent(img:Longint; Value:integer);
- external 'ImgSetTransparent@{tmp}\botva2.dll stdcall delayload';
- function ImgGetTransparent(img:Longint):integer;
- external 'ImgGetTransparent@{tmp}\botva2.dll stdcall delayload';
- procedure ImgRelease(img :Longint);
- external 'ImgRelease@{tmp}\botva2.dll stdcall delayload';
- procedure ImgApplyChanges(h:HWND);
- external 'ImgApplyChanges@{tmp}\botva2.dll stdcall delayload';
- procedure gdipShutdown;
- external 'gdipShutdown@{tmp}\botva2.dll stdcall delayload';
- procedure CreateFormFromImage(h:HWND; FileName:PAnsiChar);
- external 'CreateFormFromImage@{tmp}\botva2.dll stdcall delayload';
- function CreateBitmapRgn(DC: LongWord; Bitmap: HBITMAP; TransClr: DWORD; dX:integer; dY:integer): LongWord;
- external 'CreateBitmapRgn@{tmp}\botva2.dll stdcall delayload';
- procedure SetMinimizeAnimation(Value: Boolean);
- external 'SetMinimizeAnimation@{tmp}\botva2.dll stdcall delayload';
- function GetMinimizeAnimation: Boolean;
- external 'GetMinimizeAnimation@{tmp}\botva2.dll stdcall delayload';
- function LoadCursorFromFile(FileName: String): Longint;
- external 'LoadCursorFromFileW@user32 stdcall';
- function SetClassLong(hWnd: HWND; Index, NewLong: Longint): Longint;
- external 'SetClassLongW@user32 stdcall';
- function AddFontResource(lpszFilename:string;fl:dword;pdv:integer): Integer;
- external 'AddFontResourceExW@gdi32.dll stdcall';
- function RemoveFontResource(lpszFilename:string;fl:dword;pdv:integer): boolean;
- external 'RemoveFontResourceExW@gdi32.dll stdcall';
- function SetPriorityClass(hProcess: THandle; dwPriorityClass: DWORD): BOOL;
- external 'SetPriorityClass@kernel32';
- function GetCurrentProcess: THandle;
- external 'GetCurrentProcess@kernel32';
- function Mouse_Event(dwFlags, dx, dy, dwData: DWORD; dwExtraInfo: Longint):Boolean;
- external 'mouse_event@user32.dll stdcall';
- function WrapCallback(callback:TCallback2; paramcount:integer):longword;
- external 'wrapcallback@files:ISDone.dll stdcall delayload';
- function ISDoneInit(RecordFileName:AnsiString; TimeType,Comp1,Comp2,Comp3:Cardinal; WinHandle, NeededMem:longint; callback:TCallback2):boolean;
- external 'ISDoneInit@files:ISDone.dll stdcall';
- function ISArcExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath, ExtractedPath: AnsiString; DeleteInFile:boolean; Password, CfgFile, WorkPath: AnsiString; ExtractPCF: boolean ):boolean;
- external 'ISArcExtract@files:ISDone.dll stdcall delayload';
- function IS7ZipExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean;
- external 'IS7zipExtract@files:ISDone.dll stdcall delayload';
- function ISRarExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean;
- external 'ISRarExtract@files:ISDone.dll stdcall delayload';
- function ISPrecompExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean;
- external 'ISPrecompExtract@files:ISDone.dll stdcall delayload';
- function ISSRepExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean;
- external 'ISSrepExtract@files:ISDone.dll stdcall delayload';
- function ISxDeltaExtract(CurComponent:Cardinal; PctOfTotal:double; minRAM,maxRAM:integer; InName, DiffFile, OutFile: AnsiString; DeleteInFile, DeleteDiffFile:boolean):boolean;
- external 'ISxDeltaExtract@files:ISDone.dll stdcall delayload';
- function ISPackZIP(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString;ComprLvl:integer; DeleteInFile:boolean):boolean;
- external 'ISPackZIP@files:ISDone.dll stdcall delayload';
- function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:AnsiString):boolean;
- external 'ShowChangeDiskWindow@files:ISDone.dll stdcall delayload';
- function Exec2 (FileName, Param: PAnsiChar;Show:boolean):boolean;
- external 'Exec2@files:ISDone.dll stdcall delayload';
- function ISFindFiles(CurComponent:Cardinal; FileMask:AnsiString; var ColFiles:integer):integer;
- external 'ISFindFiles@files:ISDone.dll stdcall delayload';
- function ISPickFilename(FindHandle:integer; OutPath:AnsiString; var CurIndex:integer; DeleteInFile:boolean):boolean;
- external 'ISPickFilename@files:ISDone.dll stdcall delayload';
- function ISGetName(TypeStr:integer):PAnsichar;
- external 'ISGetName@files:ISDone.dll stdcall delayload';
- function ISFindFree(FindHandle:integer):boolean;
- external 'ISFindFree@files:ISDone.dll stdcall delayload';
- function ISExec(CurComponent:Cardinal; PctOfTotal,SpecifiedProcessTime:double; ExeName,Parameters,TargetDir,OutputStr:AnsiString;Show:boolean):boolean;
- external 'ISExec@files:ISDone.dll stdcall delayload';
- function SrepInit(TmpPath:PAnsiChar;VirtMem,MaxSave:Cardinal):boolean;
- external 'SrepInit@files:ISDone.dll stdcall delayload';
- function PrecompInit(TmpPath:PAnsiChar;VirtMem:cardinal;PrecompVers:single):boolean;
- external 'PrecompInit@files:ISDone.dll stdcall delayload';
- function FileSearchInit(RecursiveSubDir:boolean):boolean;
- external 'FileSearchInit@files:ISDone.dll stdcall delayload';
- function ISDoneStop:boolean;
- external 'ISDoneStop@files:ISDone.dll stdcall';
- function ChangeLanguage(Language:AnsiString):boolean;
- external 'ChangeLanguage@files:ISDone.dll stdcall delayload';
- function SuspendProc:boolean;
- external 'SuspendProc@files:ISDone.dll stdcall';
- function ResumeProc:boolean;
- external 'ResumeProc@files:ISDone.dll stdcall';
- function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
- begin
- if OveralPct<=Wizardform.ProgressGauge.Max then
- Wizardform.Progressgauge.Position := OveralPct;
- Result := ISDoneCancel;
- end;
- function ConstConv(Constant, Source: String):String;
- begin
- StringChangeEx(Constant,'{src}',Source,True);
- Result:=ExpandConstant(Constant);
- end;
- function Floater(Float: Extended; Value: Integer): string;
- begin
- Result:= Format('%.'+IntToStr(Value)+'n', [Float]); StringChange(Result, ',', ',');
- while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = ',')) and (Pos(',', Result) > 0) do
- SetLength(Result, Length(Result)-1);
- end;
- function IntRange(Value,Min,Max: Longint):Longint;
- begin
- Result:=Value;
- if Value < Min then
- Result:=Min;
- if Value > Max then
- Result:=Max;
- end;
- function MetroColor(Col: Integer): TColor;
- begin
- case Col of
- 01: Result:=$00C4A4;
- 02: Result:=$17A960;
- 03: Result:=$008A00;
- 04: Result:=$A9AB00;
- 05: Result:=$E2B11A;
- 06: Result:=$EF5000;
- 07: Result:=$FF006A;
- 08: Result:=$FF00AA;
- 09: Result:=$D072F4;
- 10: Result:=$7300D8;
- 11: Result:=$2500A2;
- 12: Result:=$0014E5;
- 13: Result:=$0068FA;
- 14: Result:=$0AA3FF;
- 15: Result:=$00C8E3;
- 16: Result:=$2C5A82;
- 17: Result:=$64876D;
- 18: Result:=$877664;
- 19: Result:=$8A6076;
- 20: Result:=$2D52A0;
- 21: Result:=$0000FF;
- end;
- end;
- function MetroTime:String;
- var
- Hour, Min, Sec, MSec: Word;
- HR, MN, HC: String;
- begin
- DecodeTime(Now,Hour,Min,Sec,MSec);
- if Hour < 12 then
- begin
- HC:='AM'
- HR:=IntToStr(Hour);
- end;
- if Hour = 12 then
- begin
- HC:='PM';
- HR:='12';
- end;
- if Hour > 12 then
- begin
- HC:='PM';
- HR:=IntToStr(Hour - 12);
- end;
- if Hour = 0 then
- begin
- HC:='AM';
- HR:='12';
- end;
- if (Min < 10) then
- MN:='0' + IntToStr(Min)
- else
- MN:=IntToStr(Min);
- Result:=HR+ ':' + MN + ' ' + HC;
- end;
- function MetroDate:String;
- var
- Year, Month, Day: Word;
- WD, MT: String;
- begin
- DecodeDate(Now,Year,Month,Day);
- case DayOfWeek(Now) of
- 1: WD:='Sunday';
- 2: WD:='Monday';
- 3: WD:='Tuesday';
- 4: WD:='Wednesday';
- 5: WD:='Thursday';
- 6: WD:='Friday';
- 7: WD:='Saturday';
- end;
- case Month of
- 1: MT:='January';
- 2: MT:='February';
- 3: MT:='March';
- 4: MT:='April';
- 5: MT:='May';
- 6: MT:='June';
- 7: MT:='July';
- 8: MT:='August';
- 9: MT:='September';
- 10: MT:='October';
- 11: MT:='November';
- 12: MT:='December';
- end;
- Result:= WD + ', ' + MT + ' ' + IntToStr(Day);
- end;
- function ReadFileTagJPG(File: String):TSize;
- var
- Str: String;
- Ind, Len: longint;
- FS: TFileStream;
- CheckSuccessful, WidthCheck: Boolean;
- anfangsnummer, passendenummer, PicWidth, PicHeight: Longint;
- begin
- FS:= TFileStream.Create(File, fmOpenRead);
- CheckSuccessful := False;
- WidthCheck := False;
- passendenummer :=0;
- PicWidth := 0;
- PicHeight := 0;
- if FS.Size < $8000 then
- Len:= FS.Size - 2
- else
- Len:= $8000 - 2;
- for Ind:= 0 to Len do
- begin
- SetLength(Str, 1)
- FS.Seek(Ind, soFromBeginning)
- FS.ReadBuffer(Str,1)
- if CheckSuccessful = False then
- begin
- anfangsnummer := passendenummer
- if (Str = Chr($FF)) and (passendenummer =0) then
- passendenummer :=1;
- if (Str = Chr($C0)) and (passendenummer =1) then
- passendenummer :=2;
- if anfangsnummer = passendenummer then
- passendenummer :=0;
- end;
- if (passendenummer =2) then
- CheckSuccessful := True;
- if (CheckSuccessful = True) and (ind >= 165) and (WidthCheck = True) then
- begin
- if ind = 165 then
- PicWidth := PicWidth + Ord(Str[1]) * 256;
- if ind = 166 then
- PicWidth := PicWidth + Ord(Str[1]);
- if ind = 167 then
- break;
- end;
- if (CheckSuccessful = True) and (ind >= 20) and (WidthCheck = False) then
- begin
- if ind = 163 then
- PicHeight := PicHeight + Ord(Str[1]) * 256;
- if ind = 164 then
- begin
- PicHeight := PicHeight + Ord(Str[1]);
- WidthCheck := True;
- end;
- end;
- end;
- FS.Free;
- Result.Width:=PicWidth;
- Result.Height:=PicHeight;
- end;
- function ReadFileTagPNG(File: string):TSize;
- var
- Str: String;
- Ind, Len: longint;
- FS: TFileStream;
- CheckSuccessful, WidthCheck: Boolean;
- anfangsnummer, passendenummer, PicWidth, PicHeight: Longint;
- begin
- FS:= TFileStream.Create(File, fmOpenRead);
- CheckSuccessful := False;
- WidthCheck := False;
- if FS.Size < $200 then
- Len:= FS.Size - 3
- else
- Len:= $200 - 3;
- for Ind:= 0 to Len do
- begin
- SetLength(Str, 1)
- FS.Seek(Ind, soFromBeginning)
- FS.ReadBuffer(Str,1)
- if CheckSuccessful = False then
- begin
- anfangsnummer := passendenummer
- if (Str = 'P') and (passendenummer =0) then
- passendenummer :=1;
- if (Str = 'N') and (passendenummer =1) then
- passendenummer :=2;
- if (Str = 'G') and (passendenummer =2) then
- passendenummer :=3;
- if anfangsnummer = passendenummer then
- passendenummer :=0;
- end;
- if (passendenummer =3) then
- CheckSuccessful := True;
- if (CheckSuccessful = True) and (ind >= 16) and (WidthCheck = False) then
- begin
- if ind = 16 then
- PicWidth := PicWidth + Ord(Str[1]) * 256 * 256 * 256;
- if ind = 17 then
- PicWidth := PicWidth + Ord(Str[1]) * 256 * 256;
- if ind = 18 then
- PicWidth := PicWidth + Ord(Str[1]) * 256;
- if ind = 19 then
- PicWidth := PicWidth + Ord(Str[1]);
- if ind = 20 then
- WidthCheck := True;
- end;
- if (CheckSuccessful = True) and (ind >= 20) and (WidthCheck = True) then
- begin
- if ind = 20 then
- PicHeight := PicHeight + Ord(Str[1]) * 256 * 256 * 256;
- if ind = 21 then
- PicHeight := PicHeight + Ord(Str[1]) * 256 * 256;
- if ind = 22 then
- PicHeight := PicHeight + Ord(Str[1]) * 256;
- if ind = 23 then
- PicHeight := PicHeight + Ord(Str[1]);
- if ind = 24 then
- break;
- end;
- end;
- FS.Free;
- Result.Width:=PicWidth;
- Result.Height:=PicHeight;
- end;
- function GetPictureSize(File: String): TSize;
- var
- Mem: array[0..5] of Integer;
- Str: String;
- FS: TFileStream;
- n: Integer;
- begin
- case Uppercase(ExtractFileExt(File)) of
- '.GIF':
- begin
- Mem[4]:=$0706;
- Mem[5]:=$0908;
- end;
- '.JPG','.JPEG':
- begin
- Mem[4]:=$A5A6;
- Mem[5]:=$A3A4;
- end;
- '.PNG':
- begin
- Mem[4]:=$1213;
- Mem[5]:=$1617;
- end;
- end;
- Mem[0]:= Mem[4] shr 8;
- Mem[1]:= Mem[4] and $FF;
- Mem[2]:= Mem[5] shr 8;
- Mem[3]:= Mem[5] and $FF;
- FS:= TFileStream.Create(File, fmOpenRead);
- for n:= 0 to 3 do
- begin
- Str:= Chr(0);
- FS.Seek(Mem[n], soFromBeginning);
- FS.ReadBuffer(Str, 1); Mem[n]:= Ord(Str[1]);
- end;
- FS.Free;
- Result.Width:= Mem[0] shl 8 + Mem[1];
- Result.Height:= Mem[2] shl 8 + Mem[3]
- end;
- //Windows Phone Technology v4.1 created by Razor12911
- procedure ButtonDisabled(Sender:TObject);
- begin
- end;
- procedure ButtonEnter(var Button:TCusBtn);
- begin
- Button.Base.Color:=MetroColor(CurCol);
- #ifdef Dark
- Button.Top.Color:=$252525;
- #else
- Button.Top.Color:=$FFFFFF;
- #endif
- Button.Top.Font.Color:=MetroColor(CurCol);
- end;
- procedure ButtonLeave(var Button:TCusBtn);
- begin
- #ifdef Dark
- Button.Base.Color:=$FFFFFF;
- Button.Top.Color:=$252525;
- Button.Top.Font.Color:=$FFFFFF;
- #else
- Button.Base.Color:=$252525;
- Button.Top.Color:=$FFFFFF;
- Button.Top.Font.Color:=$252525;
- #endif
- end;
- procedure ButtonDown(var Button:TCusBtn);
- begin
- Button.Base.Color:=MetroColor(CurCol);
- Button.Top.Color:=MetroColor(CurCol);
- #ifdef Dark
- Button.Top.Font.Color:=$252525;
- #else
- Button.Top.Font.Color:=$FFFFFF;
- #endif
- end;
- procedure ButtonUp(var Button:TCusBtn);
- begin
- Button.Base.Color:=MetroColor(CurCol);
- #ifdef Dark
- Button.Top.Color:=$252525;
- #else
- Button.Top.Color:=$FFFFFF;
- #endif
- Button.Top.Font.Color:=MetroColor(CurCol);
- end;
- procedure ButtonOnEnter(Sender:TObject);
- begin
- case Sender of
- BackBtn.Top: ButtonEnter(BackBtn);
- NextBtn.Top: ButtonEnter(NextBtn);
- BrowseBtn.Top: ButtonEnter(BrowseBtn);
- CancelYesBtn.Top: ButtonEnter(CancelYesBtn);
- CancelNoBtn.Top: ButtonEnter(CancelNoBtn);
- end;
- end;
- procedure ButtonOnLeave(Sender:TObject);
- begin
- case Sender of
- BackBtn.Top: ButtonLeave(BackBtn);
- NextBtn.Top: ButtonLeave(NextBtn);
- BrowseBtn.Top: ButtonLeave(BrowseBtn);
- CancelYesBtn.Top: ButtonLeave(CancelYesBtn);
- CancelNoBtn.Top: ButtonLeave(CancelNoBtn);
- end;
- end;
- procedure ButtonOnDown(Sender:TObject; Button:TMouseButton; Shift:TShiftState; X, Y:Integer);
- begin
- case Sender of
- BackBtn.Top: ButtonDown(BackBtn);
- NextBtn.Top: ButtonDown(NextBtn);
- BrowseBtn.Top: ButtonDown(BrowseBtn);
- CancelYesBtn.Top: ButtonDown(CancelYesBtn);
- CancelNoBtn.Top: ButtonDown(CancelNoBtn);
- end;
- end;
- procedure ButtonOnUp(Sender:TObject; Button:TMouseButton; Shift:TShiftState; X, Y:Integer);
- begin
- case Sender of
- BackBtn.Top: ButtonUp(BackBtn);
- NextBtn.Top: ButtonUp(NextBtn);
- BrowseBtn.Top: ButtonUp(BrowseBtn);
- CancelYesBtn.Top: ButtonUp(CancelYesBtn);
- CancelNoBtn.Top: ButtonUp(CancelNoBtn);
- end;
- end;
- function ButtonGetText(var Button: TCusBtn):String;
- begin
- Result:=Button.Top.Caption;
- end;
- procedure ButtonSetText(var Button: TCusBtn; hText: String);
- begin
- Button.Top.Caption:=hText;
- end;
- procedure ButtonSetVisibility(var Button: TCusBtn; hVisible: Boolean);
- begin
- Button.Base.Visible:=hVisible;
- end;
- procedure ButtonSetEnabled(var Button: TCusBtn; hEnabled: Boolean);
- begin
- Button.Base.Enabled:=hEnabled;
- if hEnabled then
- begin
- #ifdef Dark
- Button.Base.Color:=$FFFFFF;
- Button.Top.Font.Color:=$FFFFFF;
- #else
- Button.Base.Color:=$252525;
- Button.Top.Font.Color:=$252525;
- #endif
- end else begin
- Button.Base.Color:=$AAAAAA;
- Button.Top.Font.Color:=$AAAAAA;
- end;
- end;
- procedure ButtonSetEvent(var Button: TCusBtn; Event: TNotifyEvent);
- begin
- Button.Top.OnClick:=Event;
- end;
- procedure ButtonModal(var Button: TCusBtn);
- begin
- Button.ModalBtn.Click;
- end;
- function ButtonCreate(hParent :TWinControl; hLeft, hTop, hWidth, hHeight: Integer; SmallButton: Boolean;Modal: Integer): TCusBtn;
- begin
- Result.Base:= TPanel.Create(hParent);
- with Result.Base do
- begin
- Parent:=hParent;
- Left:=hLeft;
- Top:=hTop;
- Width:=hWidth;
- Height:=hHeight;
- #ifdef Dark
- Color:=$FFFFFF;
- #else
- Color:=$252525;
- #endif
- BorderStyle := bsNone;
- BevelInner := bvNone;
- BevelOuter := bvNone;
- BorderWidth := 0;
- ParentBackground := False;
- end;
- Result.Top:= TPanel.Create(Result.Base);
- with Result.Top do
- begin
- Parent:=Result.Base;
- Left:=1;
- Top:=1;
- Width:=hWidth - 2;
- Height:=hHeight - 2;
- with Font do
- begin
- Name:='Segoe UI';
- if SmallButton then
- Size:=7
- else
- Size:=11;
- #ifdef Dark
- Color:=$FFFFFF;
- #else
- Color:=$252525;
- #endif
- end;
- OnMouseEnter:= @ButtonOnEnter;
- OnMouseLeave:= @ButtonOnLeave;
- OnMouseDown := @ButtonOnDown;
- OnMouseUp := @ButtonOnUp;
- #ifdef Dark
- Color:=$252525;
- #else
- Color:=$FFFFFF;
- #endif
- BorderStyle := bsNone;
- BevelInner := bvNone;
- BevelOuter := bvNone;
- BorderWidth := 0;
- ParentBackground := False;
- end;
- Result.ModalBtn:= TButton.Create(hParent);
- with Result.ModalBtn do
- begin
- SetBounds(0,0,0,0);
- ModalResult:=Modal;
- Parent:= hParent;
- end;
- end;
- procedure CheckBoxDisabled(Sender:TObject);
- begin
- end;
- procedure CheckBoxEnter(var CheckBox:TCusChk);
- begin
- if CheckBox.IsChecked then
- begin
- CheckBox.Base.Color:=MetroColor(CurCol);
- #ifdef Dark
- CheckBox.Top.Color:=$FFFFFF;
- #else
- CheckBox.Top.Color:=$252525;
- #endif
- CheckBox.Labl.Font.Color:=MetroColor(CurCol);
- end else begin
- CheckBox.Base.Color:=MetroColor(CurCol);
- #ifdef Dark
- CheckBox.Top.Color:=$252525;
- #else
- CheckBox.Top.Color:=$FFFFFF;
- #endif
- CheckBox.Labl.Font.Color:=MetroColor(CurCol);
- end;
- end;
- procedure CheckBoxLeave(var CheckBox:TCusChk);
- begin
- if CheckBox.IsChecked then
- begin
- #ifdef Dark
- CheckBox.Base.Color:=MetroColor(CurCol);
- CheckBox.Top.Color:=MetroColor(CurCol);
- CheckBox.Labl.Font.Color:=$FFFFFF;
- #else
- CheckBox.Base.Color:=MetroColor(CurCol);
- CheckBox.Top.Color:=MetroColor(CurCol);
- CheckBox.Labl.Font.Color:=$252525;
- #endif
- end else begin
- #ifdef Dark
- CheckBox.Base.Color:=$FFFFFF;
- CheckBox.Top.Color:=$252525;
- CheckBox.Labl.Font.Color:=$FFFFFF;
- #else
- CheckBox.Base.Color:=$252525;
- CheckBox.Top.Color:=$FFFFFF;
- CheckBox.Labl.Font.Color:=$252525;
- #endif
- end;
- end;
- procedure CheckBoxDown(var CheckBox:TCusChk);
- begin
- if CheckBox.IsChecked then
- begin
- CheckBox.Base.Color:=MetroColor(CurCol);
- CheckBox.Top.Color:=$252525;
- #ifdef Dark
- CheckBox.Labl.Font.Color:=$FFFFFF;
- #else
- CheckBox.Labl.Font.Color:=$252525;
- #endif
- end else begin
- CheckBox.Base.Color:=MetroColor(CurCol);
- CheckBox.Top.Color:=MetroColor(CurCol);
- #ifdef Dark
- CheckBox.Labl.Font.Color:=$FFFFFF;
- #else
- CheckBox.Labl.Font.Color:=$252525;
- #endif
- end
- end;
- procedure CheckBoxUp(var CheckBox:TCusChk);
- begin
- if CheckBox.IsChecked then
- begin
- CheckBox.Base.Color:=MetroColor(CurCol);
- #ifdef Dark
- CheckBox.Top.Color:=$FFFFFF;
- #else
- CheckBox.Top.Color:=$252525;
- #endif
- CheckBox.Labl.Font.Color:=MetroColor(CurCol);
- end else begin
- CheckBox.Base.Color:=MetroColor(CurCol);
- #ifdef Dark
- CheckBox.Top.Color:=$252525;
- #else
- CheckBox.Top.Color:=$FFFFFF;
- #endif
- CheckBox.Labl.Font.Color:=MetroColor(CurCol);
- end;
- end;
- procedure CheckBoxClick(var CheckBox:TCusChk);
- begin
- CheckBox.IsChecked:= not CheckBox.IsChecked;
- end;
- procedure CheckBoxOnEnter(Sender:TObject);
- begin
- case Sender of
- DesktopChk.Top: CheckBoxEnter(DesktopChk);
- #ifdef Redist1
- Redist1.Top: CheckBoxEnter(Redist1);
- #ifdef Redist2
- Redist2.Top: CheckBoxEnter(Redist2);
- #ifdef Redist3
- Redist3.Top: CheckBoxEnter(Redist3);
- #ifdef Redist4
- Redist4.Top: CheckBoxEnter(Redist4);
- #ifdef Redist5
- Redist5.Top: CheckBoxEnter(Redist5);
- #endif
- #endif
- #endif
- #endif
- #endif
- end;
- end;
- procedure CheckBoxOnLeave(Sender:TObject);
- begin
- case Sender of
- DesktopChk.Top: CheckBoxLeave(DesktopChk);
- #ifdef Redist1
- Redist1.Top: CheckBoxLeave(Redist1);
- #ifdef Redist2
- Redist2.Top: CheckBoxLeave(Redist2);
- #ifdef Redist3
- Redist3.Top: CheckBoxLeave(Redist3);
- #ifdef Redist4
- Redist4.Top: CheckBoxLeave(Redist4);
- #ifdef Redist5
- Redist5.Top: CheckBoxLeave(Redist5);
- #endif
- #endif
- #endif
- #endif
- #endif
- end;
- end;
- procedure CheckBoxOnDown(Sender:TObject; CheckBox:TMouseButton; Shift:TShiftState; X, Y:Integer);
- begin
- case Sender of
- DesktopChk.Top: CheckBoxDown(DesktopChk);
- #ifdef Redist1
- Redist1.Top: CheckBoxDown(Redist1);
- #ifdef Redist2
- Redist2.Top: CheckBoxDown(Redist2);
- #ifdef Redist3
- Redist3.Top: CheckBoxDown(Redist3);
- #ifdef Redist4
- Redist4.Top: CheckBoxDown(Redist4);
- #ifdef Redist5
- Redist5.Top: CheckBoxDown(Redist5);
- #endif
- #endif
- #endif
- #endif
- #endif
- end;
- end;
- procedure CheckBoxOnClick(Sender:TObject);
- begin
- case Sender of
- DesktopChk.Top: CheckBoxClick(DesktopChk);
- #ifdef Redist1
- Redist1.Top: CheckBoxClick(Redist1);
- #ifdef Redist2
- Redist2.Top: CheckBoxClick(Redist2);
- #ifdef Redist3
- Redist3.Top: CheckBoxClick(Redist3);
- #ifdef Redist4
- Redist4.Top: CheckBoxClick(Redist4);
- #ifdef Redist5
- Redist5.Top: CheckBoxClick(Redist5);
- #endif
- #endif
- #endif
- #endif
- #endif
- end;
- end;
- procedure CheckBoxOnUp(Sender:TObject; CheckBox:TMouseButton; Shift:TShiftState; X, Y:Integer);
- begin
- case Sender of
- DesktopChk.Top: CheckBoxUp(DesktopChk);
- #ifdef Redist1
- Redist1.Top: CheckBoxUp(Redist1);
- #ifdef Redist2
- Redist2.Top: CheckBoxUp(Redist2);
- #ifdef Redist3
- Redist3.Top: CheckBoxUp(Redist3);
- #ifdef Redist4
- Redist4.Top: CheckBoxUp(Redist4);
- #ifdef Redist5
- Redist5.Top: CheckBoxUp(Redist5);
- #endif
- #endif
- #endif
- #endif
- #endif
- end;
- end;
- procedure CheckBoxSetText(var CheckBox: TCusChk; hText: String);
- begin
- CheckBox.Top.Caption:=hText;
- end;
- procedure CheckBoxSetVisibility(var CheckBox: TCusChk; hVisible: Boolean);
- begin
- CheckBox.Base.Visible:=hVisible;
- CheckBox.Labl.Visible:=hVisible;
- end;
- procedure CheckBoxSetEnabled(var CheckBox: TCusChk; hEnabled: Boolean);
- begin
- CheckBox.Base.Enabled:=hEnabled;
- CheckBox.IsEnabled:=hEnabled;
- if hEnabled then
- begin
- #ifdef Dark
- CheckBox.Base.Color:=$FFFFFF;
- CheckBox.Top.Color:=$FFFFFF;
- CheckBox.Labl.Font.Color:=$FFFFFF;
- #else
- CheckBox.Base.Color:=$252525;
- CheckBox.Top.Color:=$252525;
- CheckBox.Labl.Font.Color:=$252525;
- #endif
- end else begin
- if CheckBox.IsEnabled then
- begin
- CheckBox.Base.Color:=$AAAAAA;
- CheckBox.Top.Color:=$AAAAAA;
- CheckBox.Labl.Font.Color:=$AAAAAA;
- end else begin
- CheckBox.Base.Color:=$AAAAAA;
- #ifdef Dark
- CheckBox.Top.Color:=$252525;
- #else
- CheckBox.Top.Color:=$FFFFFF;
- #endif
- CheckBox.Labl.Font.Color:=$AAAAAA;
- end;
- end;
- end;
- procedure CheckBoxSetChecked(var CheckBox: TCusChk; hChecked: Boolean);
- begin
- CheckBox.IsChecked:= hChecked;
- if CheckBox.IsEnabled then
- begin
- if hChecked then
- begin
- #ifdef Dark
- CheckBox.Base.Color:=MetroColor(CurCol);
- CheckBox.Top.Color:=MetroColor(CurCol);
- CheckBox.Labl.Font.Color:=$FFFFFF;
- #else
- CheckBox.Base.Color:=MetroColor(CurCol);
- CheckBox.Top.Color:=MetroColor(CurCol);
- CheckBox.Labl.Font.Color:=$252525;
- #endif
- end else begin
- #ifdef Dark
- CheckBox.Base.Color:=$FFFFFF;
- CheckBox.Top.Color:=$252525;
- CheckBox.Labl.Font.Color:=$FFFFFF;
- #else
- CheckBox.Base.Color:=$252525;
- CheckBox.Top.Color:=$FFFFFF;
- CheckBox.Labl.Font.Color:=$252525;
- #endif
- end;
- end else begin
- if hChecked then
- begin
- CheckBox.Base.Color:=$AAAAAA;
- CheckBox.Top.Color:=$AAAAAA;
- CheckBox.Labl.Font.Color:=$AAAAAA;
- end else begin
- CheckBox.Base.Color:=$AAAAAA;
- #ifdef Dark
- CheckBox.Top.Color:=$252525;
- #else
- CheckBox.Top.Color:=$FFFFFF;
- #endif
- CheckBox.Labl.Font.Color:=$AAAAAA;
- end;
- end;
- end;
- function CheckBoxGetChecked(var CheckBox: TCusChk): Boolean;
- begin
- Result:=CheckBox.IsChecked;
- end;
- procedure CheckBoxSetEvent(var CheckBox: TCusChk; Event: TNotifyEvent);
- begin
- if CheckBox.IsChecked then
- CheckBox.Top.OnClick:=Event;
- end;
- function CheckBoxCreate(hParent :TWinControl; hLeft, hTop, hWidth, hHeight: Integer; hText: String): TCusChk;
- begin
- Result.IsEnabled:=True;
- Result.Base:= TPanel.Create(hParent);
- with Result.Base do
- begin
- Parent:=hParent;
- Left:=hLeft;
- Top:=hTop;
- Width:=hWidth;
- Height:=hHeight;
- #ifdef Dark
- Color:=$FFFFFF;
- #else
- Color:=$252525;
- #endif
- BorderStyle := bsNone;
- BevelInner := bvNone;
- BevelOuter := bvNone;
- BorderWidth := 0;
- ParentBackground := False;
- end;
- Result.Mid:= TPanel.Create(Result.Base);
- with Result.Mid do
- begin
- Parent:=Result.Base;
- Left:=1;
- Top:=1;
- Width:=hWidth - 2;
- Height:=hHeight - 2;
- #ifdef Dark
- Color:=$252525;
- #else
- Color:=$FFFFFF;
- #endif
- BorderStyle := bsNone;
- BevelInner := bvNone;
- BevelOuter := bvNone;
- BorderWidth := 0;
- ParentBackground := False;
- end;
- Result.Top:= TPanel.Create(Result.Mid);
- with Result.Top do
- begin
- Parent:=Result.Mid;
- Left:=1;
- Top:=1;
- Width:=hWidth - 4;
- Height:=hHeight - 4;
- OnMouseEnter:= @CheckBoxOnEnter;
- OnMouseLeave:= @CheckBoxOnLeave;
- OnMouseDown := @CheckBoxOnDown;
- OnMouseUp := @CheckBoxOnUp;
- OnClick := @CheckBoxOnClick;
- #ifdef Dark
- Color:=$252525;
- #else
- Color:=$FFFFFF;
- #endif
- BorderStyle := bsNone;
- BevelInner := bvNone;
- BevelOuter := bvNone;
- BorderWidth := 0;
- ParentBackground := False;
- end;
- Result.Labl:= TLabel.Create(hParent);
- with Result.Labl do
- begin
- Parent:=hParent;
- OnMouseEnter:= @CheckBoxOnEnter;
- OnMouseLeave:= @CheckBoxOnLeave;
- OnMouseDown := @CheckBoxOnDown;
- OnMouseUp := @CheckBoxOnUp;
- Layout:=tlCenter;
- with Font do
- begin
- Name:='Segoe UI';
- Size:=10;
- #ifdef Dark
- Color:=$FFFFFF;
- #else
- Color:=$252525;
- #endif
- end;
- SetBounds((hLeft + hWidth) + 5,hTop,0,0);
- Caption:=hText
- end;
- end;
- function EditGetText(var Edit: TCusEdt):String;
- begin
- Result:=Edit.Top.Caption;
- end;
- procedure EditSetText(var Edit: TCusEdt; hText: String);
- begin
- Edit.Top.Caption:=hText;
- end;
- procedure EditSetVisibility(var Edit: TCusEdt; hVisible: Boolean);
- begin
- Edit.Base.Visible:=hVisible;
- end;
- procedure EditSetEvent(var Edit: TCusEdt; Event: TNotifyEvent);
- begin
- Edit.Top.OnClick:=Event;
- end;
- function EditCreate(hParent :TWinControl; hLeft, hTop, hWidth, hHeight: Integer): TCusEdt;
- begin
- Result.Base:= TPanel.Create(hParent);
- with Result.Base do
- begin
- Parent:=hParent;
- Left:=hLeft;
- Top:=hTop;
- Width:=hWidth;
- Height:=hHeight;
- Color:=MetroColor(CurCol);
- BorderStyle := bsNone;
- BevelInner := bvNone;
- BevelOuter := bvNone;
- BorderWidth := 0;
- ParentBackground := False;
- end;
- Result.Top:= TPanel.Create(Result.Base);
- with Result.Top do
- begin
- Parent:=Result.Base;
- Alignment:=taLeftJustify;
- Left:=1;
- Top:=1;
- Width:=hWidth - 2;
- Height:=hHeight - 2;
- with Font do
- begin
- Name:='Segoe UI Bold';
- Size:=8;
- Color:=MetroColor(CurCol);
- end;
- #ifdef Dark
- Color:=$252525;
- #else
- Color:=$FFFFFF;
- #endif
- BorderStyle := bsNone;
- BevelInner := bvNone;
- BevelOuter := bvNone;
- BorderWidth := 0;
- ParentBackground := False;
- end;
- end;
- function ProgressGetProgress(var Progress: TCusPBr): Extended;
- begin
- if Progress.Base.Width <> 0 then
- Result:=(Progress.Top.Width * 100) / (Progress.Base.Width) - 6
- else
- Result:=0;
- end;
- procedure ProgressSetProgress(var Progress: TCusPBr; hValue: Extended);
- begin
- Progress.Top.Width:=Round(((Progress.Base.Width) - 6) * hValue / 100);
- end;
- procedure ProgressSetVisibility(var Progress: TCusPBr; hVisible: Boolean);
- begin
- Progress.Base.Visible:=hVisible;
- end;
- procedure ProgressSetEvent(var Progress: TCusPBr; Event: TNotifyEvent);
- begin
- Progress.Top.OnClick:=Event;
- end;
- function ProgressCreate(hParent :TWinControl; hLeft, hTop, hWidth, hHeight: Integer): TCusPBr;
- begin
- Result.Base:= TPanel.Create(hParent);
- with Result.Base do
- begin
- Parent:=hParent;
- Left:=hLeft;
- Top:=hTop;
- Width:=hWidth;
- Height:=hHeight;
- Color:=MetroColor(CurCol);
- BorderStyle := bsNone;
- BevelInner := bvNone;
- BevelOuter := bvNone;
- BorderWidth := 0;
- ParentBackground := False;
- end;
- Result.Mid:= TPanel.Create(Result.Base);
- with Result.Mid do
- begin
- Parent:=Result.Base;
- Left:=1;
- Top:=1;
- Width:=hWidth - 2;
- Height:=hHeight - 2;
- #ifdef Dark
- Color:=$252525;
- #else
- Color:=$FFFFFF;
- #endif
- BorderStyle := bsNone;
- BevelInner := bvNone;
- BevelOuter := bvNone;
- BorderWidth := 0;
- ParentBackground := False;
- end;
- Result.Top:= TPanel.Create(Result.Mid);
- with Result.Top do
- begin
- Parent:=Result.Mid;
- Left:=2;
- Top:=2;
- Width:=0;
- Height:=hHeight - 6;
- with Font do
- begin
- Name:='Segoe UI Bold';
- Size:=8;
- #ifdef Dark
- Color:=$252525;
- #else
- Color:=$FFFFFF;
- #endif
- end;
- Color:=MetroColor(CurCol);
- BorderStyle := bsNone;
- BevelInner := bvNone;
- BevelOuter := bvNone;
- BorderWidth := 0;
- ParentBackground := False;
- end;
- end;
- procedure AniTimer(var AniBar: TAniBar);
- begin
- if (AniBar.Dots[4].Left = AniBar.Left) or ((AniBar.Dots[4].Left > AniBar.Left) and (AniBar.Dots[3].Left <> AniBar.Left)) then
- begin
- if (AniBar.Dots[0].Left < (AniBar.Width * 4/9)) or (AniBar.Dots[0].Left = (AniBar.Width * 4/9)) then
- AniBar.Dots[0].Left:= AniBar.Dots[0].Left + 4;
- if (AniBar.Dots[0].Left > (AniBar.Width * 4/9)) and (AniBar.Dots[0].Left < (AniBar.Width * 5/9)) then
- AniBar.Dots[0].Left:= AniBar.Dots[0].Left + 1;
- if (AniBar.Dots[0].Left > (AniBar.Width * 5/9)) or (AniBar.Dots[0].Left = (AniBar.Width * 5/9)) then
- AniBar.Dots[0].Left:= AniBar.Dots[0].Left + 4;
- if (AniBar.Dots[0].Left = AniBar.Width) or (AniBar.Dots[0].Left > AniBar.Width) then
- AniBar.Dots[0].Left:=AniBar.Left;
- end;
- 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
- begin
- if (AniBar.Dots[1].Left < (AniBar.Width * 4/9)) or (AniBar.Dots[1].Left = (AniBar.Width * 4/9)) then
- AniBar.Dots[1].Left:= AniBar.Dots[1].Left + 4;
- if (AniBar.Dots[1].Left > (AniBar.Width * 4/9)) and (AniBar.Dots[1].Left < (AniBar.Width * 5/9)) then
- AniBar.Dots[1].Left:= AniBar.Dots[1].Left + 1;
- if (AniBar.Dots[1].Left > (AniBar.Width * 5/9)) or (AniBar.Dots[1].Left = (AniBar.Width * 5/9)) then
- AniBar.Dots[1].Left:= AniBar.Dots[1].Left + 4;
- if (AniBar.Dots[1].Left = AniBar.Width) or (AniBar.Dots[1].Left > AniBar.Width) then
- AniBar.Dots[1].Left:=AniBar.Left;
- end;
- 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
- begin
- if (AniBar.Dots[2].Left < (AniBar.Width * 4/9)) or (AniBar.Dots[2].Left = (AniBar.Width * 4/9)) then
- AniBar.Dots[2].Left:= AniBar.Dots[2].Left + 4;
- if (AniBar.Dots[2].Left > (AniBar.Width * 4/9)) and (AniBar.Dots[2].Left < (AniBar.Width * 5/9)) then
- AniBar.Dots[2].Left:= AniBar.Dots[2].Left + 1;
- if (AniBar.Dots[2].Left > (AniBar.Width * 5/9)) or (AniBar.Dots[2].Left = (AniBar.Width * 5/9)) then
- AniBar.Dots[2].Left:= AniBar.Dots[2].Left + 4;
- if (AniBar.Dots[2].Left = AniBar.Width) or (AniBar.Dots[2].Left > AniBar.Width) then
- AniBar.Dots[2].Left:=AniBar.Left;
- end;
- 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
- begin
- if (AniBar.Dots[3].Left < (AniBar.Width * 4/9)) or (AniBar.Dots[3].Left = (AniBar.Width * 4/9)) then
- AniBar.Dots[3].Left:= AniBar.Dots[3].Left + 4;
- if (AniBar.Dots[3].Left > (AniBar.Width * 4/9)) and (AniBar.Dots[3].Left < (AniBar.Width * 5/9)) then
- AniBar.Dots[3].Left:= AniBar.Dots[3].Left + 1;
- if (AniBar.Dots[3].Left > (AniBar.Width * 5/9)) or (AniBar.Dots[3].Left = (AniBar.Width * 5/9)) then
- AniBar.Dots[3].Left:= AniBar.Dots[3].Left + 4;
- if (AniBar.Dots[3].Left = AniBar.Width) or (AniBar.Dots[3].Left > AniBar.Width) then
- AniBar.Dots[3].Left:=AniBar.Left;
- end;
- 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
- begin
- if (AniBar.Dots[4].Left < (AniBar.Width * 4/9)) or (AniBar.Dots[4].Left = (AniBar.Width * 4/9)) then
- AniBar.Dots[4].Left:= AniBar.Dots[4].Left + 4;
- if (AniBar.Dots[4].Left > (AniBar.Width * 4/9)) and (AniBar.Dots[4].Left < (AniBar.Width * 5/9)) then
- AniBar.Dots[4].Left:= AniBar.Dots[4].Left + 1;
- if (AniBar.Dots[4].Left > (AniBar.Width * 5/9)) or (AniBar.Dots[4].Left = (AniBar.Width * 5/9)) then
- AniBar.Dots[4].Left:= AniBar.Dots[4].Left + 4;
- if (AniBar.Dots[4].Left = AniBar.Width) or (AniBar.Dots[4].Left > AniBar.Width) then
- AniBar.Dots[4].Left:=AniBar.Left;
- end;
- end;
- procedure AniOnTimer(Sender: TObject);
- begin
- case Sender of
- AutorunAniBar.Tmr: AniTimer(AutorunAniBar);
- WizardAniBar.Tmr: AniTimer(WizardAniBar);
- LockScreenAniBar.Tmr: AniTimer(LockScreenAniBar);
- #ifdef AppExe1
- Launch1Tile.AniBar.Tmr: AniTimer(Launch1Tile.AniBar);
- #ifdef AppExe2
- Launch2Tile.AniBar.Tmr: AniTimer(Launch2Tile.AniBar);
- #ifdef AppExe3
- Launch3Tile.AniBar.Tmr: AniTimer(Launch3Tile.AniBar);
- #ifdef AppExe4
- Launch4Tile.AniBar.Tmr: AniTimer(Launch4Tile.AniBar);
- #ifdef AppExe5
- Launch5Tile.AniBar.Tmr: AniTimer(Launch5Tile.AniBar);
- #ifdef AppExe6
- Launch6Tile.AniBar.Tmr: AniTimer(Launch6Tile.AniBar);
- #endif
- #endif
- #endif
- #endif
- #endif
- #endif
- end;
- end;
- (*procedure AniSetVisibility(var AniBar: TAniBar; hVisible: Boolean);
- var
- x: Integer;
- begin
- for x:=0 to 4 do
- AniBar.Dots[x].Visible:=hVisible;
- end;*)
- (*procedure AniSetEnabled(var AniBar: TAniBar; hEnabled: Boolean);
- begin
- AniBar.Tmr.Enabled:=hEnabled;
- end;
- *)
- procedure AniReset(var AniBar: TAniBar);
- var
- x: Integer;
- begin
- for x:=0 to 4 do
- AniBar.Dots[x].Left:=AniBar.Left;
- end;
- function AniCreate(hParent :TWinControl; hLeft, hTop, hWidth, hHeight: Integer; WhiteCol: Boolean): TAniBar;
- var
- x: Integer;
- begin
- Result.Left:=hLeft;
- Result.Top:=hTop;
- Result.Width:=hWidth;
- Result.Height:=hHeight;
- SetArrayLength(Result.Dots,5);
- for x:=0 to 4 do
- begin
- Result.Dots[x]:=TPanel.Create(hParent);
- with Result.Dots[x] do
- begin
- Parent:=hParent;
- Left:=hLeft;
- Top:=hTop;
- Width:=hHeight;
- Height:=hHeight;
- if WhiteCol then
- Color:=$FFFFFF
- else
- Color:=MetroColor(CurCol);
- BorderStyle := bsNone;
- BevelInner := bvNone;
- BevelOuter := bvNone;
- BorderWidth := 0;
- ParentBackground := False;
- end;
- Result.Tmr:= TTimer.Create(AutorunForm);
- with Result.Tmr do
- begin
- OnTimer:=@AniOnTimer;
- Interval:=10;
- Enabled:=True;
- end;
- end;
- end;
- function SldPosX(var Slide: TCusSld; hValue: Longint):Longint;
- begin
- Result:=hValue;
- case hValue of
- -1: Result:=hValue - 3;
- -2: Result:=hValue - 2;
- -3: Result:=hValue - 1;
- end;
- case hValue of
- 1: Result:=hValue + 3;
- 2: Result:=hValue + 2;
- 3: Result:=hValue + 1;
- end;
- case hValue of
- Slide.ImageSize.Width - 1: Result:=hValue - 3;
- Slide.ImageSize.Width - 2: Result:=hValue - 2;
- Slide.ImageSize.Width - 3: Result:=hValue - 1;
- end;
- case hValue of
- -(Slide.ImageSize.Width) + 1: Result:=hValue + 3;
- -(Slide.ImageSize.Width) + 2: Result:=hValue + 2;
- -(Slide.ImageSize.Width) + 3: Result:=hValue + 1;
- end;
- end;
- function SldPosY(var Slide: TCusSld; hValue: Longint):Longint;
- begin
- Result:=hValue;
- case hValue of
- -1: Result:=hValue - 3;
- -2: Result:=hValue - 2;
- -3: Result:=hValue - 1;
- end;
- case hValue of
- 1: Result:=hValue + 3;
- 2: Result:=hValue + 2;
- 3: Result:=hValue + 1;
- end;
- case hValue of
- Slide.ImageSize.Height - 1: Result:=hValue - 3;
- Slide.ImageSize.Height - 2: Result:=hValue - 2;
- Slide.ImageSize.Height - 3: Result:=hValue - 1;
- end;
- case hValue of
- -(Slide.ImageSize.Height) + 1: Result:=hValue + 3;
- -(Slide.ImageSize.Height) + 2: Result:=hValue + 2;
- -(Slide.ImageSize.Height) + 3: Result:=hValue + 1;
- end;
- end;
- procedure SldTimer(var Slide: TCusSld);
- begin
- if Slide.Tmr2.Enabled then
- begin
- if Slide.Showing < Slide.Count then
- Slide.Showing:=Slide.Showing + 1;
- if Slide.Showing = Slide.Count then
- Slide.Showing:=1;
- if (Slide.Showing + 1) = Slide.Count then
- begin
- if Slide.Effect = 0 then
- ImgSetVisibility(Slide.Img[0],True);
- if Slide.Effect = 1 then
- ImgSetTransparent(Slide.Img[0],255);
- if Slide.Effect = 2 then
- ImgSetVisiblePart(Slide.Img[0],-(Slide.ImageSize.Width),0,Slide.ImageSize.Width,Slide.ImageSize.Height);
- if Slide.Effect = 3 then
- ImgSetVisiblePart(Slide.Img[0],Slide.ImageSize.Width,0,Slide.ImageSize.Width,Slide.ImageSize.Height);
- if Slide.Effect = 4 then
- ImgSetVisiblePart(Slide.Img[0],0,-(Slide.ImageSize.Height),Slide.ImageSize.Width,Slide.ImageSize.Height);
- if Slide.Effect = 5 then
- ImgSetVisiblePart(Slide.Img[0],0,Slide.ImageSize.Height,Slide.ImageSize.Width,Slide.ImageSize.Height);
- if Slide.Effect = 6 then
- begin
- ImgSetVisiblePart(Slide.Img[0],Slide.ImageSize.Width,0,Slide.ImageSize.Width,Slide.ImageSize.Height / 2);
- ImgSetVisiblePart(Slide.Img2[0],-(Slide.ImageSize.Width),Slide.ImageSize.Height / 2,Slide.ImageSize.Width,Slide.ImageSize.Height / 2);
- end;
- if Slide.Effect = 7 then
- begin
- ImgSetVisiblePart(Slide.Img[0],0,Slide.ImageSize.Height,Slide.ImageSize.Width / 2,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img2[0],Slide.ImageSize.Width / 2,-(Slide.ImageSize.Height),Slide.ImageSize.Width / 2,Slide.ImageSize.Height);
- end;
- if Slide.Effect = 8 then
- begin
- ImgSetVisiblePart(Slide.Img[0],Slide.ImageSize.Width,0,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
- ImgSetVisiblePart(Slide.Img2[0],-(Slide.ImageSize.Width),Slide.ImageSize.Height / 4 * 1,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
- ImgSetVisiblePart(Slide.Img3[0],Slide.ImageSize.Width,Slide.ImageSize.Height / 4 * 2,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
- ImgSetVisiblePart(Slide.Img4[0],-(Slide.ImageSize.Width),Slide.ImageSize.Height / 4 * 3,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
- end;
- if Slide.Effect = 9 then
- begin
- ImgSetVisiblePart(Slide.Img[0],0,Slide.ImageSize.Height,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img2[0],Slide.ImageSize.Width / 4 * 1,-(Slide.ImageSize.Height),Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img3[0],Slide.ImageSize.Width / 4 * 2,Slide.ImageSize.Height,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img4[0],Slide.ImageSize.Width / 4 * 3,-(Slide.ImageSize.Height),Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
- end;
- end;
- ImgApplyChanges(Slide.Parent.Handle);
- end else
- Slide.Tmr2.Enabled:=True;
- end;
- procedure SldTimer2(var Slide: TCusSld);
- var
- Left,Top,Width,Height: Longint;
- Left2,Top2,Width2,Height2: Longint;
- Left3,Top3,Width3,Height3: Longint;
- Left4,Top4,Width4,Height4: Longint;
- Visible: Boolean;
- Transparent: Integer;
- begin
- if Slide.Effect = 0 then
- begin
- Visible:=ImgGetVisibility(Slide.Img[(Slide.Showing - 1)]);
- ImgSetVisiblePart(Slide.Img[(Slide.Showing - 1)],0,0,Slide.ImageSize.Width,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img[(Slide.Showing - 0)],0,0,Slide.ImageSize.Width,Slide.ImageSize.Height);
- if Visible = True then
- begin
- ImgSetVisibility(Slide.Img[(Slide.Showing - 1)],False);
- ImgSetVisibility(Slide.Img[(Slide.Showing - 0)],True);
- end;
- end;
- if Slide.Effect = 1 then
- begin
- Transparent:=ImgGetTransparent(Slide.Img[(Slide.Showing - 1)]);
- if Transparent > 0 then
- begin
- ImgSetTransparent(Slide.Img[(Slide.Showing - 1)],Transparent - 3);
- ImgSetTransparent(Slide.Img[(Slide.Showing - 0)],-(Transparent - 255) + 3);
- end;
- end;
- if Slide.Effect = 2 then
- begin
- ImgGetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top,Width,Height);
- Left:= SldPosX(Slide,Left);
- Top:= SldPosY(Slide,Top);
- if ((Slide.Showing + 1) = Slide.Count) and ((Left - Slide.ImageSize.Width) <> 0) then
- begin
- ImgGetVisiblePart(Slide.Img[0],Left2,Top2,Width2,Height2);
- Left2:= SldPosX(Slide,Left2);
- Top2:= SldPosY(Slide,Top2);
- ImgSetVisiblePart(Slide.Img[0],Left2 + 4,Top2,Slide.ImageSize.Width,Slide.ImageSize.Height);
- end;
- if (Left - Slide.ImageSize.Width) <> 0 then
- begin
- ImgSetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left + 4,Top,Slide.ImageSize.Width,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img[(Slide.Showing - 0)],Left - Slide.ImageSize.Width + 4,Top,Slide.ImageSize.Width,Slide.ImageSize.Height);
- end;
- end;
- if Slide.Effect = 3 then
- begin
- ImgGetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top,Width,Height);
- Left:= SldPosX(Slide,Left);
- Top:= SldPosY(Slide,Top);
- if ((Slide.Showing + 1) = Slide.Count) and ((Left + Slide.ImageSize.Width) <> 0) then
- begin
- ImgGetVisiblePart(Slide.Img[0],Left2,Top2,Width2,Height2);
- Left2:= SldPosX(Slide,Left2);
- Top2:= SldPosY(Slide,Top2);
- ImgSetVisiblePart(Slide.Img[0],Left2 - 4,Top2,Slide.ImageSize.Width,Slide.ImageSize.Height);
- end;
- if (Left + Slide.ImageSize.Width) <> 0 then
- begin
- ImgSetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left - 4,Top,Slide.ImageSize.Width,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img[(Slide.Showing - 0)],Left + Slide.ImageSize.Width - 4,Top,Slide.ImageSize.Width,Slide.ImageSize.Height);
- end;
- end;
- if Slide.Effect = 4 then
- begin
- ImgGetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top,Width,Height);
- Left:= SldPosX(Slide,Left);
- Top:= SldPosY(Slide,Top);
- if ((Slide.Showing + 1) = Slide.Count) and ((Top - Slide.ImageSize.Height) <> 0) then
- begin
- ImgGetVisiblePart(Slide.Img[0],Left2,Top2,Width2,Height2);
- Left2:= SldPosX(Slide,Left2);
- Top2:= SldPosY(Slide,Top2);
- ImgSetVisiblePart(Slide.Img[0],Left2,Top2 + 4,Slide.ImageSize.Width,Slide.ImageSize.Height);
- end;
- if (Top - Slide.ImageSize.Height) <> 0 then
- begin
- ImgGetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top,Width,Height);
- Left:= SldPosX(Slide,Left);
- Top:= SldPosY(Slide,Top);
- ImgSetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top + 4,Slide.ImageSize.Width,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img[(Slide.Showing - 0)],Left,Top - Slide.ImageSize.Height + 4,Slide.ImageSize.Width,Slide.ImageSize.Height);
- end;
- end;
- if Slide.Effect = 5 then
- begin
- ImgGetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top,Width,Height);
- Left:= SldPosX(Slide,Left);
- Top:= SldPosY(Slide,Top);
- if ((Slide.Showing + 1) = Slide.Count) and ((Top + Slide.Height) <> 0) then
- begin
- ImgGetVisiblePart(Slide.Img[0],Left2,Top2,Width2,Height2);
- Left2:= SldPosX(Slide,Left2);
- Top2:= SldPosY(Slide,Top2);
- ImgSetVisiblePart(Slide.Img[0],Left2,Top2 - 4,Slide.ImageSize.Width,Slide.ImageSize.Height);
- end;
- if (Top + Slide.Height) <> 0 then
- begin
- ImgSetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top - 4,Slide.ImageSize.Width,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img[(Slide.Showing - 0)],Left,Top + Slide.Height - 4,Slide.ImageSize.Width,Slide.ImageSize.Height);
- end;
- end;
- if Slide.Effect = 6 then
- begin
- ImgGetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top,Width,Height);
- Left:= SldPosX(Slide,Left);
- Top:= SldPosY(Slide,Top);
- ImgGetVisiblePart(Slide.Img2[(Slide.Showing - 1)],Left3,Top3,Width3,Height3);
- Left3:= SldPosX(Slide,Left3);
- Top3:= SldPosY(Slide,Top3);
- if ((Slide.Showing + 1) = Slide.Count) and ((Left + Slide.ImageSize.Width) <> 0) then
- begin
- ImgGetVisiblePart(Slide.Img[0],Left2,Top2,Width2,Height2);
- Left2:= SldPosX(Slide,Left2);
- Top2:= SldPosY(Slide,Top2);
- ImgGetVisiblePart(Slide.Img2[0],Left4,Top4,Width4,Height4);
- Left4:= SldPosX(Slide,Left4);
- Top4:= SldPosY(Slide,Top4);
- ImgSetVisiblePart(Slide.Img[0],Left2 - 4,Top2,Slide.ImageSize.Width,Slide.ImageSize.Height / 2);
- ImgSetVisiblePart(Slide.Img2[0],Left4 + 4,Top4,Slide.ImageSize.Width,Slide.ImageSize.Height / 2);
- end;
- if (Left + Slide.ImageSize.Width) <> 0 then
- begin
- ImgSetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left - 4,Top,Slide.ImageSize.Width,Slide.ImageSize.Height / 2);
- ImgSetVisiblePart(Slide.Img[(Slide.Showing - 0)],Left + Slide.ImageSize.Width - 4,Top,Slide.ImageSize.Width,Slide.ImageSize.Height / 2);
- ImgSetVisiblePart(Slide.Img2[(Slide.Showing - 1)],Left3 + 4,Top3,Slide.ImageSize.Width,Slide.ImageSize.Height / 2);
- ImgSetVisiblePart(Slide.Img2[(Slide.Showing - 0)],Left3 - Slide.ImageSize.Width + 4,Top3,Slide.ImageSize.Width,Slide.ImageSize.Height / 2);
- end;
- end;
- if Slide.Effect = 7 then
- begin
- ImgGetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top,Width,Height);
- Left:= SldPosX(Slide,Left);
- Top:= SldPosY(Slide,Top);
- ImgGetVisiblePart(Slide.Img2[(Slide.Showing - 1)],Left3,Top3,Width3,Height3);
- Left3:= SldPosX(Slide,Left3);
- Top3:= SldPosY(Slide,Top3);
- if ((Slide.Showing + 1) = Slide.Count) and ((Top + Slide.ImageSize.Height) <> 0) then
- begin
- ImgGetVisiblePart(Slide.Img[0],Left2,Top2,Width2,Height2);
- Left2:= SldPosX(Slide,Left2);
- Top2:= SldPosY(Slide,Top2);
- ImgGetVisiblePart(Slide.Img2[0],Left4,Top4,Width4,Height4);
- Left4:= SldPosX(Slide,Left4);
- Top4:= SldPosY(Slide,Top4);
- ImgSetVisiblePart(Slide.Img[0],Left2,Top2 - 4,Slide.ImageSize.Width / 2,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img2[0],Left4,Top4 + 4,Slide.ImageSize.Width / 2,Slide.ImageSize.Height);
- end;
- if (Top + Slide.ImageSize.Height) <> 0 then
- begin
- ImgSetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top - 4,Slide.ImageSize.Width / 2,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img[(Slide.Showing - 0)],Left,Top + Slide.ImageSize.Height - 4,Slide.ImageSize.Width / 2,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img2[(Slide.Showing - 1)],Left3,Top3 + 4,Slide.ImageSize.Width / 2,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img2[(Slide.Showing - 0)],Left3,Top3 - Slide.ImageSize.Height + 4,Slide.ImageSize.Width / 2,Slide.ImageSize.Height);
- end;
- end;
- if Slide.Effect = 8 then
- begin
- ImgGetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top,Width,Height);
- Left:= SldPosX(Slide,Left);
- Top:= SldPosY(Slide,Top);
- ImgGetVisiblePart(Slide.Img2[(Slide.Showing - 1)],Left3,Top3,Width3,Height3);
- Left3:= SldPosX(Slide,Left3);
- Top3:= SldPosY(Slide,Top3);
- if ((Slide.Showing + 1) = Slide.Count) and ((Left + Slide.ImageSize.Width) <> 0) then
- begin
- ImgGetVisiblePart(Slide.Img[0],Left2,Top2,Width2,Height2);
- Left2:= SldPosX(Slide,Left2);
- Top2:= SldPosY(Slide,Top2);
- ImgGetVisiblePart(Slide.Img2[0],Left4,Top4,Width4,Height4);
- Left4:= SldPosX(Slide,Left4);
- Top4:= SldPosY(Slide,Top4);
- ImgSetVisiblePart(Slide.Img[0],Left2 - 4,Top2,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
- ImgSetVisiblePart(Slide.Img2[0],Left4 + 4,Top4 * 1,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
- ImgSetVisiblePart(Slide.Img3[0],Left2 - 4,Top4 * 2,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
- ImgSetVisiblePart(Slide.Img4[0],Left4 + 4,Top4 * 3,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
- end;
- if (Left + Slide.ImageSize.Width) <> 0 then
- begin
- ImgSetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left - 4,Top,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
- ImgSetVisiblePart(Slide.Img[(Slide.Showing - 0)],Left + Slide.ImageSize.Width - 4,Top,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
- ImgSetVisiblePart(Slide.Img2[(Slide.Showing - 1)],Left3 + 4,Top3 * 1,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
- ImgSetVisiblePart(Slide.Img2[(Slide.Showing - 0)],Left3 - Slide.ImageSize.Width + 4,Top3 * 1,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
- ImgSetVisiblePart(Slide.Img3[(Slide.Showing - 1)],Left - 4,Top3 * 2,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
- ImgSetVisiblePart(Slide.Img3[(Slide.Showing - 0)],Left + Slide.ImageSize.Width - 4,Top3 * 2,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
- ImgSetVisiblePart(Slide.Img4[(Slide.Showing - 1)],Left3 + 4,Top3 * 3,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
- ImgSetVisiblePart(Slide.Img4[(Slide.Showing - 0)],Left3 - Slide.ImageSize.Width + 4,Top3 * 3,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
- end;
- end;
- if Slide.Effect = 9 then
- begin
- ImgGetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top,Width,Height);
- Left:= SldPosX(Slide,Left);
- Top:= SldPosY(Slide,Top);
- ImgGetVisiblePart(Slide.Img2[(Slide.Showing - 1)],Left3,Top3,Width3,Height3);
- Left3:= SldPosX(Slide,Left3);
- Top3:= SldPosY(Slide,Top3);
- if ((Slide.Showing + 1) = Slide.Count) and ((Top + Slide.ImageSize.Height) <> 0) then
- begin
- ImgGetVisiblePart(Slide.Img[0],Left2,Top2,Width2,Height2);
- Left2:= SldPosX(Slide,Left2);
- Top2:= SldPosY(Slide,Top2);
- ImgGetVisiblePart(Slide.Img2[0],Left4,Top4,Width4,Height4);
- Left4:= SldPosX(Slide,Left4);
- Top4:= SldPosY(Slide,Top4);
- ImgSetVisiblePart(Slide.Img[0],Left2,Top2 - 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img2[0],Left4 * 1,Top4 + 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img3[0],Left4 * 2,Top2 - 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img4[0],Left4 * 3,Top4 + 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
- end;
- if (Top + Slide.ImageSize.Height) <> 0 then
- begin
- ImgSetVisiblePart(Slide.Img[(Slide.Showing - 1)],Left,Top - 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img[(Slide.Showing - 0)],Left,Top + Slide.ImageSize.Height - 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img2[(Slide.Showing - 1)],Left3 * 1,Top3 + 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img2[(Slide.Showing - 0)],Left3 * 1,Top3 - Slide.ImageSize.Height + 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img3[(Slide.Showing - 1)],Left3 * 2,Top - 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img3[(Slide.Showing - 0)],Left3 * 2,Top + Slide.ImageSize.Height - 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img4[(Slide.Showing - 1)],Left3 * 3,Top3 + 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img4[(Slide.Showing - 0)],Left3 * 3,Top3 - Slide.ImageSize.Height + 4,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
- end;
- end;
- ImgApplyChanges(Slide.Parent.Handle);
- end;
- procedure SldTimer3(var Slide: TCusSld);
- begin
- Slide.Tmr3.Enabled:=False;
- Slide.Tmr.Enabled:=True;
- if Slide.Tmr2.Enabled then
- begin
- if Slide.Showing < Slide.Count then
- Slide.Showing:=Slide.Showing + 1;
- if Slide.Showing = Slide.Count then
- Slide.Showing:=1;
- if (Slide.Showing + 1) = Slide.Count then
- begin
- if Slide.Effect = 0 then
- ImgSetVisibility(Slide.Img[0],True);
- if Slide.Effect = 1 then
- ImgSetTransparent(Slide.Img[0],255);
- if Slide.Effect = 2 then
- ImgSetVisiblePart(Slide.Img[0],-(Slide.ImageSize.Width),0,Slide.ImageSize.Width,Slide.ImageSize.Height);
- if Slide.Effect = 3 then
- ImgSetVisiblePart(Slide.Img[0],Slide.ImageSize.Width,0,Slide.ImageSize.Width,Slide.ImageSize.Height);
- if Slide.Effect = 4 then
- ImgSetVisiblePart(Slide.Img[0],0,-(Slide.ImageSize.Height),Slide.ImageSize.Width,Slide.ImageSize.Height);
- if Slide.Effect = 5 then
- ImgSetVisiblePart(Slide.Img[0],0,Slide.ImageSize.Height,Slide.ImageSize.Width,Slide.ImageSize.Height);
- if Slide.Effect = 6 then
- begin
- ImgSetVisiblePart(Slide.Img[0],Slide.ImageSize.Width,0,Slide.ImageSize.Width,Slide.ImageSize.Height / 2);
- ImgSetVisiblePart(Slide.Img2[0],-(Slide.ImageSize.Width),Slide.ImageSize.Height / 2,Slide.ImageSize.Width,Slide.ImageSize.Height / 2);
- end;
- if Slide.Effect = 7 then
- begin
- ImgSetVisiblePart(Slide.Img[0],0,Slide.ImageSize.Height,Slide.ImageSize.Width / 2,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img2[0],Slide.ImageSize.Width / 2,-(Slide.ImageSize.Height),Slide.ImageSize.Width / 2,Slide.ImageSize.Height);
- end;
- if Slide.Effect = 8 then
- begin
- ImgSetVisiblePart(Slide.Img[0],Slide.ImageSize.Width,0,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
- ImgSetVisiblePart(Slide.Img2[0],-(Slide.ImageSize.Width),Slide.ImageSize.Height / 4 * 1,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
- ImgSetVisiblePart(Slide.Img3[0],Slide.ImageSize.Width,Slide.ImageSize.Height / 4 * 2,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
- ImgSetVisiblePart(Slide.Img4[0],-(Slide.ImageSize.Width),Slide.ImageSize.Height / 4 * 3,Slide.ImageSize.Width,Slide.ImageSize.Height / 4);
- end;
- if Slide.Effect = 9 then
- begin
- ImgSetVisiblePart(Slide.Img[0],0,Slide.ImageSize.Height,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img2[0],Slide.ImageSize.Width / 4 * 1,-(Slide.ImageSize.Height),Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img3[0],Slide.ImageSize.Width / 4 * 2,Slide.ImageSize.Height,Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
- ImgSetVisiblePart(Slide.Img4[0],Slide.ImageSize.Width / 4 * 3,-(Slide.ImageSize.Height),Slide.ImageSize.Width / 4,Slide.ImageSize.Height);
- end;
- end;
- ImgApplyChanges(Slide.Parent.Handle);
- end else
- Slide.Tmr2.Enabled:=True;
- end;
- procedure SldOnTimer(Sender: TObject);
- begin
- case Sender of
- #ifdef AppExe1
- Launch1Tile.Slide.Tmr: SldTimer(Launch1Tile.Slide);
- #ifdef AppExe2
- Launch2Tile.Slide.Tmr: SldTimer(Launch2Tile.Slide);
- #ifdef AppExe3
- Launch3Tile.Slide.Tmr: SldTimer(Launch3Tile.Slide);
- #ifdef AppExe4
- Launch4Tile.Slide.Tmr: SldTimer(Launch4Tile.Slide);
- #ifdef AppExe5
- Launch5Tile.Slide.Tmr: SldTimer(Launch5Tile.Slide);
- #ifdef AppExe6
- Launch6Tile.Slide.Tmr: SldTimer(Launch6Tile.Slide);
- #endif
- #endif
- #endif
- #endif
- #endif
- #endif
- AutorunSlide.Tmr: SldTimer(AutorunSlide);
- WizardSlide.Tmr: SldTimer(WizardSlide);
- end;
- end;
- procedure SldOnTimer2(Sender: TObject);
- begin
- case Sender of
- #ifdef AppExe1
- Launch1Tile.Slide.Tmr2: SldTimer2(Launch1Tile.Slide);
- #ifdef AppExe2
- Launch2Tile.Slide.Tmr2: SldTimer2(Launch2Tile.Slide);
- #ifdef AppExe3
- Launch3Tile.Slide.Tmr2: SldTimer2(Launch3Tile.Slide);
- #ifdef AppExe4
- Launch4Tile.Slide.Tmr2: SldTimer2(Launch4Tile.Slide);
- #ifdef AppExe5
- Launch5Tile.Slide.Tmr2: SldTimer2(Launch5Tile.Slide);
- #ifdef AppExe6
- Launch6Tile.Slide.Tmr2: SldTimer2(Launch6Tile.Slide);
- #endif
- #endif
- #endif
- #endif
- #endif
- #endif
- AutorunSlide.Tmr2: SldTimer2(AutorunSlide);
- WizardSlide.Tmr2: SldTimer2(WizardSlide);
- end;
- end;
- procedure SldOnTimer3(Sender: TObject);
- begin
- case Sender of
- #ifdef AppExe1
- Launch1Tile.Slide.Tmr3: SldTimer3(Launch1Tile.Slide);
- #ifdef AppExe2
- Launch2Tile.Slide.Tmr3: SldTimer3(Launch2Tile.Slide);
- #ifdef AppExe3
- Launch3Tile.Slide.Tmr3: SldTimer3(Launch3Tile.Slide);
- #ifdef AppExe4
- Launch4Tile.Slide.Tmr3: SldTimer3(Launch4Tile.Slide);
- #ifdef AppExe5
- Launch5Tile.Slide.Tmr3: SldTimer3(Launch5Tile.Slide);
- #ifdef AppExe6
- Launch6Tile.Slide.Tmr3: SldTimer3(Launch6Tile.Slide);
- #endif
- #endif
- #endif
- #endif
- #endif
- #endif
- AutorunSlide.Tmr3: SldTimer3(AutorunSlide);
- WizardSlide.Tmr3: SldTimer3(WizardSlide);
- end;
- end;
- function SlideCreate(hParent :TWinControl; ImgDir, ImgSfx: String; hImgTime, hLeft, hTop, hWidth, hHeight: Longint; hRTime: Boolean; hEffect: Integer): TCusSld;
- var
- x: Integer;
- begin
- if hEffect = 10 then
- hEffect:=Random(10);
- Result.Parent:=hParent;
- Result.Effect:=hEffect;
- Result.Left:=hLeft;
- Result.Top:=hTop;
- Result.Width:=hWidth;
- Result.Height:=hHeight;
- Result.ImageSize:=GetPictureSize(ImgDir + IntToStr(1) + ImgSfx);
- x:=0;
- repeat
- x:= x + 1;
- until FileExists(ImgDir + IntToStr(x) + ImgSfx) = False;
- Result.Count:=x;
- SetArrayLength(Result.Img,x + 1);
- SetArrayLength(Result.Img2,x + 1);
- SetArrayLength(Result.Img3,x + 1);
- SetArrayLength(Result.Img4,x + 1);
- x:=0;
- repeat
- x:= x + 1;
- if x = 1 then
- begin
- if hEffect < 6 then
- begin
- Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth,hHeight,True,True);
- ImgSetVisiblePart(Result.Img[x - 1],0,0,Result.ImageSize.Width,Result.ImageSize.Height);
- end else begin
- if hEffect = 6 then
- begin
- Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth,hHeight / 2,True,True);
- Result.Img2[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop + (hHeight / 2),hWidth,hHeight / 2,True,True);
- ImgSetVisiblePart(Result.Img[x - 1],0,0,Result.ImageSize.Width,Result.ImageSize.Height / 2);
- ImgSetVisiblePart(Result.Img2[x - 1],0,Result.ImageSize.Height / 2,Result.ImageSize.Width,Result.ImageSize.Height / 2);
- end;
- if hEffect = 7 then
- begin
- Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth / 2,hHeight,True,True);
- Result.Img2[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft + (hWidth / 2),hTop,hWidth / 2,hHeight,True,True);
- ImgSetVisiblePart(Result.Img[x - 1],0,0,Result.ImageSize.Width / 2,Result.ImageSize.Height);
- ImgSetVisiblePart(Result.Img2[x - 1],Result.ImageSize.Width / 2,0,Result.ImageSize.Width / 2,Result.ImageSize.Height);
- end;
- if hEffect = 8 then
- begin
- Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth,hHeight / 4,True,True);
- Result.Img2[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop + (hHeight / 4 * 1),hWidth,hHeight / 4,True,True);
- Result.Img3[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop + (hHeight / 4 * 2),hWidth,hHeight / 4,True,True);
- Result.Img4[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop + (hHeight / 4 * 3),hWidth,hHeight / 4,True,True);
- ImgSetVisiblePart(Result.Img[x - 1],0,0,Result.ImageSize.Width,Result.ImageSize.Height / 4);
- ImgSetVisiblePart(Result.Img2[x - 1],0,Result.ImageSize.Height / 4 * 1,Result.ImageSize.Width,Result.ImageSize.Height / 4);
- ImgSetVisiblePart(Result.Img3[x - 1],0,Result.ImageSize.Height / 4 * 2,Result.ImageSize.Width,Result.ImageSize.Height / 4);
- ImgSetVisiblePart(Result.Img4[x - 1],0,Result.ImageSize.Height / 4 * 3,Result.ImageSize.Width,Result.ImageSize.Height / 4);
- end;
- if hEffect = 9 then
- begin
- Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth / 4,hHeight,True,True);
- Result.Img2[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft + (hWidth / 4 * 1),hTop,hWidth / 4,hHeight,True,True);
- Result.Img3[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft + (hWidth / 4 * 2),hTop,hWidth / 4,hHeight,True,True);
- Result.Img4[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft + (hWidth / 4 * 3),hTop,hWidth / 4,hHeight,True,True);
- ImgSetVisiblePart(Result.Img[x - 1],0,0,Result.ImageSize.Width / 4,Result.ImageSize.Height);
- ImgSetVisiblePart(Result.Img2[x - 1],Result.ImageSize.Width / 4 * 1,0,Result.ImageSize.Width / 4,Result.ImageSize.Height);
- ImgSetVisiblePart(Result.Img3[x - 1],Result.ImageSize.Width / 4 * 2,0,Result.ImageSize.Width / 4,Result.ImageSize.Height);
- ImgSetVisiblePart(Result.Img4[x - 1],Result.ImageSize.Width / 4 * 3,0,Result.ImageSize.Width / 4,Result.ImageSize.Height);
- end;
- end;
- end else begin
- if hEffect = 0 then
- begin
- Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth,hHeight,True,True);
- ImgSetVisiblePart(Result.Img[x - 1],0,0,Result.ImageSize.Width,Result.ImageSize.Height);
- ImgSetVisibility(Result.Img[x - 1],False);
- end;
- if hEffect = 1 then
- begin
- Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth,hHeight,True,True);
- ImgSetVisiblePart(Result.Img[x - 1],0,0,Result.ImageSize.Width,Result.ImageSize.Height);
- ImgSetTransparent(Result.Img[x - 1],0);
- end;
- if hEffect = 2 then
- begin
- Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth,hHeight,True,True);
- ImgSetVisiblePart(Result.Img[x - 1],-(Result.ImageSize.Width),0,Result.ImageSize.Width,Result.ImageSize.Height);
- end;
- if hEffect = 3 then
- begin
- Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth,hHeight,True,True);
- ImgSetVisiblePart(Result.Img[x - 1],(Result.ImageSize.Width),0,Result.ImageSize.Width,Result.ImageSize.Height);
- end;
- if hEffect = 4 then
- begin
- Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth,hHeight,True,True);
- ImgSetVisiblePart(Result.Img[x - 1],0,-(Result.ImageSize.Height),Result.ImageSize.Width,Result.ImageSize.Height);
- end;
- if hEffect = 5 then
- begin
- Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth,hHeight,True,True);
- ImgSetVisiblePart(Result.Img[x - 1],0,(Result.ImageSize.Height),Result.ImageSize.Width,Result.ImageSize.Height);
- end;
- if hEffect = 6 then
- begin
- Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth,hHeight / 2,True,True);
- Result.Img2[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop + (hHeight / 2),hWidth,hHeight / 2,True,True);
- ImgSetVisiblePart(Result.Img[x - 1],(Result.ImageSize.Width),0,Result.ImageSize.Width,Result.ImageSize.Height / 2);
- ImgSetVisiblePart(Result.Img2[x - 1],-(Result.ImageSize.Width),Result.ImageSize.Height / 2,Result.ImageSize.Width,Result.ImageSize.Height / 2);
- end;
- if hEffect = 7 then
- begin
- Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth / 2,hHeight,True,True);
- Result.Img2[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft + (hWidth / 2),hTop,hWidth / 2,hHeight,True,True);
- ImgSetVisiblePart(Result.Img[x - 1],0,(Result.ImageSize.Height),Result.ImageSize.Width / 2,Result.ImageSize.Height);
- ImgSetVisiblePart(Result.Img2[x - 1],Result.ImageSize.Width / 2,-(Result.ImageSize.Height),Result.ImageSize.Width / 2,Result.ImageSize.Height);
- end;
- if hEffect = 8 then
- begin
- Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth,hHeight / 4,True,True);
- Result.Img2[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop + (hHeight / 4) * 1,hWidth,hHeight / 4,True,True);
- Result.Img3[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop + (hHeight / 4) * 2,hWidth,hHeight / 4,True,True);
- Result.Img4[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop + (hHeight / 4) * 3,hWidth,hHeight / 4,True,True);
- ImgSetVisiblePart(Result.Img[x - 1],(Result.ImageSize.Width),0,Result.ImageSize.Width,Result.ImageSize.Height / 4);
- ImgSetVisiblePart(Result.Img2[x - 1],-(Result.ImageSize.Width),Result.ImageSize.Height / 4 * 1,Result.ImageSize.Width,Result.ImageSize.Height / 4);
- ImgSetVisiblePart(Result.Img3[x - 1],(Result.ImageSize.Width),Result.ImageSize.Height / 4 * 2,Result.ImageSize.Width,Result.ImageSize.Height / 4);
- ImgSetVisiblePart(Result.Img4[x - 1],-(Result.ImageSize.Width),Result.ImageSize.Height / 4 * 3,Result.ImageSize.Width,Result.ImageSize.Height / 4);
- end;
- if hEffect = 9 then
- begin
- Result.Img[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft,hTop,hWidth / 4,hHeight,True,True);
- Result.Img2[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft + (hWidth / 4) * 1,hTop,hWidth / 4,hHeight,True,True);
- Result.Img3[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft + (hWidth / 4) * 2,hTop,hWidth / 4,hHeight,True,True);
- Result.Img4[x - 1]:=ImgLoad(hParent.Handle, ImgDir + IntToStr(x) + ImgSfx,hLeft + (hWidth / 4) * 3,hTop,hWidth / 4,hHeight,True,True);
- ImgSetVisiblePart(Result.Img[x - 1],0,(Result.ImageSize.Height),Result.ImageSize.Width / 4,Result.ImageSize.Height);
- ImgSetVisiblePart(Result.Img2[x - 1],Result.ImageSize.Width / 4 * 1,-(Result.ImageSize.Height),Result.ImageSize.Width / 4,Result.ImageSize.Height);
- ImgSetVisiblePart(Result.Img3[x - 1],Result.ImageSize.Width / 4 * 2,(Result.ImageSize.Height),Result.ImageSize.Width / 4,Result.ImageSize.Height);
- ImgSetVisiblePart(Result.Img4[x - 1],Result.ImageSize.Width / 4 * 3,-(Result.ImageSize.Height),Result.ImageSize.Width / 4,Result.ImageSize.Height);
- end;
- end;
- until Result.Count = x;
- Result.Showing:=1;
- Result.Tmr:= TTimer.Create(hParent);
- with Result.Tmr do
- begin
- Interval:=hImgTime;
- OnTimer:=@SldOnTimer;
- if hRTime then
- Enabled:=False
- else
- Enabled:=True;
- end;
- Result.Tmr2:= TTimer.Create(hParent);
- with Result.Tmr2 do
- begin
- Interval:=1;
- OnTimer:=@SldOnTimer2;
- Enabled:=False;
- end;
- if hRTime then
- begin
- Result.Tmr3:= TTimer.Create(hParent);
- with Result.Tmr3 do
- begin
- Interval:=Random(hImgTime / 1000) * 1000;
- OnTimer:=@SldOnTimer3;
- Enabled:=True;
- end;
- end;
- ImgApplyChanges(hParent.Handle);
- end;
- procedure TleTimer(var Tile: TCusTle);
- begin
- if Tile.Startup.Visible then
- Tile.Timer:=Tile.Timer - 25;
- if (Tile.Timer = 0) and (Tile.Startup.Visible = True) then
- begin
- Tile.Startup.Visible:=False;
- Tile.Event(0);
- end;
- end;
- procedure TleClick(var Tile: TCusTle);
- var
- x: Integer;
- begin
- Tile.Startup.BringToFront;
- Tile.Timer:=20000;
- for x:=0 to 4 do
- Tile.AniBar.Dots[x].BringToFront;
- Tile.Startup.Visible:=True;
- //AniSetEnabled(Tile.AniBar,True);
- end;
- procedure TleMouseDown(var Tile: TCusTle);
- begin
- ReleaseCapture;
- SendMessage(Tile.Base.Handle,$0112,$F012,0);
- end;
- procedure TleOnTimer(Sender: TObject);
- begin
- case Sender of
- #ifdef AppExe1
- Launch1Tile.Tmr: TleTimer(Launch1Tile);
- #ifdef AppExe2
- Launch2Tile.Tmr: TleTimer(Launch2Tile);
- #ifdef AppExe3
- Launch3Tile.Tmr: TleTimer(Launch3Tile);
- #ifdef AppExe4
- Launch4Tile.Tmr: TleTimer(Launch4Tile);
- #ifdef AppExe5
- Launch5Tile.Tmr: TleTimer(Launch5Tile);
- #ifdef AppExe6
- Launch6Tile.Tmr: TleTimer(Launch6Tile);
- #endif
- #endif
- #endif
- #endif
- #endif
- #endif
- end;
- ImgApplyChanges(AutorunForm.Handle);
- end;
- procedure TleOnClick(Sender: TObject);
- begin
- case Sender of
- #ifdef AppExe1
- Launch1Tile.Base: TleClick(Launch1Tile);
- Launch1Tile.Labl: TleClick(Launch1Tile);
- #ifdef AppExe2
- Launch2Tile.Base: TleClick(Launch2Tile);
- Launch2Tile.Labl: TleClick(Launch2Tile);
- #ifdef AppExe3
- Launch3Tile.Base: TleClick(Launch3Tile);
- Launch3Tile.Labl: TleClick(Launch3Tile);
- #ifdef AppExe4
- Launch4Tile.Base: TleClick(Launch4Tile);
- Launch4Tile.Labl: TleClick(Launch4Tile);
- #ifdef AppExe5
- Launch5Tile.Base: TleClick(Launch5Tile);
- Launch5Tile.Labl: TleClick(Launch5Tile);
- #ifdef AppExe6
- Launch6Tile.Base: TleClick(Launch6Tile);
- Launch6Tile.Labl: TleClick(Launch6Tile);
- #endif
- #endif
- #endif
- #endif
- #endif
- #endif
- end;
- end;
- procedure TlcOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
- begin
- case Sender of
- InstallTile.Base: TleMouseDown(InstallTile);
- InstallTile.Labl: TleMouseDown(InstallTile);
- UninstallTile.Base: TleMouseDown(UninstallTile);
- UninstallTile.Labl: TleMouseDown(UninstallTile);
- ExitTile.Base: TleMouseDown(ExitTile);
- ExitTile.Labl: TleMouseDown(ExitTile);
- #ifdef AppExe1
- Launch1Tile.Base: TleMouseDown(Launch1Tile);
- Launch1Tile.Labl: TleMouseDown(Launch1Tile);
- #ifdef AppExe2
- Launch2Tile.Base: TleMouseDown(Launch2Tile);
- Launch2Tile.Labl: TleMouseDown(Launch2Tile);
- #ifdef AppExe3
- Launch3Tile.Base: TleMouseDown(Launch3Tile);
- Launch3Tile.Labl: TleMouseDown(Launch3Tile);
- #ifdef AppExe4
- Launch4Tile.Base: TleMouseDown(Launch4Tile);
- Launch4Tile.Labl: TleMouseDown(Launch4Tile);
- #ifdef AppExe5
- Launch5Tile.Base: TleMouseDown(Launch5Tile);
- Launch5Tile.Labl: TleMouseDown(Launch5Tile);
- #ifdef AppExe6
- Launch6Tile.Base: TleMouseDown(Launch6Tile);
- Launch6Tile.Labl: TleMouseDown(Launch6Tile);
- #endif
- #endif
- #endif
- #endif
- #endif
- #endif
- end;
- end;
- procedure TileSetEvent(var Tile: TCusTle; Event: TNotifyEvent);
- begin
- if Tile.Animation then
- Tile.Event:=Event
- else begin
- Tile.Labl.OnClick:=Event;
- Tile.Base.OnClick:=Event;
- end;
- end;
- procedure TileModal(var Tile: TCusTle);
- begin
- Tile.ModalBtn.Click;
- end;
- function TileCreate(hParent :TWinControl; hLeft, hTop, hWidth, hHeight: Integer; hImg, hText: String; Modal: Integer; hAnimation: Boolean): TCusTle;
- begin
- Result.StartInfo:=hImg;
- Result.Animation:=hAnimation;
- Result.Timer:=10000;
- Result.Base:= TListView.Create(hParent);
- with Result.Base do
- begin
- Parent:=hParent;
- Left:=hLeft;
- Top:=hTop;
- Width:=hWidth;
- Height:=hHeight;
- Color:=MetroColor(CurCol);
- OnClick:=@TleOnClick;
- end;
- if hImg <> '' then
- begin
- if hAnimation then
- begin
- #ifdef Image
- if FileExists(hImg + '_Icon2.png') then
- Result.Slide:=SlideCreate(Result.Base,PAnsiChar(hImg) + '_Icon','.png',10000, 0, 0, hWidth, hHeight,True,SlideAuto)
- else
- Result.MImg:=ImgLoad(Result.Base.Handle, PAnsiChar(hImg + '_Icon1.png'), 2, 2, hWidth - 8, hHeight - 8, True, True);
- #endif
- end else begin
- Result.MImg:=ImgLoad(Result.Base.Handle, PAnsiChar(hImg), 2, 2, hWidth - 8, hHeight - 8, True, True);
- end;
- ImgApplyChanges(Result.Base.Handle);
- end;
- Result.Labl:= TLabel.Create(Result.Base);
- with Result.Labl do
- begin
- Parent:=Result.Base;
- Autosize:= False;
- Left:=4;
- Top:=4;
- Width:=hWidth - 8;
- Height:=hHeight - 12;
- Alignment:= taLeftJustify;
- Layout:= tlBottom;
- with Font do
- begin
- Name:='Segoe UI SemiBold';
- Size:=9;
- Color:=$FFFFFF;
- end;
- Caption:=hText;
- OnClick:=@TleOnClick;
- end;
- if hAnimation then
- begin
- Result.Tmr:= TTimer.Create(hParent);
- with Result.Tmr do
- begin
- OnTimer:=@TleOnTimer;
- Interval:=10;
- Enabled:=True;
- end;
- Result.Startup:= TListView.Create(hParent);
- with Result.Startup do
- begin
- Parent:=hParent;
- Left:=0;
- Top:=0;
- Width:=hParent.Width;
- Height:=hParent.Height;
- Color:=MetroColor(CurCol);
- Visible:=False;
- end;
- Result.Labl2:= TLabel.Create(Result.Startup);
- with Result.Labl2 do
- begin
- Parent:=Result.Startup;
- Autosize:= False;
- Left:=4;
- Top:=4;
- Width:=hParent.Width - 8;
- Height:=hParent.Height - 20;
- Alignment:= taCenter;
- Layout:= tlBottom;
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=27;
- Color:=$FFFFFF;
- end;
- Caption:=hText;
- end;
- #ifdef Image
- ImgLoad(Result.Startup.Handle, PAnsiChar(hImg) + '_Background.jpg', 0, 0, hParent.Width - 4, hParent.Height - 4, True, True);
- #ifdef Dark
- ImgLoad(Result.Startup.Handle,ExpandConstant('{tmp}\Dark.png'),0,0,AutorunForm.ClientWidth,AutorunForm.ClientHeight,True,True);
- #else
- ImgLoad(Result.Startup.Handle,ExpandConstant('{tmp}\Light.png'),0,0,AutorunForm.ClientWidth,AutorunForm.ClientHeight,True,True);
- #endif
- Result.AniBar:= AniCreate(Result.Startup,0,0,hParent.Width,4,False);
- #else
- Result.AniBar:= AniCreate(Result.Startup,0,0,hParent.Width,4,True);
- #endif
- //AniSetEnabled(Result.AniBar,False);
- ImgApplyChanges(Result.Startup.Handle);
- end;
- Result.ModalBtn:= TButton.Create(hParent);
- with Result.ModalBtn do
- begin
- SetBounds(0,0,0,0);
- ModalResult:=Modal;
- Parent:= hParent;
- end;
- end;
- procedure LockDeactivate(Sender: TObject);forward;
- procedure LockOnKeyDown(var Lock: TCusLck);
- begin
- Lock.Dirct:= 'Up';
- end;
- procedure LockOnDeactivate(var Lock: TCusLck);
- begin
- Lock.Dirct:='Down'
- end;
- procedure LockOnActivate(var Lock: TCusLck);
- begin
- if Lock.Locked = False then
- Application.OnDeactivate:=@LockDeactivate;
- Lock.Locked:=True;
- end;
- procedure LockOnFocus(var Lock: TCusLck);
- begin
- ReleaseCapture;
- SendMessage(Lock.Parent.Handle,$0112,$F012,0);
- Lock.Tile.SetFocus;
- end;
- function LockPosY(var Lock: TCusLck; hValue: Longint):Longint;
- begin
- Result:=hValue;
- case hValue of
- -1: Result:=hValue - 7;
- -2: Result:=hValue - 6;
- -3: Result:=hValue - 5;
- -4: Result:=hValue - 4;
- -5: Result:=hValue - 3;
- -6: Result:=hValue - 2;
- -7: Result:=hValue - 1;
- end;
- case hValue of
- 1: Result:=hValue + 7;
- 2: Result:=hValue + 6;
- 3: Result:=hValue + 5;
- 4: Result:=hValue + 4;
- 5: Result:=hValue + 3;
- 6: Result:=hValue + 2;
- 7: Result:=hValue + 1;
- end;
- case hValue of
- Lock.Tile.Height - 1: Result:=hValue - 7;
- Lock.Tile.Height - 2: Result:=hValue - 6;
- Lock.Tile.Height - 3: Result:=hValue - 5;
- Lock.Tile.Height - 4: Result:=hValue - 4;
- Lock.Tile.Height - 5: Result:=hValue - 3;
- Lock.Tile.Height - 6: Result:=hValue - 2;
- Lock.Tile.Height - 7: Result:=hValue - 1;
- end;
- case hValue of
- -(Lock.Tile.Height) + 1: Result:=hValue + 7;
- -(Lock.Tile.Height) + 2: Result:=hValue + 6;
- -(Lock.Tile.Height) + 3: Result:=hValue + 5;
- -(Lock.Tile.Height) + 4: Result:=hValue + 4;
- -(Lock.Tile.Height) + 5: Result:=hValue + 3;
- -(Lock.Tile.Height) + 6: Result:=hValue + 2;
- -(Lock.Tile.Height) + 7: Result:=hValue + 1;
- end;
- end;
- procedure LockOnTimer(var Lock: TCusLck);
- begin
- Lock.LTime.Caption:=MetroTime;
- Lock.LDate.Caption:=MetroDate;
- if not (Lock.Tile.Top = -(Lock.Tile.Height)) then
- begin
- if Lock.Labl.Top > (Lock.Parent.ClientHeight - 40) then
- Lock.Labl.Top:=Lock.Labl.Top - 1;
- if (Lock.Dirct = 'Up') then
- Lock.Tile.Top:=LockPosY(Lock,Lock.Tile.Top) - 8;
- end;
- if not (Lock.Tile.Top = 0) then
- begin
- if Lock.Labl.Top < (Lock.Parent.ClientHeight + 60) then
- Lock.Labl.Top:=Lock.Labl.Top + 1;
- if (Lock.Dirct = 'Down') then
- Lock.Tile.Top:=LockPosY(Lock,Lock.Tile.Top) + 8;
- end;
- end;
- procedure LockKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
- begin
- if Key = 38 then
- begin
- case Sender of
- AutorunLock.Tile: LockOnKeyDown(AutorunLock);
- WizardLock.Tile: LockOnKeyDown(WizardLock);
- end;
- end;
- end;
- procedure LockDeactivate(Sender: TObject);
- begin
- case Sender of
- Application:
- begin
- LockOnDeactivate(AutorunLock);
- LockOnDeactivate(WizardLock);
- end;
- end;
- end;
- procedure LockActivate(Sender: TObject);
- begin
- case Sender of
- Application:
- begin
- LockOnActivate(AutorunLock);
- LockOnActivate(WizardLock);
- end;
- end;
- end;
- procedure LockFocus(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
- begin
- case Sender of
- AutorunLock.Tile: LockOnFocus(AutorunLock);
- AutorunLock.LTime: LockOnFocus(AutorunLock);
- AutorunLock.LDate: LockOnFocus(AutorunLock);
- AutorunLock.Labl: LockOnFocus(AutorunLock);
- WizardLock.Tile: LockOnFocus(WizardLock);
- WizardLock.LTime: LockOnFocus(WizardLock);
- WizardLock.LDate: LockOnFocus(WizardLock);
- WizardLock.Labl: LockOnFocus(WizardLock);
- end;
- end;
- procedure LockTimer(Sender: TObject);
- begin
- case Sender of
- AutorunLock.Tmr: LockOnTimer(AutorunLock);
- WizardLock.Tmr: LockOnTimer(WizardLock);
- end;
- end;
- (*function LockCreate(hParent :TSetupForm; hImg: String; hLock: Boolean): TCusLck;
- begin
- Result.Parent:=hParent;
- Result.Tile:=TListView.Create(hParent);
- Result.Locked:=hLock;
- with Result.Tile do
- begin
- Parent:=hParent;
- Left:=0;
- if hLock then
- Top:=0
- else
- Top:=-(hParent.ClientHeight);
- Width:=hParent.ClientWidth;
- Height:=hParent.ClientHeight;
- Color:=MetroColor(CurCol);
- OnKeyDown:=@LockKeyDown;
- OnMouseDown:=@LockFocus;
- end;
- if hLock then
- Application.OnDeactivate:=@LockDeactivate
- else
- Application.OnDeactivate:=nil;
- Application.OnActivate:=@LockActivate;
- if hLock then
- Result.Dirct:='Down'
- else
- Result.Dirct:='Up';
- #ifdef Image
- ImgLoad(Result.Tile.Handle, PAnsiChar(hImg), 2, 2, hParent.ClientWidth - 8, hParent.ClientHeight - 8, True, True);
- ImgApplyChanges(Result.Tile.Handle);
- #endif
- Result.LTime:=TLabel.Create(Result.Tile);
- with Result.LTime do
- begin
- Parent:=Result.Tile;
- SetBounds(40,Result.Parent.ClientHeight - 170,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=52;
- Color:=$FFFFFF;
- end;
- Caption:=MetroTime;
- OnMouseDown:=@LockFocus;
- end;
- Result.LDate:=TLabel.Create(Result.Tile);
- with Result.LDate do
- begin
- Parent:=Result.Tile;
- SetBounds(40,Result.Parent.ClientHeight - 100,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=36;
- Color:=$FFFFFF;
- end;
- Caption:=MetroDate;
- OnMouseDown:=@LockFocus;
- end;
- Result.Labl:= TLabel.Create(Result.Tile);
- with Result.Labl do
- begin
- Parent:=Result.Tile;
- SetBounds(40,Result.Parent.ClientHeight + 60,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=13;
- Color:=$FFFFFF;
- end;
- Caption:=Lowercase('Press up to unlock this screen');
- OnMouseDown:=@LockFocus;
- end;
- Result.Tmr:= TTimer.Create(hParent);
- with Result.Tmr do begin
- OnTimer:=@LockTimer;
- Interval:=1;
- Enabled:=True;
- end;
- end;*)
- //Windows Phone Technology v4.1 created by Razor12911
- function InstallRedist(Redist: Integer):Boolean;
- begin
- case Redist of
- 1: Result:= CheckBoxGetChecked(Redist1);
- 2: Result:= CheckBoxGetChecked(Redist2);
- 3: Result:= CheckBoxGetChecked(Redist3);
- 4: Result:= CheckBoxGetChecked(Redist4);
- 5: Result:= CheckBoxGetChecked(Redist5);
- end;
- end;
- #ifdef AppExe1
- procedure Launch1TileClick(Sender: TObject);
- var
- InstallDir: String;
- ResultCode: Integer;
- begin
- if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#AppName}_is1','Inno Setup: App Path', InstallDir) then
- begin
- if Exec(AddBackslash(InstallDir) + '{#E1[60]}\{#E1[61]}', '', '', SW_SHOW,ewNoWait, ResultCode) then
- TileModal(Launch1Tile)
- else
- MsgBox('Failed to initiate program. Application executable not found.', mbError, MB_OK);
- end else
- MsgBox('Program is currently not installed.', mbInformation, MB_OK);
- end;
- #ifdef AppExe2
- procedure Launch2TileClick(Sender: TObject);
- var
- InstallDir: String;
- ResultCode: Integer;
- begin
- if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#AppName}_is1','Inno Setup: App Path', InstallDir) then
- begin
- if Exec(AddBackslash(InstallDir) + '{#E2[60]}\{#E2[61]}', '', '', SW_SHOW,ewNoWait, ResultCode) then
- TileModal(Launch2Tile)
- else
- MsgBox('Failed to initiate program. Application executable not found.', mbError, MB_OK);
- end else
- MsgBox('Program is currently not installed.', mbInformation, MB_OK);
- end;
- #ifdef AppExe3
- procedure Launch3TileClick(Sender: TObject);
- var
- InstallDir: String;
- ResultCode: Integer;
- begin
- if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#AppName}_is1','Inno Setup: App Path', InstallDir) then
- begin
- if Exec(AddBackslash(InstallDir) + '{#E3[60]}\{#E3[61]}', '', '', SW_SHOW,ewNoWait, ResultCode) then
- TileModal(Launch3Tile)
- else
- MsgBox('Failed to initiate program. Application executable not found.', mbError, MB_OK);
- end else
- MsgBox('Program is currently not installed.', mbInformation, MB_OK);
- end;
- #ifdef AppExe4
- procedure Launch4TileClick(Sender: TObject);
- var
- InstallDir: String;
- ResultCode: Integer;
- begin
- if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#AppName}_is1','Inno Setup: App Path', InstallDir) then
- begin
- if Exec(AddBackslash(InstallDir) + '{#E4[60]}\{#E4[61]}', '', '', SW_SHOW,ewNoWait, ResultCode) then
- TileModal(Launch4Tile)
- else
- MsgBox('Failed to initiate program. Application executable not found.', mbError, MB_OK);
- end else
- MsgBox('Program is currently not installed.', mbInformation, MB_OK);
- end;
- #ifdef AppExe5
- procedure Launch5TileClick(Sender: TObject);
- var
- InstallDir: String;
- ResultCode: Integer;
- begin
- if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#AppName}_is1','Inno Setup: App Path', InstallDir) then
- begin
- if Exec(AddBackslash(InstallDir) + '{#E5[60]}\{#E5[61]}', '', '', SW_SHOW,ewNoWait, ResultCode) then
- TileModal(Launch5Tile)
- else
- MsgBox('Failed to initiate program. Application executable not found.', mbError, MB_OK);
- end else
- MsgBox('Program is currently not installed.', mbInformation, MB_OK);
- end;
- #ifdef AppExe6
- procedure Launch6TileClick(Sender: TObject);
- var
- InstallDir: String;
- ResultCode: Integer;
- begin
- if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#AppName}_is1','Inno Setup: App Path', InstallDir) then
- begin
- if Exec(AddBackslash(InstallDir) + '{#E6[60]}\{#E6[61]}', '', '', SW_SHOW,ewNoWait, ResultCode) then
- TileModal(Launch6Tile)
- else
- MsgBox('Failed to initiate program. Application executable not found.', mbError, MB_OK);
- end else
- MsgBox('Program is currently not installed.', mbInformation, MB_OK);
- end;
- #endif
- #endif
- #endif
- #endif
- #endif
- #endif
- procedure InstallTileClick(Sender: TObject);
- begin
- TileModal(InstallTile);
- end;
- procedure UninstallTileClick(Sender: TObject);
- var
- UninstallExe: String;
- ResultCode: Integer;
- begin
- if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#AppName}_is1','UninstallString', UninstallExe) then
- begin
- if Exec(RemoveQuotes(UninstallExe), '', '', SW_SHOW,ewNoWait, ResultCode) then
- TileModal(UninstallTile)
- else
- MsgBox('Failed to initiate uninstaller. Unsinatller executable not found.', mbInformation, MB_OK);
- end else
- MsgBox('Program is currently not installed.', mbInformation, MB_OK);
- end;
- procedure ExitTileClick(Sender: TObject);
- begin
- TileModal(ExitTile);
- end;
- procedure AFMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);forward;
- function InitializeSetup:Boolean;
- begin
- SetPriorityClass(GetCurrentProcess, HIGH_PRIORITY_CLASS);
- #ifdef CurColor
- CurCol:={#CurColor};
- #else
- CurCol:=1;
- #endif
- ExtractTemporaryFile('botva2.dll');
- #ifdef Image
- ExtractTemporaryFile('Dark.png');
- ExtractTemporaryFile('Light.png');
- #ifexist "Graphics\Images\Lockscreen.jpg"
- ExtractTemporaryFile('Lockscreen.jpg');
- #endif
- #sub ExtractFile2
- ExtractTemporaryFile('Setup{#i}.jpg');
- #endsub
- #for {i = 1; FileExists(StringChange("Graphics\Images\SetupFileName.jpg", "FileName", Str(i))) != 0; i++} ExtractFile2
- #ifdef Autorun
- #sub ExtractFile1
- ExtractTemporaryFile('Autorun{#i}.jpg');
- #endsub
- #for {i = 1; FileExists(StringChange("Graphics\Images\AutorunFileName.jpg", "FileName", Str(i))) != 0; i++} ExtractFile1
- #endif
- #endif
- #ifdef Autorun
- ExtractTemporaryFile('Exit.png');
- ExtractTemporaryFile('Install.png');
- ExtractTemporaryFile('Uninstall.png');
- #ifdef Image
- #ifdef AppExe1
- ExtractTemporaryFile('Tile1_Background.jpg');
- #sub ExtractExeIcon1
- ExtractTemporaryFile('Tile1_Icon{#i}.png');
- #endsub
- #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile1_IconFileName.png", "FileName", Str(i))) != 0; i++} ExtractExeIcon1
- #ifdef AppExe2
- ExtractTemporaryFile('Tile2_Background.jpg');
- #sub ExtractExeIcon2
- ExtractTemporaryFile('Tile2_Icon{#i}.png');
- #endsub
- #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile2_IconFileName.png", "FileName", Str(i))) != 0; i++} ExtractExeIcon2
- #ifdef AppExe3
- ExtractTemporaryFile('Tile3_Background.jpg');
- #sub ExtractExeIcon3
- ExtractTemporaryFile('Tile3_Icon{#i}.png');
- #endsub
- #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile3_IconFileName.png", "FileName", Str(i))) != 0; i++} ExtractExeIcon3
- #ifdef AppExe4
- ExtractTemporaryFile('Tile4_Background.jpg');
- #sub ExtractExeIcon4
- ExtractTemporaryFile('Tile4_Icon{#i}.png');
- #endsub
- #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile4_IconFileName.png", "FileName", Str(i))) != 0; i++} ExtractExeIcon4
- #ifdef AppExe5
- ExtractTemporaryFile('Tile5_Background.jpg');
- #sub ExtractExeIcon5
- ExtractTemporaryFile('Tile5_Icon{#i}.png');
- #endsub
- #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile5_IconFileName.png", "FileName", Str(i))) != 0; i++} ExtractExeIcon5
- #ifdef AppExe6
- ExtractTemporaryFile('Tile6_Background.jpg');
- #sub ExtractExeIcon6
- ExtractTemporaryFile('Tile6_Icon{#i}.png');
- #endsub
- #for {i = 1; FileExists(StringChange("Graphics\Tiles\Tile6_IconFileName.png", "FileName", Str(i))) != 0; i++} ExtractExeIcon6
- #endif
- #endif
- #endif
- #endif
- #endif
- #endif
- #endif
- #endif
- AutorunForm:= CreateCustomForm();
- with AutorunForm do begin
- BorderStyle:=bsNone;
- ClientWidth:=800;
- ClientHeight:=448;
- Center;
- #ifdef Dark
- Color:=$252525;
- #else
- Color:=$FFFFFF;
- #endif
- end;
- with TPanel.Create(AutorunForm) do
- begin
- Parent:=AutorunForm;
- Left:=0;
- Top:=15;
- Width:=10;
- Height:=50;
- Color:=MetroColor(CurCol);
- BorderStyle := bsNone;
- BevelInner := bvNone;
- BevelOuter := bvNone;
- BorderWidth := 0;
- ParentBackground := False;
- end;
- with TPanel.Create(AutorunForm) do
- begin
- Parent:=AutorunForm;
- Left:=0;
- Top:=AutorunForm.ClientHeight - 5;
- Width:=AutorunForm.ClientWidth;
- Height:=5;
- Color:=MetroColor(CurCol);
- BorderStyle := bsNone;
- BevelInner := bvNone;
- BevelOuter := bvNone;
- BorderWidth := 0;
- ParentBackground := False;
- end;
- with TLabel.Create(AutorunForm) do
- begin
- Parent:=AutorunForm;
- SetBounds(20,10,0,0);
- with Font do
- begin
- Name:='Segoe UI';
- Size:=11;
- Color:=MetroColor(CurCol);
- end;
- Caption:=Uppercase('{#AppName}');
- end;
- with TLabel.Create(AutorunForm) do
- begin
- Parent:=AutorunForm;
- AutoSize:=False;
- SetBounds(2,AutorunForm.ClientHeight-18,AutorunForm.ClientWidth-4,18);
- with Font do
- begin
- Name:='Segoe UI SemiBold';
- Size:=7;
- Color:=MetroColor(CurCol);
- end;
- Alignment:=taRightJustify;
- Caption:=Uppercase('{#Watermark}');
- end;
- with TLabel.Create(AutorunForm) do
- begin
- Parent:=AutorunForm;
- SetBounds(20,20,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=27;
- Color:=MetroColor(CurCol);
- end;
- Caption:='Start';
- end;
- with TLabel.Create(AutorunForm) do
- begin
- Parent:= AutorunForm;
- Left:= 0;
- Top:= 0;
- Width:= AutorunForm.ClientWidth;
- Height:= AutorunForm.ClientHeight;
- AutoSize:= false;
- Transparent:= true;
- WordWrap:= False;
- OnMouseDown:=@AFMouseDown;
- end;
- #ifdef Image
- if FileExists(ExpandConstant('{tmp}\Autorun2.jpg')) then
- begin
- AutorunSlide:=SlideCreate(AutorunForm,ExpandConstant('{tmp}\Autorun'),'.jpg',10000,0,0,AutorunForm.ClientWidth,AutorunForm.ClientHeight,False,SlideAuto);
- end else begin
- ImgLoad(AutorunForm.Handle,ExpandConstant('{tmp}\Autorun1.jpg'),0,0,AutorunForm.ClientWidth,AutorunForm.ClientHeight,True,True);
- end;
- #ifdef Dark
- ImgLoad(AutorunForm.Handle,ExpandConstant('{tmp}\Dark.png'),0,0,AutorunForm.ClientWidth,AutorunForm.ClientHeight,True,True);
- #else
- ImgLoad(AutorunForm.Handle,ExpandConstant('{tmp}\Light.png'),0,0,AutorunForm.ClientWidth,AutorunForm.ClientHeight,True,True);
- #endif
- ImgApplyChanges(AutorunForm.Handle);
- #endif
- #ifdef AppExe1
- #ifdef AppExe4
- InstallTile:=TileCreate(AutorunForm,412,80,108,108,ExpandConstant('{tmp}\Install.png'),'Install',mrOk, False);
- TileSetEvent(InstallTile,@InstallTileClick);
- UninstallTile:=TileCreate(AutorunForm,412,192,108,108,ExpandConstant('{tmp}\Uninstall.png'),'Uninstall',mrNone, False);
- TileSetEvent(UninstallTile,@UninstallTileClick);
- ExitTile:=TileCreate(AutorunForm,412,304,108,108,ExpandConstant('{tmp}\Exit.png'),'Exit',mrCancel, False);
- TileSetEvent(ExitTile,@ExitTileClick);
- #else
- InstallTile:=TileCreate(AutorunForm,216,80,108,108,ExpandConstant('{tmp}\Install.png'),'Install',mrOk, False);
- TileSetEvent(InstallTile,@InstallTileClick);
- UninstallTile:=TileCreate(AutorunForm,216,192,108,108,ExpandConstant('{tmp}\Uninstall.png'),'Uninstall',mrNone, False);
- TileSetEvent(UninstallTile,@UninstallTileClick);
- ExitTile:=TileCreate(AutorunForm,216,304,108,108,ExpandConstant('{tmp}\Exit.png'),'Exit',mrCancel, False);
- TileSetEvent(ExitTile,@ExitTileClick);
- #endif
- #else
- InstallTile:=TileCreate(AutorunForm,20,80,108,108,ExpandConstant('{tmp}\Install.png'),'Install',mrOk, False);
- TileSetEvent(InstallTile,@InstallTileClick);
- UninstallTile:=TileCreate(AutorunForm,20,192,108,108,ExpandConstant('{tmp}\Uninstall.png'),'Uninstall',mrNone, False);
- TileSetEvent(UninstallTile,@UninstallTileClick);
- ExitTile:=TileCreate(AutorunForm,20,304,108,108,ExpandConstant('{tmp}\Exit.png'),'Exit',mrCancel, False);
- TileSetEvent(ExitTile,@ExitTileClick);
- #endif
- #ifdef AppExe1
- Launch1Tile:=TileCreate(AutorunForm,20,80,192,108,ExpandConstant('{tmp}\Tile1'),'{#E1[59]}',mrCancel, True);
- TileSetEvent(Launch1Tile,@Launch1TileClick);
- #ifdef AppExe2
- Launch2Tile:=TileCreate(AutorunForm,20,192,192,108,ExpandConstant('{tmp}\Tile2'),'{#E2[59]}',mrCancel, True);
- TileSetEvent(Launch2Tile,@Launch2TileClick);
- #ifdef AppExe3
- Launch3Tile:=TileCreate(AutorunForm,20,304,192,108,ExpandConstant('{tmp}\Tile3'),'{#E3[59]}',mrCancel, True);
- TileSetEvent(Launch3Tile,@Launch3TileClick);
- #ifdef AppExe4
- Launch4Tile:=TileCreate(AutorunForm,216,80,192,108,ExpandConstant('{tmp}\Tile4'),'{#E4[59]}',mrCancel, True);
- TileSetEvent(Launch4Tile,@Launch4TileClick);
- #ifdef AppExe5
- Launch5Tile:=TileCreate(AutorunForm,216,192,192,108,ExpandConstant('{tmp}\Tile5'),'{#E5[59]}',mrCancel, True);
- TileSetEvent(Launch5Tile,@Launch5TileClick);
- #ifdef AppExe6
- Launch6Tile:=TileCreate(AutorunForm,216,304,192,108,ExpandConstant('{tmp}\Tile6'),'{#E6[59]}',mrCancel, True);
- TileSetEvent(Launch6Tile,@Launch6TileClick);
- #endif
- #endif
- #endif
- #endif
- #endif
- #endif
- // AutorunLock:=LockCreate(AutorunForm,ExpandConstant('{tmp}\Lockscreen.jpg'),True);
- #ifdef Autorun
- Result:=AutorunForm.ShowModal = mrOk;
- #else
- Result:=True;
- #endif
- end;
- procedure AFMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
- begin
- ReleaseCapture;
- SendMessage(AutorunForm.Handle,$0112,$F012,0);
- end;
- procedure WFMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
- begin
- ReleaseCapture;
- SendMessage(WizardForm.Handle,$0112,$F012,0);
- end;
- procedure CFMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
- begin
- ReleaseCapture;
- SendMessage(CancelForm.Handle,$0112,$F012,0);
- end;
- function CreateShortcuts:Boolean;
- begin
- if ISDoneError then
- Result:=False
- else
- Result:=CheckBoxGetChecked(DesktopChk);
- end;
- procedure DirEditOnChange(Sender: TObject);
- begin
- EditSetText(SelectDirEdt,MinimizePathName(WizardForm.DirEdit.Text, SelectDirEdt.Top.Font, SelectDirEdt.Top.Width));
- end;
- procedure CFShow(Sender: TObject);
- begin
- SetWindowPos(CancelForm.Handle,0,WizardForm.Left,WizardForm.Top,0,0,$515);
- end;
- procedure CFMoved(Sender: TObject);
- begin
- if CancelForm.Showing then
- SetWindowPos(WizardForm.Handle,0,CancelForm.Left,CancelForm.Top,0,0,$515);
- end;
- procedure MinimizeBtnClick(Sender: Tobject);
- begin
- SendMessage(WizardForm.Handle,$112,61472,0);
- end;
- procedure CloseBtnClick(Sender: Tobject);
- begin
- WizardForm.CancelButton.Click;
- end;
- procedure BackBtnClick(Sender: Tobject);
- var
- n: Integer;
- begin
- if WizardForm.CurPageID = wpWelcome then
- WizardForm.CancelButton.Click;
- if WizardForm.CurPageID = wpSelectDir then
- WizardForm.BackButton.Click;
- if WizardForm.CurPageID = wpInstalling then
- WizardForm.CancelButton.Click;
- if WizardForm.CurPageID = wpFinished then
- begin
- Exec(ExpandConstant('{uninstallexe}'), '/Silent','', sw_Show, ewWaitUntilTerminated, n);
- ButtonSetEnabled(BackBtn,False);
- end
- end;
- procedure NextBtnClick(Sender: Tobject);
- begin
- if WizardForm.CurPageID = wpInstalling then
- WizardForm.CancelButton.Click
- else
- WizardForm.NextButton.Click;
- end;
- procedure BrowseBtnClick(Sender: Tobject);
- begin
- WizardForm.DirBrowseButton.Click;
- end;
- procedure CancelYesBtnClick(Sender: Tobject);
- begin
- ButtonModal(CancelYesBtn);
- end;
- procedure CancelNoBtnClick(Sender: Tobject);
- begin
- ButtonModal(CancelNoBtn);
- end;
- procedure InstallOnTimer(Sender: TObject);
- var
- pr, i1, i2: Extended;
- begin
- if (WizardForm.ProgressGauge.Position>WizardForm.ProgressGauge.Min) then begin
- i1:=WizardForm.ProgressGauge.Position-WizardForm.ProgressGauge.Min;
- i2:=WizardForm.ProgressGauge.Max-WizardForm.ProgressGauge.Min;
- pr:=i1*100/i2;
- ProgressSetProgress(InstallPBr,pr);
- end;
- if WizardForm.StatusLabel.Caption <> '' then
- InstallLabel4.Caption:=WizardForm.StatusLabel.Caption;
- end;
- procedure InitializeWizard;
- var
- Str: String;
- AppSize2: Integer;
- begin
- #ifdef CurColor
- CurCol:={#CurColor};
- #else
- CurCol:=1;
- #endif
- with WizardForm do
- begin
- BorderStyle:=bsNone;
- ClientWidth:=800;
- ClientHeight:=448;
- Center;
- #ifdef Dark
- Color:=$252525;
- #else
- Color:=$FFFFFF;
- #endif
- OuterNotebook.Hide;
- InnerNotebook.Hide;
- Bevel.Hide;
- PageNameLabel.Hide;
- PageDescriptionLabel.Hide;
- MainPanel.Hide;
- BackButton.SetBounds(0,0,0,0);
- NextButton.SetBounds(0,0,0,0);
- CancelButton.SetBounds(0,0,0,0);
- DirBrowseButton.SetBounds(0,0,0,0);
- GroupBrowseButton.SetBounds(0,0,0,0);
- DirEdit.OnChange:=@DirEditOnChange;
- end;
- #ifdef Image
- if FileExists(ExpandConstant('{tmp}\Setup2.jpg')) then
- begin
- #if ReadIni(SourcePath + "\WindowsPhone.iss", "Archives", "Archive1Type", "") != ""
- WizardSlide:=SlideCreate(WizardForm,ExpandConstant('{tmp}\Setup'),'.jpg',10000,0,0,WizardForm.ClientWidth,WizardForm.ClientHeight,False,SlideNone);
- #else
- WizardSlide:=SlideCreate(WizardForm,ExpandConstant('{tmp}\Setup'),'.jpg',10000,0,0,WizardForm.ClientWidth,WizardForm.ClientHeight,False,SlideAuto);
- #endif
- end else begin
- ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Setup1.jpg'),0,0,WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
- end;
- #ifdef Dark
- ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Dark.png'),0,0,WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
- #else
- ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Light.png'),0,0,WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
- #endif
- ImgApplyChanges(WizardForm.Handle);
- #endif
- with TLabel.Create(WizardForm) do
- begin
- Parent:= WizardForm;
- Left:= 0;
- Top:= 0;
- Width:= WizardForm.ClientWidth;
- Height:= WizardForm.ClientHeight;
- AutoSize:= false;
- Transparent:= true;
- WordWrap:= False;
- OnMouseDown:=@WFMouseDown;
- end;
- TopLeftPanel:= TPanel.Create(WizardForm);
- with TopLeftPanel do
- begin
- Parent:=WizardForm;
- Left:=0;
- Top:=15;
- Width:=10;
- Height:=50;
- Color:=MetroColor(CurCol);
- BorderStyle := bsNone;
- BevelInner := bvNone;
- BevelOuter := bvNone;
- BorderWidth := 0;
- ParentBackground := False;
- OnMouseDown:=@WFMouseDown;
- end;
- BottomPanel:= TPanel.Create(WizardForm);
- with BottomPanel do
- begin
- Parent:=WizardForm;
- Left:=0;
- Top:=WizardForm.ClientHeight - 5;
- Width:=WizardForm.ClientWidth;
- Height:=5;
- Color:=MetroColor(CurCol);
- BorderStyle := bsNone;
- BevelInner := bvNone;
- BevelOuter := bvNone;
- BorderWidth := 0;
- ParentBackground := False;
- OnMouseDown:=@WFMouseDown;
- end;
- TitleLabel1:= TLabel.Create(WizardForm);
- with TitleLabel1 do
- begin
- Parent:=WizardForm;
- SetBounds(20,10,0,0);
- with Font do
- begin
- Name:='Segoe UI';
- Size:=11;
- Color:=MetroColor(CurCol);
- end;
- Caption:=Uppercase('{#AppName}');
- OnMouseDown:=@WFMouseDown;
- end;
- TitleLabel2:= TLabel.Create(WizardForm);
- with TitleLabel2 do
- begin
- Parent:=WizardForm;
- AutoSize:=False;
- SetBounds(2,WizardForm.ClientHeight-18,WizardForm.ClientWidth-4,18);
- with Font do
- begin
- Name:='Segoe UI SemiBold';
- Size:=7;
- Color:=MetroColor(CurCol);
- end;
- Alignment:=taRightJustify;
- Caption:=Uppercase('{#Watermark}');
- OnMouseDown:=@WFMouseDown;
- end;
- StatusLabel1:= TLabel.Create(WizardForm);
- with StatusLabel1 do
- begin
- Parent:=WizardForm;
- SetBounds(20,20,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=27;
- Color:=MetroColor(CurCol);
- end;
- Caption:='Repack';
- OnMouseDown:=@WFMouseDown;
- end;
- StatusLabel2:= TLabel.Create(WizardForm);
- with StatusLabel2 do
- begin
- Parent:=WizardForm;
- SetBounds((StatusLabel1.Left + StatusLabel1.Width) + 10,20,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=27;
- #ifdef Dark
- Color:=$AAAAAA;
- #else
- Color:=$222222;
- #endif
- end;
- Caption:='by';
- OnMouseDown:=@WFMouseDown;
- end;
- StatusLabel3:= TLabel.Create(WizardForm);
- with StatusLabel3 do
- begin
- Parent:=WizardForm;
- SetBounds((StatusLabel2.Left + StatusLabel2.Width) + 10,20,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=27;
- #ifdef Dark
- Color:=$AAAAAA;
- #else
- Color:=$222222;
- #endif
- end;
- Caption:='{#Repacker}';
- OnMouseDown:=@WFMouseDown;
- end;
- StatusLabel4:= TLabel.Create(WizardForm);
- with StatusLabel4 do
- begin
- Parent:=WizardForm;
- SetBounds((StatusLabel3.Left + StatusLabel3.Width) + 10,20,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=27;
- #ifdef Dark
- Color:=$AAAAAA;
- #else
- Color:=$222222;
- #endif
- end;
- Caption:='';
- OnMouseDown:=@WFMouseDown;
- end;
- WelcomeLabel1:= TLabel.Create(WizardForm);
- with WelcomeLabel1 do
- begin
- Parent:=WizardForm;
- SetBounds(20,70,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=18;
- #ifdef Dark
- Color:=$FFFFFF;
- #else
- Color:=$252525
- #endif
- end;
- Caption:='Welcome to {#AppName} Installer Wizard';
- OnMouseDown:=@WFMouseDown;
- end;
- WelcomeLabel2:= TLabel.Create(WizardForm);
- with WelcomeLabel2 do
- begin
- Parent:=WizardForm;
- SetBounds(20,110,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=11;
- #ifdef Dark
- Color:=$AAAAAA;
- #else
- Color:=$222222;
- #endif
- end;
- Caption:='You are installing {#AppName} on your computer.'+#13+
- 'It is highly recommended that you close all programs'+#13+
- 'that may interfere with the installation progress.';
- OnMouseDown:=@WFMouseDown;
- end;
- WelcomeLabel3:= TLabel.Create(WizardForm);
- with WelcomeLabel3 do begin
- Parent:=WizardForm;
- SetBounds(20,370,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=13;
- Color:=MetroColor(CurCol);
- end;
- Caption:=Lowercase('When ready click Proceed to continue with installation or close to exit installation.');
- OnMouseDown:=@WFMouseDown;
- end;
- SelectDirLabel1:= TLabel.Create(WizardForm);
- with SelectDirLabel1 do
- begin
- Parent:=WizardForm;
- SetBounds(20,70,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=18;
- #ifdef Dark
- Color:=$FFFFFF;
- #else
- Color:=$252525
- #endif
- end;
- Caption:='Select the destination of the product you are installing';
- OnMouseDown:=@WFMouseDown;
- end;
- SelectDirLabel2:= TLabel.Create(WizardForm);
- with SelectDirLabel2 do
- begin
- Parent:=WizardForm;
- SetBounds(20,110,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=11;
- #ifdef Dark
- Color:=$AAAAAA;
- #else
- Color:=$222222;
- #endif
- end;
- Caption:='{#AppName} will be installed in this Directory.'+#13+
- 'You can select a different directory by clicking the browse button.'+#13+
- 'Make sure you have enough space before installing.';
- OnMouseDown:=@WFMouseDown;
- end;
- SelectDirLabel3:= TLabel.Create(WizardForm);
- with SelectDirLabel3 do
- begin
- Parent:=WizardForm;
- SetBounds(20,176,0,0);
- with Font do
- begin
- Name:='Segoe UI Bold';
- Size:=8;
- Color:=MetroColor(CurCol);
- end;
- Str:=SetupMessage(msgDiskSpaceMBLabel);
- StringChange(Str,'[mb]', '{#AppSize}');
- Caption:=Str;
- OnMouseDown:=@WFMouseDown;
- end;
- InstallLabel1:= TLabel.Create(WizardForm);
- with InstallLabel1 do
- begin
- Parent:=WizardForm;
- SetBounds(20,70,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=18;
- #ifdef Dark
- Color:=$FFFFFF;
- #else
- Color:=$252525
- #endif
- end;
- Caption:='Installing {#AppName}';
- OnMouseDown:=@WFMouseDown;
- end;
- InstallLabel2:= TLabel.Create(WizardForm);
- with InstallLabel2 do
- begin
- Parent:=WizardForm;
- SetBounds(20,110,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=11;
- #ifdef Dark
- Color:=$AAAAAA;
- #else
- Color:=$222222;
- #endif
- end;
- Caption:='Installer Wizard is installing the product.'+#13+
- 'This might take a while.';
- OnMouseDown:=@WFMouseDown;
- end;
- InstallLabel3:= TLabel.Create(WizardForm);
- with InstallLabel3 do
- begin
- Parent:=WizardForm;
- SetBounds(20,175,0,0);
- with Font do
- begin
- Name:='Segoe UI SemiBold';
- Size:=9;
- #ifdef Dark
- Color:=$AAAAAA;
- #else
- Color:=$222222;
- #endif
- end;
- Caption:='Status:';
- OnMouseDown:=@WFMouseDown;
- end;
- InstallLabel4:= TLabel.Create(WizardForm);
- with InstallLabel4 do
- begin
- Parent:=WizardForm;
- SetBounds((InstallLabel3.Left + InstallLabel3.Width) + 2,176,0,0);
- with Font do
- begin
- Name:='Segoe UI Bold';
- Size:=8;
- Color:=MetroColor(CurCol);
- end;
- Caption:='Installing...';
- OnMouseDown:=@WFMouseDown;
- end;
- InstallTimer:= TTimer.Create(WizardForm);
- with InstallTimer do
- begin
- OnTimer:=@InstallOnTimer
- Interval:=10;
- Enabled:=True;
- end;
- FinishLabel1:= TLabel.Create(WizardForm);
- with FinishLabel1 do
- begin
- Parent:=WizardForm;
- SetBounds(20,70,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=18;
- #ifdef Dark
- Color:=$FFFFFF;
- #else
- Color:=$252525
- #endif
- end;
- Caption:='Completing the {#AppName} Install Wizard';
- OnMouseDown:=@WFMouseDown;
- end;
- FinishLabel2:= TLabel.Create(WizardForm);
- with FinishLabel2 do
- begin
- Parent:=WizardForm;
- SetBounds(20,110,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=11;
- #ifdef Dark
- Color:=$AAAAAA;
- #else
- Color:=$222222;
- #endif
- end;
- Caption:='Installer has finished installing the product on your computer'+#13+
- '{#AppName} has been installed successfully.';
- OnMouseDown:=@WFMouseDown;
- end;
- FinishLabel3:= TLabel.Create(WizardForm);
- with FinishLabel3 do begin
- Parent:=WizardForm;
- SetBounds(20,370,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=13;
- Color:=MetroColor(CurCol);
- end;
- Caption:=Lowercase('Click Finish to Close Install Wizard or Uninstall to Rollback changes made.');
- OnMouseDown:=@WFMouseDown;
- end;
- NextBtn:=ButtonCreate(WizardForm,692,400,88,26,False,mrNone);
- ButtonSetText(NextBtn,'Proceed');
- ButtonSetEvent(NextBtn,@NextBtnClick);
- BackBtn:=ButtonCreate(WizardForm,20,400,88,26,False,mrNone);
- ButtonSetText(BackBtn,'Close');
- ButtonSetEvent(BackBtn,@BackBtnClick);
- BrowseBtn:=ButtonCreate(WizardForm,SelectDirLabel2.Width - 5,195,30,20,False,mrNone);
- ButtonSetText(BrowseBtn,'...');
- ButtonSetEvent(BrowseBtn,@BrowseBtnClick);
- DesktopChk:=CheckBoxCreate(WizardForm,40,225,16,16,'Create a desktop icon');
- CheckBoxSetChecked(DesktopChk,True);
- #ifdef Redist1
- Redist1:=CheckBoxCreate(WizardForm,240,225,16,16,'Install {#R1[59]}');
- CheckBoxSetChecked(Redist1,True);
- #ifdef Redist2
- Redist2:=CheckBoxCreate(WizardForm,240,245,16,16,'Install {#R2[59]}');
- CheckBoxSetChecked(Redist2,True);
- #ifdef Redist3
- Redist3:=CheckBoxCreate(WizardForm,240,265,16,16,'Install {#R3[59]}');
- CheckBoxSetChecked(Redist3,True);
- #ifdef Redist4
- Redist4:=CheckBoxCreate(WizardForm,240,285,16,16,'Install {#R4[59]}');
- CheckBoxSetChecked(Redist4,True);
- #ifdef Redist5
- Redist5:=CheckBoxCreate(WizardForm,240,305,16,16,'Install {#R5[59]}');
- CheckBoxSetChecked(Redist5,True);
- #endif
- #endif
- #endif
- #endif
- #endif
- SelectDirEdt:=EditCreate(WizardForm,20,195,SelectDirLabel2.Width - 30,20);
- EditSetText(SelectDirEdt,MinimizePathName(WizardForm.DirEdit.Text, SelectDirEdt.Top.Font, SelectDirEdt.Top.Width));
- InstallPBr:=ProgressCreate(WizardForm,20,195,400,16);
- ProgressSetProgress(InstallPBr,0);
- {Cancel Form}
- CancelForm:= CreateCustomForm();
- with CancelForm do
- begin
- BorderStyle:= bsNone;
- ClientWidth:=800;
- ClientHeight:=448;
- Center;
- FormStyle:= fsStayOnTop;
- #ifdef Dark
- Color:=$252525;
- #else
- Color:=$FFFFFF;
- #endif
- BringToFront;
- Caption:=WizardForm.Caption;
- OnShow:=@CFShow;
- end;
- #ifdef Image
- ImgLoad(CancelForm.Handle,ExpandConstant('{tmp}\Setup1.jpg'),0,0,CancelForm.ClientWidth,CancelForm.ClientHeight,True,True);
- #ifdef Dark
- ImgLoad(CancelForm.Handle,ExpandConstant('{tmp}\Dark.png'),0,0,CancelForm.ClientWidth,CancelForm.ClientHeight,True,True);
- #else
- ImgLoad(CancelForm.Handle,ExpandConstant('{tmp}\Light.png'),0,0,CancelForm.ClientWidth,CancelForm.ClientHeight,True,True);
- #endif
- ImgApplyChanges(CancelForm.Handle);
- #endif
- with TTimer.Create(CancelForm) do
- begin
- OnTimer:=@CFMoved;
- Interval:=2;
- Enabled:=True;
- end;
- with TLabel.Create(CancelForm) do
- begin
- Parent:= CancelForm;
- Left:= 0;
- Top:= 0;
- Width:= CancelForm.ClientWidth;
- Height:= CancelForm.ClientHeight;
- AutoSize:= false;
- Transparent:= true;
- WordWrap:= False;
- OnMouseDown:=@CFMouseDown;
- end;
- with TPanel.Create(CancelForm) do
- begin
- Parent:=CancelForm;
- Left:=0;
- Top:=15;
- Width:=10;
- Height:=50;
- Color:=MetroColor(CurCol);
- BorderStyle := bsNone;
- BevelInner := bvNone;
- BevelOuter := bvNone;
- BorderWidth := 0;
- ParentBackground := False;
- OnMouseDown:=@CFMouseDown;
- end;
- with TPanel.Create(CancelForm) do
- begin
- Parent:=CancelForm;
- Left:=0;
- Top:=CancelForm.ClientHeight - 5;
- Width:=CancelForm.ClientWidth;
- Height:=5;
- Color:=MetroColor(CurCol);
- BorderStyle := bsNone;
- BevelInner := bvNone;
- BevelOuter := bvNone;
- BorderWidth := 0;
- ParentBackground := False;
- OnMouseDown:=@CFMouseDown;
- end;
- with TLabel.Create(CancelForm) do
- begin
- Parent:=CancelForm;
- SetBounds(20,10,0,0);
- with Font do
- begin
- Name:='Segoe UI';
- Size:=11;
- Color:=MetroColor(CurCol);
- end;
- Caption:=Uppercase('{#AppName}');
- OnMouseDown:=@CFMouseDown;
- end;
- with TLabel.Create(CancelForm) do
- begin
- Parent:=CancelForm;
- AutoSize:=False;
- SetBounds(2,CancelForm.ClientHeight-18,CancelForm.ClientWidth-4,18);
- with Font do
- begin
- Name:='Segoe UI SemiBold';
- Size:=7;
- Color:=MetroColor(CurCol);
- end;
- Alignment:=taRightJustify;
- Caption:=Uppercase('{#Watermark}');
- OnMouseDown:=@CFMouseDown;
- end;
- with TLabel.Create(CancelForm) do
- begin
- Parent:=CancelForm;
- SetBounds(20,20,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=27;
- Color:=MetroColor(CurCol);
- end;
- Caption:='Cancel';
- OnMouseDown:=@CFMouseDown;
- end;
- with TLabel.Create(CancelForm) do
- begin
- Parent:=CancelForm;
- SetBounds(20,70,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=18;
- #ifdef Dark
- Color:=$FFFFFF;
- #else
- Color:=$252525;
- #endif
- end;
- Caption:='Are you sure that you want to close installer wizard?';
- OnMouseDown:=@CFMouseDown;
- end;
- with TLabel.Create(CancelForm) do
- begin
- Parent:=CancelForm;
- SetBounds(20,110,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=11;
- #ifdef Dark
- Color:=$AAAAAA;
- #else
- Color:=$222222;
- #endif
- end;
- Caption:='This action closes installer wizard.'+#13+
- 'The product you are installing would not be installed.'+#13+
- 'You can re-install this product later on if not now.';
- OnMouseDown:=@CFMouseDown;
- end;
- CancelYesBtn:=ButtonCreate(CancelForm,692,400,88,26,False,mrYes);
- ButtonSetText(CancelYesBtn,'Yes');
- ButtonSetEvent(CancelYesBtn,@CancelYesBtnClick);
- CancelNoBtn:=ButtonCreate(CancelForm,592,400,88,26,False,mrNo);
- ButtonSetText(CancelNoBtn,'No');
- ButtonSetEvent(CancelNoBtn,@CancelNoBtnClick);
- TitleLabel3:= TLabel.Create(WizardForm);
- with TitleLabel3 do
- begin
- Parent:=WizardForm;
- SetBounds(690,10,0,0);
- with Font do
- begin
- Name:='Segoe UI';
- Size:=11;
- Color:=MetroColor(CurCol);
- end;
- OnClick:=@MinimizeBtnClick;
- Caption:=Uppercase('Minimize');
- BringToFront;
- end;
- TitleLabel4:= TLabel.Create(WizardForm);
- with TitleLabel4 do
- begin
- Parent:=WizardForm;
- SetBounds((TitleLabel3.Left + TitleLabel3.Width) + 5,10,0,0);
- with Font do
- begin
- Name:='Segoe UI';
- Size:=11;
- Color:=MetroColor(CurCol);
- end;
- OnClick:=@CloseBtnClick;
- Caption:=Uppercase('Exit');
- BringToFront;
- end;
- end;
- function ShowCancelBox:Integer;
- begin
- Result:=CancelForm.ShowModal;
- end;
- procedure CurPageChanged(CurPageID: Integer);
- begin
- WelcomeLabel1.Hide;
- WelcomeLabel2.Hide;
- WelcomeLabel3.Hide;
- SelectDirLabel1.Hide;
- SelectDirLabel2.Hide;
- SelectDirLabel3.Hide;
- InstallLabel1.Hide;
- InstallLabel2.Hide;
- InstallLabel3.Hide;
- InstallLabel4.Hide;
- FinishLabel1.Hide;
- FinishLabel2.Hide;
- FinishLabel3.Hide;
- WizardForm.DirEdit.Hide;
- ButtonSetVisibility(BrowseBtn,False);
- CheckBoxSetVisibility(DesktopChk,False);
- #ifdef Redist1
- CheckBoxSetVisibility(Redist1,False);
- #ifdef Redist2
- CheckBoxSetVisibility(Redist2,False);
- #ifdef Redist3
- CheckBoxSetVisibility(Redist3,False);
- #ifdef Redist4
- CheckBoxSetVisibility(Redist4,False);
- #ifdef Redist5
- CheckBoxSetVisibility(Redist5,False);
- #endif
- #endif
- #endif
- #endif
- #endif
- EditSetVisibility(SelectDirEdt,False);
- ProgressSetVisibility(InstallPBr,False);
- case CurPageID of
- wpWelcome:
- begin
- WelcomeLabel1.Show;
- WelcomeLabel2.Show;
- WelcomeLabel3.Show;
- StatusLabel1.Left:=20;
- StatusLabel1.Font.Color:=MetroColor(CurCol);
- StatusLabel2.Left:=(StatusLabel1.Left + StatusLabel1.Width) + 10;
- #ifdef Dark
- StatusLabel2.Font.Color:=$AAAAAA;
- #else
- StatusLabel2.Font.Color:=$222222;
- #endif
- StatusLabel3.Left:=(StatusLabel2.Left + StatusLabel2.Width) + 10;
- #ifdef Dark
- StatusLabel3.Font.Color:=$AAAAAA;
- #else
- StatusLabel3.Font.Color:=$222222;
- #endif
- StatusLabel4.Left:=(StatusLabel3.Left + StatusLabel3.Width) + 10;
- #ifdef Dark
- StatusLabel4.Font.Color:=$AAAAAA;
- #else
- StatusLabel4.Font.Color:=$222222;
- #endif
- ButtonSetText(BackBtn,'Close');
- ButtonSetText(NextBtn,'Proceed');
- end;
- wpSelectDir:
- begin
- SelectDirLabel1.Show;
- SelectDirLabel2.Show;
- SelectDirLabel3.Show;
- StatusLabel1.Font.Color:=MetroColor(CurCol);
- StatusLabel2.Left:=(StatusLabel1.Left + StatusLabel1.Width) + 10;
- #ifdef Dark
- StatusLabel2.Font.Color:=$AAAAAA;
- #else
- StatusLabel2.Font.Color:=$222222;
- #endif
- StatusLabel3.Left:=(StatusLabel2.Left + StatusLabel2.Width) + 10;
- #ifdef Dark
- StatusLabel3.Font.Color:=$AAAAAA;
- #else
- StatusLabel3.Font.Color:=$222222;
- #endif
- StatusLabel4.Left:=(StatusLabel3.Left + StatusLabel3.Width) + 10;
- #ifdef Dark
- StatusLabel4.Font.Color:=$AAAAAA;
- #else
- StatusLabel4.Font.Color:=$222222;
- #endif
- ButtonSetVisibility(BrowseBtn,True);
- CheckBoxSetVisibility(DesktopChk,True);
- #ifdef Redist1
- CheckBoxSetVisibility(Redist1,True);
- #ifdef Redist2
- CheckBoxSetVisibility(Redist2,True);
- #ifdef Redist3
- CheckBoxSetVisibility(Redist3,True);
- #ifdef Redist4
- CheckBoxSetVisibility(Redist4,True);
- #ifdef Redist5
- CheckBoxSetVisibility(Redist5,True);
- #endif
- #endif
- #endif
- #endif
- #endif
- EditSetVisibility(SelectDirEdt,True);
- ButtonSetText(BackBtn,'Back');
- ButtonSetText(NextBtn,'Install');
- end;
- wpInstalling:
- begin
- InstallLabel1.Show;
- InstallLabel2.Show;
- InstallLabel3.Show;
- InstallLabel4.Show;
- StatusLabel1.Font.Color:=MetroColor(CurCol);
- StatusLabel2.Left:=(StatusLabel1.Left + StatusLabel1.Width) + 10;
- #ifdef Dark
- StatusLabel2.Font.Color:=$AAAAAA;
- #else
- StatusLabel2.Font.Color:=$222222;
- #endif
- StatusLabel3.Left:=(StatusLabel2.Left + StatusLabel2.Width) + 10;
- #ifdef Dark
- StatusLabel3.Font.Color:=$AAAAAA;
- #else
- StatusLabel3.Font.Color:=$222222;
- #endif
- StatusLabel4.Left:=(StatusLabel3.Left + StatusLabel3.Width) + 10;
- #ifdef Dark
- StatusLabel4.Font.Color:=$AAAAAA;
- #else
- StatusLabel4.Font.Color:=$222222;
- #endif
- ButtonSetVisibility(BackBtn,False);
- ButtonSetText(NextBtn,'Cancel');
- ProgressSetVisibility(InstallPBr,True);
- end;
- wpFinished:
- begin
- FinishLabel1.Show;
- FinishLabel2.Show;
- FinishLabel3.Show;
- StatusLabel1.Font.Color:=MetroColor(CurCol);
- StatusLabel2.Left:=(StatusLabel1.Left + StatusLabel1.Width) + 10;
- #ifdef Dark
- StatusLabel2.Font.Color:=$AAAAAA;
- #else
- StatusLabel2.Font.Color:=$222222;
- #endif
- StatusLabel3.Left:=(StatusLabel2.Left + StatusLabel2.Width) + 10;
- #ifdef Dark
- StatusLabel3.Font.Color:=$AAAAAA;
- #else
- StatusLabel3.Font.Color:=$222222;
- #endif
- StatusLabel4.Left:=(StatusLabel3.Left + StatusLabel3.Width) + 10;
- #ifdef Dark
- StatusLabel4.Font.Color:=$AAAAAA;
- #else
- StatusLabel4.Font.Color:=$222222;
- #endif
- ButtonSetVisibility(BackBtn,True);
- ButtonSetText(BackBtn,'Uninstall');
- ButtonSetText(NextBtn,'Finish');
- end;
- end;
- end;
- procedure CurStepChanged(CurStep: TSetupStep);
- var
- ResultCode, i, x: Integer;
- MsgResult: INT_PTR;
- PCF, sourcedir, arcstr: String;
- begin
- if CurStep = ssInstall then
- begin
- #if ReadIni(SourcePath + "\WindowsPhone.iss", "Archives", "Archive1Type", "") != ""
- // Reflate Tools's Extraction
- (*
- ExtractTemporaryFile('7z.dll');
- ExtractTemporaryFile('reflate.exe');
- ExtractTemporaryFile('rawdet.exe');
- ExtractTemporaryFile('rawrest.exe');
- ExtractTemporaryFile('raw2hif.exe'); *)
- // Core Files
- ExtractTemporaryFile('unarc.dll');
- ExtractTemporaryFile('unrar.dll');
- ExtractTemporaryFile('zlib1.dll');
- ExtractTemporaryFile('arc.ini');
- ExtractTemporaryFile('english.ini');
- ExtractTemporaryFile('CLS-MSC.dll');
- ExtractTemporaryFile('CLS-precomp.dll');
- ExtractTemporaryFile('CLS-srep.dll');
- ExtractTemporaryFile('facompress.dll');
- ExtractTemporaryFile('facompress_mt.dll');
- // External Support Files
- ExtractTemporaryFile('lzt.exe');
- ExtractTemporaryFile('nz64.exe');
- ExtractTemporaryFile('srep.exe');
- ExtractTemporaryFile('srep64.exe');
- ExtractTemporaryFile('zstd.exe');
- ExtractTemporaryFile('dec.exe');
- ExtractTemporaryFile('packjpg.exe');
- ExtractTemporaryFile('packjpg_dll.dll');
- ExtractTemporaryFile('packjpg_dll1.dll');
- ExtractTemporaryFile('precomp.exe');
- #endif
- #if ReadIni(SourcePath + "\WindowsPhone.iss", "Archives", "Archive1Type", "") != ""
- #define PCF ReadIni(AddBackSlash(SourcePath) + "WindowsPhone.iss", "Archives", "PrecompVer", "0.42")
- PCF:='{#PCF}';
- if PCF = '0.38' then
- FileCopy(ExpandConstant('{tmp}\precomp038.exe'),ExpandConstant('{tmp}\precomp.exe'),False);
- if PCF = '0.40' then
- FileCopy(ExpandConstant('{tmp}\precomp040.exe'),ExpandConstant('{tmp}\precomp.exe'),False);
- if PCF = '0.41' then
- FileCopy(ExpandConstant('{tmp}\precomp041.exe'),ExpandConstant('{tmp}\precomp.exe'),False);
- if PCF = '0.42' then
- FileCopy(ExpandConstant('{tmp}\precomp042.exe'),ExpandConstant('{tmp}\precomp.exe'),False);
- if PCF = '0.43' then
- FileCopy(ExpandConstant('{tmp}\precomp043.exe'),ExpandConstant('{tmp}\precomp.exe'),False);
- #if ReadIni(AddBackSlash(SourcePath) + "WindowsPhone.iss", "Archives", "Archive1Type", "") != ""
- ISDoneError:=false;
- if ISDoneInit(ExpandConstant('{tmp}\records.inf'), $F777, 0,0,0, MainForm.Handle, 512, @ProgressCallback) then begin
- repeat
- ChangeLanguage('English');
- if not SrepInit('',512,0) then
- ISDoneError := True;
- if not PrecompInit('',128,0) then
- ISDoneError := True;
- if not FileSearchInit(true) then
- ISDoneError := True;
- #sub Data1
- SetArrayLength(Data,{#i});
- SetArrayLength(Data[{#i} - 1].Arc,5);
- #endsub
- #if ReadIni(AddBackSlash(SourcePath) + "WindowsPhone.iss", "Archives", "Archive1Type", "") != ""
- #for {i = 1; ReadIni(AddBackSlash(SourcePath) + "WindowsPhone.iss", "Archives", StringChange("ArchiveIntType","Int", Str(i)), "") !=""; i++} Data1
- #endif
- #sub Data2
- #define DataInf1 ReadIni(AddBackSlash(SourcePath) + "WindowsPhone.iss", "Archives", "Archive" + Str(i) + "Type", "")
- #define DataInf2 ReadIni(AddBackSlash(SourcePath) + "WindowsPhone.iss", "Archives", "Archive" + Str(i) + "Source", "")
- #define DataInf3 ReadIni(AddBackSlash(SourcePath) + "WindowsPhone.iss", "Archives", "Archive" + Str(i) + "Output", "")
- #define DataInf4 ReadIni(AddBackSlash(SourcePath) + "WindowsPhone.iss", "Archives", "Archive" + Str(i) + "Disk", "1")
- #define DataInf5 ReadIni(AddBackSlash(SourcePath) + "WindowsPhone.iss", "Archives", "Archive" + Str(i) + "Password", "")
- Data[{#i} - 1].Arc[0]:='{#DataInf1}';
- Data[{#i} - 1].Arc[1]:=ExpandConstant('{#DataInf2}');
- Data[{#i} - 1].Arc[2]:=ExpandConstant('{#DataInf3}');
- Data[{#i} - 1].Arc[3]:='{#DataInf4}';
- Data[{#i} - 1].Arc[4]:='{#DataInf5}';
- #endsub
- #if ReadIni(AddBackSlash(SourcePath) + "WindowsPhone.iss", "Archives", "Archive1Type", "") != ""
- #for {i = 1; ReadIni(AddBackSlash(SourcePath) + "WindowsPhone.iss", "Archives", StringChange("ArchiveIntType","Int", Str(i)), "") !=""; i++} Data2
- #endif
- Wizardform.ProgressGauge.Max:=0;
- x:=0;
- if Data[0].Arc[0] <> '' then
- begin
- repeat
- x:= x + 1;
- Wizardform.ProgressGauge.Max:=Wizardform.ProgressGauge.Max + 1000;
- until x = GetArrayLength(Data);
- end;
- sourcedir:=ExpandConstant('{src}');
- i := 0;
- if Data[0].Arc[0] <> '' then
- begin
- repeat
- i:= i + 1;
- if Pos('{src}',Data[i - 1].Arc[1]) <> 0 then
- arcstr:=ConstConv(Data[i - 1].Arc[1],sourcedir)
- else
- arcstr:=ExpandConstant(Data[i - 1].Arc[1]);
- if Data[i - 1].Arc[0] = 'Freearc' then
- begin
- if not FileExists(arcstr) then
- begin
- repeat
- MsgResult:=MsgBox(ExtractFileName(Data[i - 1].Arc[1]) + ' was not found.'+#13 +
- 'Please Insert disc ' + Data[i - 1].Arc[3] + ' with ' + ExtractFileName(Data[i - 1].Arc[1]) + ' file', mbConfirmation, MB_ABORTRETRYIGNORE);
- if MsgResult = mrAbort then
- ISDoneError := True;
- if MsgResult = mrIgnore then
- Break;
- if Pos('{src}',Data[i - 1].Arc[1]) <> 0 then
- arcstr:=ConstConv(Data[i - 1].Arc[1],sourcedir)
- else
- arcstr:=ExpandConstant(Data[i - 1].Arc[1]);
- until (FileExists(arcstr) = True) or (ISDoneError = True)
- end else
- if ISDoneError = False then
- 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
- ISDoneError := True;
- end;
- if Data[i - 1].Arc[0] = 'WinRAR' then
- begin
- if not FileExists(arcstr) then
- begin
- repeat
- MsgResult:=MsgBox(ExtractFileName(Data[i - 1].Arc[1]) + ' was not found.'+#13 +
- 'Please Insert disc ' + Data[i - 1].Arc[3] + ' with ' + ExtractFileName(Data[i - 1].Arc[1]) + ' file', mbConfirmation, MB_ABORTRETRYIGNORE);
- if MsgResult = mrAbort then
- ISDoneError := True;
- if MsgResult = mrIgnore then
- Break;
- if Pos('{src}',Data[i - 1].Arc[1]) <> 0 then
- arcstr:=ConstConv(Data[i - 1].Arc[1],sourcedir)
- else
- arcstr:=ExpandConstant(Data[i - 1].Arc[1]);
- until (FileExists(arcstr) = True) or (ISDoneError = True)
- end else
- if ISDoneError = False then
- if not ISRarExtract ( 0, 0, arcstr, Data[i - 1].Arc[2], false, Data[i - 1].Arc[4]) then
- ISDoneError := True;
- end;
- if Data[i - 1].Arc[0] = '7Zip' then
- begin
- if not FileExists(arcstr) then
- begin
- repeat
- MsgResult:=MsgBox(ExtractFileName(Data[i - 1].Arc[1]) + ' was not found.'+#13 +
- 'Please Insert disc ' + Data[i - 1].Arc[3] + ' with ' + ExtractFileName(Data[i - 1].Arc[1]) + ' file', mbConfirmation, MB_ABORTRETRYIGNORE);
- if MsgResult = mrAbort then
- ISDoneError := True;
- if MsgResult = mrIgnore then
- Break;
- if Pos('{src}',Data[i - 1].Arc[1]) <> 0 then
- arcstr:=ConstConv(Data[i - 1].Arc[1],sourcedir)
- else
- arcstr:=ExpandConstant(Data[i - 1].Arc[1]);
- until (FileExists(arcstr) = True) or (ISDoneError = True)
- end else
- if ISDoneError = False then
- if not IS7ZipExtract ( 0, 0, arcstr, Data[i - 1].Arc[2], false, Data[i - 1].Arc[4]) then
- ISDoneError := True;
- end;
- if ISDoneError = True then
- break;
- until i = GetArrayLength(Data);
- end;
- until true;
- ISDoneStop;
- end;
- #endif
- #endif
- end;
- if (CurStep = ssPostInstall) and ISDoneError then
- begin
- Exec(ExpandConstant('{uninstallexe}'),'/verysilent','',SW_HIDE, ewWaitUntilTerminated, ResultCode);
- DelTree(ExpandConstant('{app}'), True, True, True);
- end;
- if (CurStep = ssPostInstall) and not ISDoneError then
- begin
- #ifdef Redist1
- #ifdef Image
- WizardAniBar:=AniCreate(WizardForm,0,0,650,4,False);
- #else
- WizardAniBar:=AniCreate(WizardForm,0,0,WizardLock.Tile.Width,4,False);
- #endif
- if InstallRedist(1) then
- begin
- InstallLabel4.Caption:='Installing {#R1[59]}';
- Exec(ExpandConstant('{src}\{#R1[60]}'), '{#R1[61]}', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
- end;
- #ifdef Redist2
- if InstallRedist(2) then
- begin
- InstallLabel4.Caption:='Installing {#R2[59]}';
- Exec(ExpandConstant('{src}\{#R2[60]}'), '{#R2[61]}', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
- end;
- #ifdef Redist3
- if InstallRedist(3) then
- begin
- InstallLabel4.Caption:='Installing {#R3[59]}';
- Exec(ExpandConstant('{src}\{#R3[60]}'), '{#R3[61]}', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
- end;
- #ifdef Redist4
- if InstallRedist(4) then
- begin
- InstallLabel4.Caption:='Installing {#R4[59]}';
- Exec(ExpandConstant('{src}\{#R4[60]}'), '{#R4[61]}', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
- end;
- #ifdef Redist5
- if InstallRedist(5) then
- begin
- InstallLabel4.Caption:='Installing {#R5[59]}';
- Exec(ExpandConstant('{src}\{#R5[60]}'), '{#R5[61]}', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
- end;
- #endif
- #endif
- #endif
- #endif
- //AniSetVisibility(WizardAniBar,False);
- //AniSetVisibility(LockScreenAniBar,False);
- //AniSetEnabled(WizardAniBar,False);
- //AniSetEnabled(LockScreenAniBar,False);
- #endif
- end;
- end;
- procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
- var
- ResultCode: Integer;
- begin
- SuspendProc;
- Confirm:=False;
- if ShowCancelBox = mrYes then
- Cancel:=True
- else
- Cancel:=False;
- if Cancel then
- InstallLabel4.Caption:='Rolling back changes...';
- if CurPageID=wpInstalling then
- begin
- if Cancel then
- begin
- ISDoneError:=True;
- ISDoneCancel:=1;
- WizardForm.CancelButton.Enabled:=False;
- ButtonSetEnabled(NextBtn,False);
- end;
- end;
- ResumeProc;
- end;
- function ShouldSkipPage(PageID: Integer): Boolean;
- begin
- if (PageID <> wpWelcome) and (PageID <> wpSelectDir) and (PageID <> wpInstalling) and (PageID <> wpFinished) then
- Result:=True
- else
- Result:=False;
- if (ISDoneError = True) and (PageID = wpFinished) then
- Result:=True;
- end;
- procedure DeinitializeSetup;
- begin
- if FileExists(ExpandConstant('{tmp}\botva2.dll')) then
- gdipShutdown;
- end;
- procedure UninstallOnTimer(Sender: TObject);
- var
- pr, i1, i2: Extended;
- begin
- if (UninstallProgressForm.ProgressBar.Position>UninstallProgressForm.ProgressBar.Min) then begin
- i1:=UninstallProgressForm.ProgressBar.Position-UninstallProgressForm.ProgressBar.Min;
- i2:=UninstallProgressForm.ProgressBar.Max-UninstallProgressForm.ProgressBar.Min;
- pr:=i1*100/i2;
- ProgressSetProgress(InstallPBr,pr);
- end;
- end;
- function InitializeUninstall: Boolean;
- begin
- FileCopy(ExpandConstant('{app}\Uninstall\botva2.dll'),ExpandConstant('{tmp}\botva2.dll'),False);
- FileCopy(ExpandConstant('{app}\Uninstall\dark.png'),ExpandConstant('{tmp}\dark.png'),False);
- FileCopy(ExpandConstant('{app}\Uninstall\light.png'),ExpandConstant('{tmp}\light.png'),False);
- FileCopy(ExpandConstant('{app}\Uninstall\Setup1.jpg'),ExpandConstant('{tmp}\Setup1.jpg'),False);
- Result:=True;
- end;
- procedure InitializeUninstallProgressForm;
- begin
- #ifdef CurColor
- CurCol:={#CurColor};
- #else
- CurCol:=1;
- #endif
- with UninstallProgressForm do
- begin
- BorderStyle:=bsNone;
- ClientWidth:=800;
- ClientHeight:=448;
- Center;
- #ifdef Dark
- Color:=$252525;
- #else
- Color:=$FFFFFF;
- #endif
- OuterNotebook.Hide;
- InnerNotebook.Hide;
- Bevel.Hide;
- PageNameLabel.Hide;
- PageDescriptionLabel.Hide;
- MainPanel.Hide;
- ProgressBar.Hide;
- CancelButton.Visible:=False;
- end;
- #ifdef Image
- ImgLoad(UninstallProgressForm.Handle,ExpandConstant('{tmp}\Setup1.jpg'),0,0,UninstallProgressForm.ClientWidth,UninstallProgressForm.ClientHeight,True,True);
- #ifdef Dark
- ImgLoad(UninstallProgressForm.Handle,ExpandConstant('{tmp}\Dark.png'),0,0,UninstallProgressForm.ClientWidth,UninstallProgressForm.ClientHeight,True,True);
- #else
- ImgLoad(UninstallProgressForm.Handle,ExpandConstant('{tmp}\Light.png'),0,0,UninstallProgressForm.ClientWidth,UninstallProgressForm.ClientHeight,True,True);
- #endif
- ImgApplyChanges(UninstallProgressForm.Handle);
- #endif
- with TPanel.Create(UninstallProgressForm) do
- begin
- Parent:=UninstallProgressForm;
- Left:=0;
- Top:=15;
- Width:=10;
- Height:=50;
- Color:=MetroColor(CurCol);
- BorderStyle := bsNone;
- BevelInner := bvNone;
- BevelOuter := bvNone;
- BorderWidth := 0;
- ParentBackground := False;
- end;
- with TPanel.Create(UninstallProgressForm) do
- begin
- Parent:=UninstallProgressForm;
- Left:=0;
- Top:=UninstallProgressForm.ClientHeight - 5;
- Width:=UninstallProgressForm.ClientWidth;
- Height:=5;
- Color:=MetroColor(CurCol);
- BorderStyle := bsNone;
- BevelInner := bvNone;
- BevelOuter := bvNone;
- BorderWidth := 0;
- ParentBackground := False;
- end;
- with TLabel.Create(UninstallProgressForm) do
- begin
- Parent:=UninstallProgressForm;
- SetBounds(20,10,0,0);
- with Font do
- begin
- Name:='Segoe UI';
- Size:=11;
- Color:=MetroColor(CurCol);
- end;
- Caption:=Uppercase('{#AppName}');
- end;
- with TLabel.Create(UninstallProgressForm) do
- begin
- Parent:=UninstallProgressForm;
- AutoSize:=False;
- SetBounds(2,UninstallProgressForm.ClientHeight-18,UninstallProgressForm.ClientWidth-4,18);
- with Font do
- begin
- Name:='Segoe UI SemiBold';
- Size:=7;
- Color:=MetroColor(CurCol);
- end;
- Alignment:=taRightJustify;
- Caption:=Uppercase('{#Watermark}');
- end;
- with TLabel.Create(UninstallProgressForm) do
- begin
- Parent:=UninstallProgressForm;
- SetBounds(20,20,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=27;
- Color:=MetroColor(CurCol);
- end;
- Caption:='Uninstallation';
- end;
- with TLabel.Create(UninstallProgressForm) do
- begin
- Parent:=UninstallProgressForm;
- SetBounds(20,70,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=18;
- #ifdef Dark
- Color:=$FFFFFF;
- #else
- Color:=$252525
- #endif
- end;
- end;
- with TLabel.Create(UninstallProgressForm) do
- begin
- Parent:=UninstallProgressForm;
- SetBounds(20,110,0,0);
- with Font do
- begin
- Name:='Segoe UI Light';
- Size:=11;
- #ifdef Dark
- Color:=$AAAAAA;
- #else
- Color:=$222222;
- #endif
- end;
- Caption:='Uninstaller Wizard is uninstalling the product.'+#13+
- 'This might take a while.';
- end;
- InstallLabel3:= TLabel.Create(UninstallProgressForm);
- with InstallLabel3 do
- begin
- Parent:=UninstallProgressForm;
- SetBounds(20,175,0,0);
- with Font do
- begin
- Name:='Segoe UI SemiBold';
- Size:=9;
- #ifdef Dark
- Color:=$AAAAAA;
- #else
- Color:=$222222;
- #endif
- end;
- Caption:='Status:';
- end;
- with TLabel.Create(UninstallProgressForm) do
- begin
- Parent:=UninstallProgressForm;
- SetBounds((InstallLabel3.Left + InstallLabel3.Width) + 2,176,0,0);
- with Font do
- begin
- Name:='Segoe UI Bold';
- Size:=8;
- Color:=MetroColor(CurCol);
- end;
- Caption:='Uninstalling...';
- end;
- InstallPBr:=ProgressCreate(UninstallProgressForm,20,195,400,16);
- ProgressSetProgress(InstallPBr,0);
- with TTimer.Create(UninstallProgressForm) do
- begin
- OnTimer:=@UninstallOnTimer;
- Interval:=10;
- Enabled:=True;
- end;
- end;
- procedure DeinitializeUninstall;
- begin
- if FileExists(ExpandConstant('{tmp}\botva2.dll')) then
- gdipShutdown;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement