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)

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.


All times are GMT -7. The time now is 23:38.

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