FileForums

FileForums (https://fileforums.com/index.php)
-   Conversion Tutorials (https://fileforums.com/forumdisplay.php?f=55)
-   -   FMXInno - Windows Fluent Design Installer UI for Inno (https://fileforums.com/showthread.php?t=104852)

Masquerade 21-09-2023 05:25

Can't wait for someone to make a sick scene-style demo using this software :cool:

hitman797 21-09-2023 06:10

Developer suggestions:
Hi BLACKFIRE69, thank you for making example for 3D animation.
I really appreciate the work you bring to this forum thank you.


Feature of the FMXInno plugin:
  1. GridLayout: TGridLayout;
  2. ComboColorBox: TComboColorBox;
  3. ListBox: TListBox;

hitman797 22-09-2023 08:22

Form:
Code:

FMXForm[1].FormShow(@FormShow);
FMXForm[1].FormCreate(@FormCreate);
FMXForm[1].FormKeyDown(@FormKeyDown);

GridLayout:
Code:

FMXGridLayout[1].FCreate(FMXTabItem[3].Handle);
FMXGridLayout[1].Align(Client);
FMXGridLayout[1].ItemHeight(168);
FMXGridLayout[1].ItemWidth(224);
FMXGridLayout[1].Orientation(Horizontal);
FMXGridLayout[1].Margins(91, 72, 91, 72);
FMXGridLayout[1].Height(336);
FMXGridLayout[1].Width(672);

ComboColorBox:
Code:

FMXComboColorBox[1].FCreate(FMXLayout[3].Handle);
FMXComboColorBox[1].Align(Client);
FMXComboColorBox[1].CanFocus(False);
FMXComboColorBox[1].FillColor(ALWhite);
FMXComboColorBox[1].Margins(0, 8, 0, 8);
FMXComboColorBox[1].Height(24);
FMXComboColorBox[1].Width(48);
FMXComboColorBox[1].OnChange(@OnChange);

Layer3D:
Code:

FMXLayer3D[1].StyleLookup('backgroundstyle');
Layout:
Code:

FMXLayout[1].Position(X, Y);
Rectangle:
Code:

FMXRectangle[1].Position(X, Y);
Label:
Code:

FMXLabel[1].Position(X, Y);

BLACKFIRE69 22-09-2023 17:14

FMXInno - Updates
 
Following classes have been added.

Code:

* Standard:
  - TListBox

* Layout:
  - TGridLayout
  - TFlowLayout
  - TScaledLayout

* Colors:
  - TComboColorBox


.

hitman797 22-09-2023 18:21

Quote:

Originally Posted by BLACKFIRE69 (Post 502573)
Following classes have been added.

Code:

* Standard:
  - TListBox

* Layout:
  - TGridLayout
  - TFlowLayout
  - TScaledLayout

* Colors:
  - TComboColorBox

.

@BLACKFIRE69,
Thanks for the update, great job, we can complete the installer.
Some suggestions:
Form:
Code:

FMXForm[1].FormShow(@FormShow);
FMXForm[1].FormCreate(@FormCreate);
FMXForm[1].FormKeyDown(@FormKeyDown);

ComboColorBox:
Code:

FMXComboColorBox[1].CanFocus(False);
FMXComboColorBox[1].GetObject;

Layer3D:
Code:

FMXLayer3D[1].StyleLookup('backgroundstyle');
Layout:
Code:

FMXLayout[1].Position(X, Y);
Rectangle:
Code:

FMXRectangle[1].Position(X, Y);
Label:
Code:

FMXLabel[1].Position(X, Y);

BLACKFIRE69 23-09-2023 04:11

FMXInno - Updates
 
FMXInno Updates - [2023-Sep-23]

Code:

* Added a quality update to the first post. Please check it out.


Quote:

Originally Posted by hitman797 (Post 502574)
@BLACKFIRE69,
Thanks for the update, great job, we can complete the installer.
Some suggestions:
Form:
Code:

FMXForm[1].FormShow(@FormShow);
FMXForm[1].FormCreate(@FormCreate);
FMXForm[1].FormKeyDown(@FormKeyDown);

ComboColorBox:
Code:

FMXComboColorBox[1].CanFocus(False);
FMXComboColorBox[1].GetObject;

Layer3D:
Code:

FMXLayer3D[1].StyleLookup('backgroundstyle');
Layout:
Code:

FMXLayout[1].Position(X, Y);
Rectangle:
Code:

FMXRectangle[1].Position(X, Y);
Label:
Code:

FMXLabel[1].Position(X, Y);



done.

hitman797 23-09-2023 11:28

1 Attachment(s)
Thanks Gift 2024 3 Page done.

hitman797 24-09-2023 08:00

1 Attachment(s)
Quote:

Originally Posted by audiofeel (Post 502586)
why don't you resort to this form? more like the original

four pages done thank you @audiofeel for the advice.

hitman797 24-09-2023 12:16

2 Attachment(s)
Quote:

Originally Posted by audiofeel (Post 502601)
If we take your script as a basis and add FComboColorBox activation to it when you activate the FComboColorBox for the first time, it does not appear where it was intended Why??

I think the problem is in the arrangement.

hitman797 24-09-2023 13:46

2 Attachment(s)
The design is 100 percent complete..

hitman797 24-09-2023 16:00

2 Attachment(s)
Quote:

Originally Posted by audiofeel (Post 502605)
great job. nerves of steel. there is no completion page. I once did something similar...

Thank you @audiofeel, the animation and color has been added.

hitman797 25-09-2023 14:37

2 Attachment(s)
Quote:

Originally Posted by audiofeel (Post 502615)
@BLACKFIRE69
Show an example of how to change the color of objects on the fly, as in the example below? FReactangle(FillColor.Stroke.Color). I can't do it with FColorbox.I can't do it. The color changes if you only touch the object.
Code:

var
  UIColour: array of TAlphaColor = [$B93A4955, $FF202B2F, $FFC0233C];
procedure TForm1.ComboColorBox1Change(Sender: TObject);
var
  I, J: Integer;
begin
  if ComboColorBox1 = Sender then
    J := 0;
  if ComboColorBox2 = Sender then
    J := 1;
  if ComboColorBox3 = Sender then
    J := 2;
  for I := 0 to ComponentCount - 1 do
  begin
    if (Components[I] is TShape) then
    begin
      if TShape(Components[I]).TagString = J.ToString then
        TShape(Components[I]).Fill.Color := TComboColorBox(Sender).Color;
      if TShape(Components[I]).TagString = (J + Length(UIColour)).ToString then
        TShape(Components[I]).Stroke.Color := TComboColorBox(Sender).Color;
    end;
    UIColour[J] := TComboColorBox(Sender).Color;
  end;
end;


see this, change the color of objects on the fly.
Code:

FMXColorAnimation[1].StopAtCurrent;
FMXColorAnimation[1].SetColors(FMXComboColorBox[2].GetColor, FMXComboColorBox[1].GetColor);
FMXColorAnimation[1].Start;

Code:

FMXArc[2].StrokeColor(FMXComboColorBox[3].GetColor);
FMXCircle[5].StrokeColor(FMXComboColorBox[3].GetColor);
FMXRectangle[87].FillColor(FMXComboColorBox[3].GetColor);


hitman797 25-09-2023 15:52

2 Attachment(s)
add Finished Page.
Code:

//FMXTabItem[10].IsSelected(True);
//FMXLabel[12].Text('Start installation');
//FMXLabel[13].Text(#$E184);
FMXTabItem[11].IsSelected(True);
FMXLabel[12].Text('Finished');
FMXLabel[13].Text(#$E10A);

fix FMXRectangle[90]
Code:

FMXRectangle[90].CornerStyle(10, 10, [tcTopLeft, tcTopRight, tcBottomLeft, tcBottomRight], ctRound);

hitman797 25-09-2023 16:27

4 Attachment(s)
if you change all the ctRound with ctInnerRound.
this what lock like.

hitman797 25-09-2023 21:35

Quote:

Originally Posted by audiofeel (Post 502619)
when the installation really goes into error, the animation of the last page does not seem very successful, but it is better than without it.

move all the objects in the FMXTabItem[11] to FMXTabItem[4].
Code:

FMXTabItem[11] in FMXLayer3D[2].
FMXTabItem[4] in FMXLayer3D[1].


hitman797 26-09-2023 08:06

Quote:

Originally Posted by audiofeel (Post 502622)
I. very interesting, but nothing is clear
-------
II. above in the posts you wrote that you may need to rearrange the procedures and then the ColorBox will appear where necessary. I finally found this place. you need to Align(Right); remove to the end.
-------
III. you need to think something about calculating the size of the components. we are not on the components page. probably do something like that. I don't know...
Code:

procedure TForm1.CheckBox2Click(Sender: TObject);
begin
if TCheckBox(Sender).Checked then  sum3:=sum3+TCheckBox(Sender).Tag/100 else
sum3:=sum3-TCheckBox(Sender).Tag/100;
end;


Code:

[Component0]
Name=Core files
Size=30000

[Component1]
Name=Need For Speed Underground
Size=30000

[Component2]
Name=Need For Speed Underground 2
Size=30000

[Component3]
Name=Need For Speed Most Wanted 05'
Size=30000

[Component4]
Name=Need For Speed Carbon
Size=30000

[Component5]
Name=Need For Speed Pro Street
Size=30000

[Component6]
Name=Need For Speed Undercover
Size=30000

[Component7]
Name=Need For Speed Shift
Size=30000

[Component8]
Name=Need For Speed Hot Pursuit
Size=30000

[Component9]
Name=Need For Speed The Run
Size=30000

[Component10]
Name=Need For Speed Shift 2 Unleashed
Size=30000

[Component10]
Name=Need For Speed Most Wanted 12'
Size=30000

[Component11]
Name=Need For Speed Rivals
Size=30000

[Component12]
Name=Need For Speed 15'
Size=30000

Code:

function GetIniBool(const Section, Key: String; const Default: Boolean; const Filename: String): Boolean;
function GetIniInt(const Section, Key: String; const Default, Min, Max: Longint; const Filename: String): Longint;
function GetIniString(const Section, Key, Default, Filename: String): String;


hitman797 26-09-2023 08:15

Developer suggestions:
Hi @BLACKFIRE69, can you add this class to FMXInno.
thank you.


Feature of the FMXInno plugin:
  • TMemIniFile = class(TCustomIniFile)
  • MemIniFile:= TMemIniFile.Create('setup.ini');
  • TRegistry = class(TObject)
  • Registry:= TRegistry.Create(KEY_READ);

  • function GetIniString(Section, Key, Default: string; Ini: TMemIniFile): string;
  • function GetIniBoolean(Section, Key: string; Default: Boolean;
  • Ini: TMemIniFile): Boolean;
  • function GetIniFloat(Section, Key: string; Default: Single;
  • Ini: TMemIniFile): Single;
  • function GetIniInteger(Section, Key: string; Default: Integer;
  • Ini: TMemIniFile): Integer;
  • function GetIniColor(Section, Key: string; Default: TAlphaColor;
  • Ini: TMemIniFile): TAlphaColor;
  • procedure SetIniString(Section, Key, Default: string; Ini: TMemIniFile): string;
  • procedure SetIniBoolean(Section, Key: string; Default: Boolean;
  • Ini: TMemIniFile): Boolean;
  • procedure SetIniFloat(Section, Key: string; Default: Single;
  • Ini: TMemIniFile): Single;
  • procedure SetIniInteger(Section, Key: string; Default: Integer;
  • Ini: TMemIniFile): Integer;
  • procedure SetIniColor(Section, Key: string; Default: TAlphaColor;
  • Ini: TMemIniFile): TAlphaColor;

BLACKFIRE69 26-09-2023 11:07

Quote:

Originally Posted by hitman797 (Post 502628)
Developer suggestions:
Hi @BLACKFIRE69, can you add this class to FMXInno.
thank you.


Feature of the FMXInno plugin:
  • TMemIniFile = class(TCustomIniFile)
  • MemIniFile:= TMemIniFile.Create('setup.ini');
  • TRegistry = class(TObject)
  • Registry:= TRegistry.Create(KEY_READ);

  • function GetIniString(Section, Key, Default: string; Ini: TMemIniFile): string;
  • function GetIniBoolean(Section, Key: string; Default: Boolean;
  • Ini: TMemIniFile): Boolean;
  • function GetIniFloat(Section, Key: string; Default: Single;
  • Ini: TMemIniFile): Single;
  • function GetIniInteger(Section, Key: string; Default: Integer;
  • Ini: TMemIniFile): Integer;
  • function GetIniColor(Section, Key: string; Default: TAlphaColor;
  • Ini: TMemIniFile): TAlphaColor;
  • procedure SetIniString(Section, Key, Default: string; Ini: TMemIniFile): string;
  • procedure SetIniBoolean(Section, Key: string; Default: Boolean;
  • Ini: TMemIniFile): Boolean;
  • procedure SetIniFloat(Section, Key: string; Default: Single;
  • Ini: TMemIniFile): Single;
  • procedure SetIniInteger(Section, Key: string; Default: Integer;
  • Ini: TMemIniFile): Integer;
  • procedure SetIniColor(Section, Key: string; Default: TAlphaColor;
  • Ini: TMemIniFile): TAlphaColor;



Code:

{ Ini }
function ReadIniStr(const Section, Key, Default, FileName: WideString): WideString;
  external 'ReadIniStr@files:FMXInno.dll stdcall delayload';
function WriteIniStr(const Section, Key, Value, FileName: WideString): Boolean;
  external 'WriteIniStr@files:FMXInno.dll stdcall delayload';


{ ReadReg }
function pReadRegStr(const RootKey: Integer; const Key, Name: WideString; CreateNew: Boolean): WideString;
  external 'pReadRegStr@files:FMXInno.dll stdcall delayload';
function pReadRegInt(const RootKey: Integer; const Key, Name: WideString; CreateNew: Boolean): Integer;
  external 'pReadRegInt@files:FMXInno.dll stdcall delayload';
function pReadRegBool(const RootKey: Integer; const Key, Name: WideString; CreateNew: Boolean): Boolean;
  external 'pReadRegBool@files:FMXInno.dll stdcall delayload';
function pReadRegDouble(const RootKey: Integer; const Key, Name: WideString; CreateNew: Boolean): Double;
  external 'pReadRegDouble@files:FMXInno.dll stdcall delayload';


hitman797 26-09-2023 13:15

2 Attachment(s)
Quote:

Originally Posted by BLACKFIRE69 (Post 502629)
Code:

{ Ini }
function ReadIniStr(const Section, Key, Default, FileName: WideString): WideString;
  external 'ReadIniStr@files:FMXInno.dll stdcall delayload';
function WriteIniStr(const Section, Key, Value, FileName: WideString): Boolean;
  external 'WriteIniStr@files:FMXInno.dll stdcall delayload';


{ ReadReg }
function pReadRegStr(const RootKey: Integer; const Key, Name: WideString; CreateNew: Boolean): WideString;
  external 'pReadRegStr@files:FMXInno.dll stdcall delayload';
function pReadRegInt(const RootKey: Integer; const Key, Name: WideString; CreateNew: Boolean): Integer;
  external 'pReadRegInt@files:FMXInno.dll stdcall delayload';
function pReadRegBool(const RootKey: Integer; const Key, Name: WideString; CreateNew: Boolean): Boolean;
  external 'pReadRegBool@files:FMXInno.dll stdcall delayload';
function pReadRegDouble(const RootKey: Integer; const Key, Name: WideString; CreateNew: Boolean): Double;
  external 'pReadRegDouble@files:FMXInno.dll stdcall delayload';


Thank you for the replay.

hitman797 26-09-2023 17:13

6 Attachment(s)
Quote:

Originally Posted by audiofeel (Post 502632)
does not work. most likely, this will not work in TAG.

done with Timer.
press Ctrl + D to show color combo box.
Code:

  FMXBass: array [1..2] of IXBass;
  FMXCPU: array [1..2] of FCpuUsage;
  FMXRAM: array [1..2] of FRamUsage;
  FMXDISK: array [1..2] of FDiskUsage;
  FMXGPU: array [1..2] of FGPUInfo;
  FMXINFO: array [1..2] of FOSInfo;


BLACKFIRE69 28-09-2023 14:00

Quote:

Originally Posted by audiofeel (Post 502652)
[B]
Can 't this code be shortened somehow ?
Code:

procedure OnChange(Sender: TObject);
begin
  case Sender of
    TObject(FMXComboColorBox[1].GetObject):
    begin
      FMXRectangle[97].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[7].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[8].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[9].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[10].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[11].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[12].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[13].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[14].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[15].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[16].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[17].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[18].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[20].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[21].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[22].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[23].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[24].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[35].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[36].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[37].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[38].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[39].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[50].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[51].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[52].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[53].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[54].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[62].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[63].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[64].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[65].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[66].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[75].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[84].FillColor(FMXComboColorBox[1].GetColor);
      FMXArc[1].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[85].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[86].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[93].FillColor(FMXComboColorBox[1].GetColor);
    end;





Code:

var
  MyArr: array of Integer;

procedure FMXInnoInit;
var
  I: Integer;
begin
  SetArrayLength(MyArr, 38);

  for I := 0 to 37 do
  begin
    case I of
      0..11  : MyArr[i]  :=  7 + I;        // 7..18
      12..16  : MyArr[i]  := 20 + (I - 12); // 20..24
      17..21  : MyArr[i]  := 35 + (I - 17); // 35..39
      22..26  : MyArr[i]  := 50 + (I - 22); // 50..54
      27..31  : MyArr[i]  := 62 + (I - 27); // 62..66
      32      : MyArr[32] := 75;            // 75
      33..35  : MyArr[i]  := 84 + (I - 33); // 84..86
      36      : MyArr[36] := 93;            // 93
      37      : MyArr[37] := 97;            // 97
    end;
  end;
end;

procedure OnChange(Sender: TObject);
var
  I: Integer;
begin
  case Sender of
    TObject(FMXComboColorBox[1].GetObject):
    begin
      FMXArc[1].FillColor(FMXComboColorBox[1].GetColor);

      for I := Low(MyArr) to High(MyArr) do
        FMXRectangle[MyArr[I]].FillColor(FMXComboColorBox[1].GetColor);
    end;
  end;
end;


hitman797 29-09-2023 15:14

Quote:

Originally Posted by audiofeel (Post 502662)
Sorry, I forgot to mention that there are three colorbox and three colors .

Code:

var
  MyArr: array of Integer;

procedure FMXInnoInit;
var
  I: Integer;
begin
  SetArrayLength(MyArr, 38);

  for I := 0 to 37 do
  begin
    case I of
      I=(0..11)    : MyArr[i]  :=  7 + I;            // 7..18  //  7 + 11 = 18;
      I=(12..16)  : MyArr[i]  := 20 + (I - 12); // 20..24 // 20 + (16 - 12)= 24;
      I=(17..21)  : MyArr[i]  := 35 + (I - 17); // 35..39 // 35 + (21 - 17)= 39;
      I=(22..26)  : MyArr[i]  := 50 + (I - 22); // 50..54 // 50 + (26 - 22)= 54;
      I=(27..31)  : MyArr[i]  := 62 + (I - 27); // 62..66 // 62 + (31 - 27)= 66;
      I=(32)        : MyArr[32] := 75;              // 75      // 75;
      I=(33..35)  : MyArr[i]  := 84 + (I - 33); // 84..86 // 84 + (35 - 33)= 86;
      I=(36)        : MyArr[36] := 93;              // 93      // 93;
      I=(37)        : MyArr[37] := 97;              // 97      // 97;
    end;
  end;
end;

procedure OnChange(Sender: TObject);
var
  I: Integer;
begin
  case Sender of
    TObject(FMXComboColorBox[1].GetObject):
    begin
      FMXArc[1].FillColor(FMXComboColorBox[1].GetColor);

      for I := Low(MyArr) to High(MyArr) do
        FMXRectangle[MyArr[I]].FillColor(FMXComboColorBox[1].GetColor);
    end;
  end;
end;


hitman797 02-10-2023 01:19

Developer suggestions:
Hi @BLACKFIRE69, can you add GetText of FLabel class to FMXInno.
thank you.

FLabel:
Code:

  function GetText: WideString;

BLACKFIRE69 02-10-2023 23:53

Quote:

Originally Posted by audiofeel (Post 502697)
@BLACKFIRE69
Is there any way to get a list of disks in a listbox? I don't quite understand how to do this. The example with the combobox does not fit.
Code:

procedure GetDisks;
var
  w: dword;
  Root: string;
  i, DiskType: integer;
begin
  w:= GetLogicalDrives;
  Root:= '#:\';
  for i:= 0 to 24 do
  begin
    Root[1]:= Chr(Ord('A') + i);
    if (W and (1 shl i)) > 0 then
      if (GetDriveType(PAnsiChar(Root)) = DRIVE_FIXED) then
    Edit1Combo.AddItem(Root);
  end;
  Edit1Combo.SetItemIndex(0);
end;




it's not a big deal.

Code:

var
  ...
  mListBox  : FListBox;
  mListBoxItem: array of FListBoxItem;
  ...

procedure FMXInnoInit;
begin
  ...
  mListBox  := InitListBoxHandle;
  ...
end;

procedure InitializeWizard();
begin
  ...
  FMXDesigning;
  FMXForm.Show;

  mListBox.SetItemIndex(2);  // i-1
  ...
end;

procedure ListBoxOnChange(Sender: TObject);
begin
  if mListBox.GetItemIndex > -1 then
    WinTB1.Text('Selected Drive: [' + mListBox.GetItemText(mListBox.GetItemIndex) + ']');
end;

Code:

procedure FMXDesigning;
var
  i, CDrvIdx: Integer;
  ADrvLst: TArrWStr;
begin
  ...

  if not wGetLogicalDriveList(ADrvLst, CDrvIdx) then
  begin
    Log('"wGetLogicalDriveList" failed!');
    MsgBox('"wGetLogicalDriveList" failed!', mbError, MB_OK);
    // try another way.
  end;

  { ListBox }
  mListBox.FCreate(FMXForm.Handle);
  mListBox.SetBounds(NSX(32), NSY(53), NSX(297), NSY(249));
  mListBox.OnChange(@ListBoxOnChange);

  { Items }
  SetArrayLength(mListBoxItem, GetArrayLength(ADrvLst));
 
  mListBox.BeginUpdate;

  for i := 0 to GetArrayLength(ADrvLst) - 1 do
  begin
    mListBoxItem[i] := InitListBoxItemHandle;
    mListBoxItem[i].FCreate(mListBox.Handle);
    mListBoxItem[i].Text(ADrvLst[i]);
    mListBox.AddItem(mListBoxItem[i].Handle);
  end;

  mListBox.EndUpdate;
  ...
end;


.

Jahan1373 03-10-2023 21:46

Script
 
Hello, thank you for your hard work
If it is possible, can you put the metro script, I have downloaded a few, when it starts, the first page is white, then the page comes, please put this, thank you

hitman797 04-10-2023 04:54

1 Attachment(s)
Code:

var
  Form4: TForm4;
  Directory: TDirectoryListBox;
  Drive: TDriveComboBox;
  FileList: TFileListBox;

Code:

procedure TForm4.FormCreate(Sender: TObject);
begin
  // Directory
  Directory:= TDirectoryListBox.Create(nil);
  Directory.ParentWindow:=FmxHandleToHWND(Form4.Handle);
  Directory.Visible:=False;
  Directory.FileList:=FileList;
  // Drive
  Drive:= TDriveComboBox.Create(nil);
  Drive.ParentWindow:=FmxHandleToHWND(Form4.Handle);
  Drive.Visible:=False;
  Drive.TextCase:=tcUpperCase;
  Drive.DirList:=Directory;
  // FileList
  FileList:= TFileListBox.Create(nil);
  FileList.ParentWindow:=FmxHandleToHWND(Form4.Handle);
  FileList.Visible:=False;
  //
  ListBox1.Items:= Directory.Items;
  ListBox2.Items:= FileList.Items;
  ComboBox1.Items:= Drive.Items;
end;

Code:

procedure TForm4.ComboBox1Change(Sender: TObject);
begin
  Drive.ItemIndex:= ComboBox1.ItemIndex;
end;

procedure TForm4.ListBox1ItemClick(const Sender: TCustomListBox;
  const Item: TListBoxItem);
begin
  ListBox1.BeginUpdate;
  ListBox1.Items:= Directory.Items;
  ListBox1.EndUpdate;
end;

procedure TForm4.ListBox2ItemClick(const Sender: TCustomListBox;
  const Item: TListBoxItem);
begin
  ListBox2.BeginUpdate;
  ListBox2.Items:= FileList.Items;
  ListBox2.EndUpdate;
end;


hitman797 05-10-2023 02:04

2 Attachment(s)
Code:

  hDrive: TDriveComboBox;
  hFilter: TFilterComboBox;
  hDirectory: TDirectoryListBox;
  hFileList: TFileListBox;


Masquerade 06-10-2023 01:07

Please may I have some guidance transitioning my Installer from IsArcEx to using the module included in FMXInno? IsArcEx.dll is getting a lot of hits on VT and people downloading my releases are accusing me of putting trojans in the release.

hitman797 06-10-2023 01:34

Quote:

Originally Posted by Masquerade (Post 502722)
Please may I have some guidance transitioning my Installer from IsArcEx to using the module included in FMXInno? IsArcEx.dll is getting a lot of hits on VT and people downloading my releases are accusing me of putting trojans in the release.

Code:

[Files]
Source: "Files\FMXInno.dll"; Flags: dontcopy;

Code:

type
TCallback = function(OverallPct, CurrentPct, DiskTotalMB, DiskExtractedMB: Integer; DiskName, CurrentFile, RemainsTime, ElapsedTime, CurSpeed, AvgSpeed: WideString): LongWord;

TCallbackEx = function(OverallPct, CurrentPct, DiskTotalMB, DiskExtractedMB, TotalFiles, CurFiles: Integer; DiskName, CurrentFile, RemainsTime, ElapsedTime, CurSpeed, AvgSpeed: WideString): LongWord;

Code:

var
  ISArcExDiskCount      : Integer;
  ISArcExCancel        : Integer;
  ISArcExError          : Boolean;
  ISArcDiskAddingSuccess: Boolean;

Code:

function ISArcExInit(WinHandle: Longint; TimeFormat: Integer; Callback: TCallback): Boolean;
  external 'ISArcExInit@files:FMXInno.dll stdcall delayload';
function ISArcExInitEx(WinHandle: Longint; TimeFormat: Integer; Callback: TCallbackEx): Boolean;
  external 'ISArcExInitEx@files:FMXInno.dll stdcall delayload';
function ISArcExAddDisks(Inputfile, Password, OutputPath: Widestring): Boolean;
  external 'ISArcExAddDisks@files:FMXInno.dll stdcall delayload';
function ISArcExExtract(DiskNumber: Integer; CfgFile, WorkPath: Widestring): Boolean;
  external 'ISArcExExtract@files:FMXInno.dll stdcall delayload';
procedure ISArcExCallbackInterval(MSec: Cardinal);
  external 'ISArcExCallbackInterval@files:FMXInno.dll stdcall delayload';
function ISArcExGetCallbackInterval: Cardinal;
  external 'ISArcExGetCallbackInterval@files:FMXInno.dll stdcall delayload';
procedure ISArcExReduceCalcAccuracy(Factor: Byte);  // Factor: 1-5
  external 'ISArcExReduceCalcAccuracy@files:FMXInno.dll stdcall delayload';
function SuspendProc: Boolean;
  external 'SuspendProc@files:FMXInno.dll stdcall delayload';
function ResumeProc: Boolean;
  external 'ResumeProc@files:FMXInno.dll stdcall delayload';
procedure ISArcExStop;
  external 'ISArcExStop@files:FMXInno.dll stdcall delayload';
procedure ISArcExCleanUp;
  external 'ISArcExCleanUp@files:FMXInno.dll stdcall delayload';
function ChangeLanguage(Language: Widestring): boolean;
  external 'ChangeLanguage@files:FMXInno.dll stdcall delayload';
function Exec2(filename, Param: WideString; Show: Boolean): Boolean;
  external 'Exec2@files:FMXInno.dll stdcall delayload';


Masquerade 06-10-2023 01:46

And am I alright, with this code, to just drag and drop the FMX files into the project? I haven't upgraded the DLL in while.

Masquerade 06-10-2023 02:37

I'm getting so far, but I think I've hit a roadblock. When compiling, the following line of code hits an error with invalid number of parameters. I have determined this to be "PreviousFileCount: Integer;" but please may somebody explain what this means? I will try to fix that.

Code:

VerifyHashesFromFile(ExpandConstant('{app}\_Verify\kaos.blake3'), ExpandConstant('{app}\_Verify'), 11, False, @VerifyHashMultiCallback);
Code:

function VerifyHashesFromFile(ChecksumFile, BasePath: WideString; HashAlgo, PreviousFileCount: Integer; LogFile: Boolean; Callback: TMultiHashCallback): Integer;
There is also an error compiling the function

MinimizeWindowCustomAnimated(FMXForm.HandleHWND, 50, 50, 40, 15);

As the new function only takes 2 parameters.

hitman797 06-10-2023 03:41

Quote:

Originally Posted by Masquerade (Post 502726)
I'm getting so far, but I think I've hit a roadblock. When compiling, the following line of code hits an error with invalid number of parameters. I have determined this to be "PreviousFileCount: Integer;" but please may somebody explain what this means? I will try to fix that.

Code:

VerifyHashesFromFile(ExpandConstant('{app}\_Verify\kaos.blake3'), ExpandConstant('{app}\_Verify'), 11, False, @VerifyHashMultiCallback);
Code:

function VerifyHashesFromFile(ChecksumFile, BasePath: WideString; HashAlgo, PreviousFileCount: Integer; LogFile: Boolean; Callback: TMultiHashCallback): Integer;

Code:

VerifyHashesFromFile(ExpandConstant('{app}\_Verify\kaos.blake3'), ExpandConstant('{app}\_Verify'), 11,  0,False, @VerifyHashMultiCallback);
Code:

function VerifyHashesFromFile(ChecksumFile, BasePath: WideString; HashAlgo, PreviousFileCount: Integer; LogFile: Boolean; Callback: TMultiHashCallback): Integer;
Quote:

Originally Posted by Masquerade (Post 502726)
There is also an error compiling the function

MinimizeWindowCustomAnimated(FMXForm.HandleHWND, 50, 50, 40, 15);

As the new function only takes 2 parameters.

Code:

type
TMinimizeAnimPos    = (mapTop, mapBottom, mapLeft, mapRight);

function MinimizeWindowCustomAnimated(MinimizeAnimPos: TMinimizeAnimPos): Boolean;
  external 'MinimizeWindowCustomAnimated@files:FMXInno.dll stdcall delayload';
procedure pMinimizeWindow(const WinHandle: Cardinal);
  external 'pMinimizeWindow@files:FMXInno.dll stdcall delayload';

Code:

MinimizeWindowCustomAnimated(mapTop);
MinimizeWindow(WizardForm.Handle);


Cesar82 06-10-2023 03:45

Quote:

Originally Posted by Masquerade (Post 502726)
I'm getting so far, but I think I've hit a roadblock. When compiling, the following line of code hits an error with invalid number of parameters. I have determined this to be "PreviousFileCount: Integer;" but please may somebody explain what this means? I will try to fix that.

Code:

VerifyHashesFromFile(ExpandConstant('{app}\_Verify\kaos.blake3'), ExpandConstant('{app}\_Verify'), 11, False, @VerifyHashMultiCallback);
Code:

function VerifyHashesFromFile(ChecksumFile, BasePath: WideString; HashAlgo, PreviousFileCount: Integer; LogFile: Boolean; Callback: TMultiHashCallback): Integer;
There is also an error compiling the function

MinimizeWindowCustomAnimated(FMXForm.HandleHWND, 50, 50, 40, 15);

As the new function only takes 2 parameters.

PreviousFileCount is the initial value that must be added to the count of items displayed in calback if you call the function more than once.
Using this parameter, the total number of files will be displayed correctly when entering the value from the previous call.
Code:

VerifyHashesFromFile(ExpandConstant('{app}\_Verify\kaos.blake3'), ExpandConstant('{app}\_Verify'), 11, 0, False, @VerifyHashMultiCallback);

Masquerade 06-10-2023 06:37

Sorry to keep asking, but now I've got a Type Mismatch for the following lines:

<button>.OnMouseDown(@CommonButtonDown);
<button>.OnMouseUp(@CommonButtonUp);

It seems that OnMouseDown/OnMouseUp are both TMouseEventF whereas CommonButtonDown/Up is a procedure. Is this the cause of the error?

Apologies for asking so much! :o

hitman797 06-10-2023 07:06

Quote:

Originally Posted by Masquerade (Post 502733)
Sorry to keep asking, but now I've got a Type Mismatch for the following lines:

<button>.OnMouseDown(@CommonButtonDown);
<button>.OnMouseUp(@CommonButtonUp);

It seems that OnMouseDown/OnMouseUp are both TMouseEventF whereas CommonButtonDown/Up is a procedure. Is this the cause of the error?

Apologies for asking so much! :o

copy the procedure.
Code:

procedure OnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single);
begin
//
end;

procedure OnMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single);
begin
//
end;

Code:

TMouseEventF        = procedure(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single);
TMouseMoveEventF    = procedure(Sender: TObject; Shift: TShiftState; X, Y: Single);
TKeyEventF          = procedure(Sender: TObject; var Key: Word; var KeyChar: WideChar; Shift: TShiftState);


hitman797 06-10-2023 07:22

2 Attachment(s)
hi, @BLACKFIRE69 can you add this class to the FMXInno.
this class is VCL component in unite VCL.FileCtrl.
I use unite FMX.Platform.Win to Handle the VCL component in FMX Form.
I made example in delphi.
THANK YOU.
Win 3.1:
Code:

  hDrive: TDriveComboBox;
  hFilter: TFilterComboBox;
  hDirectory: TDirectoryListBox;
  hFileList: TFileListBox;

ListBox:
Code:

procedure ListBoxItemClick(const Sender: TCustomListBox;
  const Item: TListBoxItem);
begin
end;

Label:
Code:

  GetText

BLACKFIRE69 06-10-2023 15:16

Quote:

Originally Posted by audiofeel (Post 502703)
Preliminarily... failure at startup occurs only if the script is built on version 5.6.1. On version 6.2.2, I have not noticed any failures yet. I could be wrong . It is possible that something is wrong with my pc machine. Or I have a mistake in the script.
youtu.be



sorry for the delayed response; i've been quite busy these past few days and, to be honest, i haven't had a good night's sleep in two days. :o


it seems that the wGetLogicalDriveList function doesn't function as expected in InnoSetup v5.x. however, the FLogicalDrives class works reliably across all scenarios and has undergone thorough testing.


Code:

type
  FLogicalDrives = interface(IUnknown)
    '{73D9B3A3-6571-474E-B043-7DC8D3248538}'
    procedure FCreate;
    function Count: Integer;
    function CDriveIndex: Integer;
    function Letter(const Index: Integer): WideString;
    function LetterToIndex(const Letter: WideString): Integer;
    function IsRemovable(const Index: Integer): Boolean;
    function MediaType(const Index: Integer): Integer;
    function MediaTypeEx(const Index: Integer; out HealthStatus, Usage: Integer): Integer;
    function SpaceFreeMB(const Index: Integer): Integer;
    function SpaceAvailableMB(const Index: Integer): Integer;
    function SpaceTotalMB(const Index: Integer): Integer;
  end;


Code:

{ Drive Media Type }
const
  HDD_MEDIA_TYPE_UNKNOWN        = $0000;
  HDD_MEDIA_TYPE_USB            = $0001;
  HDD_MEDIA_TYPE_SD            = $0002;
  HDD_MEDIA_TYPE_HDD            = $0003;
  HDD_MEDIA_TYPE_SSD            = $0004;
  HDD_MEDIA_TYPE_SCM            = $0005;
  HDD_MEDIA_TYPE_NVMe          = $0006;

{ Drive Health }
const
  HDD_HEALTH_STATUS_HEALTHY    = $0000;
  HDD_HEALTH_STATUS_WARNING    = $0001;
  HDD_HEALTH_STATUS_UNHEALTHY  = $0002;
  HDD_HEALTH_STATUS_UNKNOWN    = $0005;

{ Drive Usage }
const
  HDD_USAGE_UNKWOWN            = $0000;
  HDD_USAGE_AUTO_SELECT        = $0001; // used for data storage.
  HDD_USAGE_MANUAL_SELECT      = $0002; // used if manually selected by an administrator at the time of virtual disk creation.
  HDD_USAGE_RETIRED            = $0004; // retired from use
  HDD_USAGE_CACHE              = $0005; // used as a cache for other devices.


Code:

  { LogicalDrives }
  LogicalDrives.FCreate;

  if LogicalDrives.Count > 0 then
  begin
    { ListBox }
    ListBox.FCreate(FMXForm.Handle);
    ListBox.SetBounds(NSX(32), NSY(53), NSX(297), NSY(249));
    ListBox.OnChange(@ListBoxOnChange);

    if ImgList.Count >= 2 then
      ListBox.ImageList(ImgList.Handle);

    { ListBox-Items }
    SetArrayLength(ListBoxItems, LogicalDrives.Count);

    ListBox.BeginUpdate;  // BeginUpdate
    for i := 0 to LogicalDrives.Count - 1 do
    begin
      ListBoxItems[i] := InitListBoxItemHandle;
      ListBoxItems[i].FCreate(ListBox.Handle);
      ListBoxItems[i].Text(LogicalDrives.Letter(i));

      if (ImgList.Count >= 2) then
      begin
        if (i = LogicalDrives.CDriveIndex) then  // C-Drive
          ListBoxItems[i].ImageIndex(0)
        else
          ListBoxItems[i].ImageIndex(1);
      end;

      ListBox.AddItem(ListBoxItems[i].Handle);
    end;
    ListBox.EndUpdate;    // EndUpdate
  end else
    MsgBox('"LogicalDrives" failded!', mbError, MB_OK);


.

hitman797 07-10-2023 03:05

2 Attachment(s)
System.SysUtils and System.IOUtils Unite:
Code:

procedure TForm8.Button1Click(Sender: TObject);
var
  i: Integer;
  hFileName: String;
  hDirArray, hFileArray: TStringDynArray;
begin
  ListBox1.Items.Clear;
  ListBox1.BeginUpdate;
  hFileName := 'C:\Windows';
  ListBox1.Items.Add(ExtractFileName(hFileName));
  hDirArray := TDirectory.GetDirectories(hFileName);
  for hFileName in hDirArray do
  begin
    ListBox1.Items.Add(ExtractFileName(hFileName));
  end;
{  hFileArray := TDirectory.GetFiles(hFileName);
  for hFileName in hFileArray do
  begin
    ListBox1.Items.Add(ExtractFileName(hFileName));
  end;  }
  ListBox1.EndUpdate;
end;


hitman797 07-10-2023 05:52

2 Attachment(s)
Code:

procedure TDialogForm.Button1Click(Sender: TObject);
begin
  if length(Label1.Text) = 3 then
  begin
    CreateDir(Label1.Text+Edit1.Text);
    Label1.Text:= Label1.Text+Edit1.Text;
  end else begin
    CreateDir(Label1.Text+'\'+Edit1.Text);
    Label1.Text:= Label1.Text+'\'+Edit1.Text;
  end;
  Timer1.Enabled:= True;
end;

procedure TDialogForm.FormCreate(Sender: TObject);
var
 hDriveArry: TStringDynArray;
 hDriveName: String;
begin
  ListBox1.Clear;
  ListBox1.BeginUpdate;
  hDriveArry:= TDirectory.GetLogicalDrives;
  for hDriveName in hDriveArry do
  begin
  ListBox1.Items.Add(hDriveName);
  end;
  ListBox1.EndUpdate;
  Timer1.Enabled:= True;
end;

procedure TDialogForm.ListBox1ItemClick(const Sender: TCustomListBox;
  const Item: TListBoxItem);
begin
  Label1.Text:= ListBox1.Items.Strings[ListBox1.ItemIndex];
  Timer1.Enabled:= True;
end;

procedure TDialogForm.ListBox2ItemClick(const Sender: TCustomListBox;
  const Item: TListBoxItem);
begin
  if length(Label1.Text) = 3 then
  begin
    Label1.Text:= Label1.text+ListBox2.Items.Strings[ListBox2.ItemIndex];
  end else begin
    Label1.Text:= Label1.text+'\'+ListBox2.Items.Strings[ListBox2.ItemIndex];
  end;
  Timer1.Enabled:= True;
end;

procedure TDialogForm.SpeedButton1Click(Sender: TObject);
begin
  Label1.Text:= 'C:\Windows';
  Timer1.Enabled:= True;
end;

procedure TDialogForm.SpeedButton2Click(Sender: TObject);
begin
  Label1.Text:= ExtractFileDir(Label1.Text);
  Timer1.Enabled:= True;
end;

procedure TDialogForm.Timer1Timer(Sender: TObject);
var
 hDirArry: TStringDynArray;
 hDirName: String;
begin
  ListBox2.Clear;
  ListBox2.BeginUpdate;
  hDirName:= Label1.Text;
  hDirArry:= TDirectory.GetDirectories(hDirName);
  for hDirName in hDirArry do
  begin
    ListBox2.Items.Add(ExtractFileName(hDirName));
  end;
  ListBox2.EndUpdate;
  Timer1.Enabled:= False;
end;


BLACKFIRE69 07-10-2023 08:29

Testing
 
Testing:

guys, if any of you happen to have some free time and are using virtual machines other than VMware 17.x, could you please test this on them?





https://i.ibb.co/GtSV1rL/01.png





Quote:

Originally Posted by BLACKFIRE69 (Post 502738)
sorry for the delayed response; i've been quite busy these past few days and, to be honest, i haven't had a good night's sleep in two days. :o


it seems that the wGetLogicalDriveList function doesn't function as expected in InnoSetup v5.x. however, the FLogicalDrives class works reliably across all scenarios and has undergone thorough testing.


Code:

type
  FLogicalDrives = interface(IUnknown)
    '{73D9B3A3-6571-474E-B043-7DC8D3248538}'
    procedure FCreate;
    function Count: Integer;
    function CDriveIndex: Integer;
    function Letter(const Index: Integer): WideString;
    function LetterToIndex(const Letter: WideString): Integer;
    function IsRemovable(const Index: Integer): Boolean;
    function MediaType(const Index: Integer): Integer;
    function MediaTypeEx(const Index: Integer; out HealthStatus, Usage: Integer): Integer;
    function SpaceFreeMB(const Index: Integer): Integer;
    function SpaceAvailableMB(const Index: Integer): Integer;
    function SpaceTotalMB(const Index: Integer): Integer;
  end;


Code:

{ Drive Media Type }
const
  HDD_MEDIA_TYPE_UNKNOWN        = $0000;
  HDD_MEDIA_TYPE_USB            = $0001;
  HDD_MEDIA_TYPE_SD            = $0002;
  HDD_MEDIA_TYPE_HDD            = $0003;
  HDD_MEDIA_TYPE_SSD            = $0004;
  HDD_MEDIA_TYPE_SCM            = $0005;
  HDD_MEDIA_TYPE_NVMe          = $0006;

{ Drive Health }
const
  HDD_HEALTH_STATUS_HEALTHY    = $0000;
  HDD_HEALTH_STATUS_WARNING    = $0001;
  HDD_HEALTH_STATUS_UNHEALTHY  = $0002;
  HDD_HEALTH_STATUS_UNKNOWN    = $0005;

{ Drive Usage }
const
  HDD_USAGE_UNKWOWN            = $0000;
  HDD_USAGE_AUTO_SELECT        = $0001; // used for data storage.
  HDD_USAGE_MANUAL_SELECT      = $0002; // used if manually selected by an administrator at the time of virtual disk creation.
  HDD_USAGE_RETIRED            = $0004; // retired from use
  HDD_USAGE_CACHE              = $0005; // used as a cache for other devices.


Code:

  { LogicalDrives }
  LogicalDrives.FCreate;

  if LogicalDrives.Count > 0 then
  begin
    { ListBox }
    ListBox.FCreate(FMXForm.Handle);
    ListBox.SetBounds(NSX(32), NSY(53), NSX(297), NSY(249));
    ListBox.OnChange(@ListBoxOnChange);

    if ImgList.Count >= 2 then
      ListBox.ImageList(ImgList.Handle);

    { ListBox-Items }
    SetArrayLength(ListBoxItems, LogicalDrives.Count);

    ListBox.BeginUpdate;  // BeginUpdate
    for i := 0 to LogicalDrives.Count - 1 do
    begin
      ListBoxItems[i] := InitListBoxItemHandle;
      ListBoxItems[i].FCreate(ListBox.Handle);
      ListBoxItems[i].Text(LogicalDrives.Letter(i));

      if (ImgList.Count >= 2) then
      begin
        if (i = LogicalDrives.CDriveIndex) then  // C-Drive
          ListBoxItems[i].ImageIndex(0)
        else
          ListBoxItems[i].ImageIndex(1);
      end;

      ListBox.AddItem(ListBoxItems[i].Handle);
    end;
    ListBox.EndUpdate;    // EndUpdate
  end else
    MsgBox('"LogicalDrives" failded!', mbError, MB_OK);


.



All times are GMT -7. The time now is 17:39.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com