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)

BLACKFIRE69 30-04-2024 11:15

1 Attachment(s)
Quote:

Originally Posted by Tihiy_Don (Post 504355)
Good afternoon! Some users, on any systems, have a problem when the installer process hangs in the processes and the form does not open. It occurs extremely rarely, in about 5-10 percent of users. I hope this issue has been fixed in this version. I tried to change different types of forms, the result is the same.



users sometimes report this issue, but until now, i couldn't come up with a better solution.

let's dive a little deeper into this. in FMXInno, all the forms (FluentForm, BlankForm, ImageForm, etc.) are based on a single form called 'TFMXFluentF', which is a modified Firemonkey TForm specifically used for FMXInno. i think this could be the main reason for all of this. So, that's how i came up with this new idea.

i've introduced a new form called 'ClassicForm' into FMXInno. so, what is the 'ClassicForm'? Is it another blank form or something else? actually not, it's an original Firemonkey TForm which is exactly the same as the one Mr. Jiva Newstone used in 'ISFMXFW'.

First of all, let's check out the key differences between FMXInno's TFMXFluentF and ISFMXFW's TForm:

Code:

- FMXInno's TFMXFluentF:
  1. This replaces the WizardForm when creating.
  2. It has more control over this.
  3. It can have Fluent effects on this.

- ISFMXFW's TForm:
  1. This is parented to the WizardForm, nothing is replaced.
  2. It has limited controls.
  3. Fluent effects cannot be used on this.


so, how is the 'Classic' form gonna fix this issue? my idea is to have two modes for the same installer as a backup using 'Classic' forms. to do so, we can use command-line parameters in case the setup is unable to run with the 'TFMXFluentF'. we can easily do that using a batch file, and the following simple example will show you how to do that.


Code:

var
  IsClassicMode: Boolean;

function InitializeSetup(): Boolean;
begin
  IsClassicMode := CmdLineParamExist('/Classic');

  FMXInnoInit;
  Result := True;
end;

procedure InitializeWizard();
begin
  EmptyWizardForm(True, 640, 480);

  // Music ...

  FMXDesigning;
  FMXForm.Show;

  if IsClassicMode then
    pTaskbarPreview(True) // or pTaskbarPreviewEx(WizardForm.Handle, True);
  else
    pTaskbarPreviewEx(FMXForm.HandleHWND, True);
end;

procedure FMXDesigning;
begin
  { FMX Form }
  if IsClassicMode then
    FMXForm.FCreateClassicForm(WizardForm.Handle, ALMoneyGreen, '')
  else
    FMXForm.FCreateFluent(WizardForm.Handle, False, False, 0.56, 0);

  FMXForm.SetCursor(ExtractAndLoad('Dark.cur'));
  ...
end;

Code:

Bat File:

@echo off
cd /d "%~dp0"

start "" "_Setup1.exe" /Classic


in this way, you can try the classic mode if the installer is unable to run with modern forms. (because of the classic form, FMXInno may support old OS like Windows 7. i'm not sure because i don't have any virtual machine or bare metal right now to test it out.)

there're some facts you should notice when using the classic forms:

Code:

1. EmptyWizardForm - the 'Buttons' parameter should always be 'True'.
  eg: EmptyWizardForm(True, 640, 480);

2. pTaskbarPreviewEx - the 'hwnd' parameter should always be 'WizardForm.Handle'.
  eg: pTaskbarPreviewEx(WizardForm.Handle, True);


in the attachment, i've included two examples: a simple example and the Modern FitGirl Installer example with both Normal and Classic modes. run the batch files to see the differences. the following screenshot will show you the Modern FitGirl installer in both normal and classic mode. (remember, classic forms are always borderless rectangle forms, and we cannot control the border style.)

also, the first post has been updated with the new update.


.

Tihiy_Don 01-05-2024 08:11

Thank you - this is exactly what I need, I will try to implement the installer on it and test it on users. Unfortunately, I also could not identify any consistency with this problem, it sometimes occurs on windows 11, 10 and 7. Someone solved this problem by rebooting the operating system, but others did not. I also sent you a message on krinkels related to unpacking the archives, please read it as you have free time.

Fak Eid 10-05-2024 09:28

3 Attachment(s)
Hi @Blackfire69,

Can you please help me with following additions/workaround to FMX Libraries as I require them on a Project I'm working in:

1. Can we fetch the drive's name (Picture 1)?

2. Functionality to have sharp corners on FCustomFluentWindow?
Edit: Audiofeel helped with this. Thank you
Code:

InstallPage.FCreateBlankForm(FMXForm.HandleHWND, HTMLColorStrToFMXColor('#25282f'), '');

InstallPage.Show;
SetWin11FormCorners(InstallPage.ParentHandleHWND, ctw11Sharp);

3. Functionality to have FImgSlideShow or FFormImgSlide inside FRectangle (not HWND)

4. A variable on ProgressCallback to fetch the total disk size extracted in case of multiple disks. I tried doing (Installation % * Size) div 100 but it is just workaround. (Picture 2 & 3 for reference)

5. In some cases, the CpuUsage.Name gives value seperated by Tabs. Any way to remove that? Like:
Processor: { Tab Space } AMD Ryzen 9

6. How to right align a FLabel/FText? It is not working or an example please.
Edit: Audiofeel helped with this. Thank you
Code:

ALabel.FCreate(PageContent[3].Handle, '57.2 GB');
ALabel.SetBounds(500, 165, 70, 20);
ALabel.FontSetting('{#FontName}', 11, {#SelectedFontColor});
ALabel.FontStyle([fsBold]);
ALabel.TextSetting(False, txTrailing, txCenter);

7. FCombineText: if have 0 Tab space must get the width of Text 1 and Text 2 should start after some space

With the new FMXInno, so many error messages keep popping up. Can you please have a toggle to turn them off or bypass?

BLACKFIRE69 11-05-2024 09:01

FMXInno - Updates
 
7 Attachment(s)
FMXInno Cumulative Update - [2024 May 11]

Code:

* Improvements in the code.
* Cleaned up the code a bit and removed duplications.
* More stable.

* This build could be more efficient than the previous one.
  - Ensured compatibility with Windows 11 24H2.

* Added a new class to deal with INI files.
  - Now you can handle even complex INI files more easily.
  - Check the example in the attachment.

* Added a new class for All-in-One array.
  - Now you can have multiple data types in one array.
  - Supports 11+ data types by default.
  - More data types will be added upon request.
  - Easy to manipulate.
  - Check the example in the attachment.

* Updated FLogicalDrives class.
  - Added a new property called 'Disk Name'.
  - Check out the 'Example_LogicalDrives.iss'.

* Updated FXStream.
  - FXPckr can hold InnoSetup's encrypted password.
  - Updated encryption.
  - Fixed minor bugs related to FCreateFXStream.
  - This version doesn't support previous versions.

* Updated FCheckboxTree class.
  - Now, the OnChange events of checkboxes are handled automatically by the FMXInno internally.
  - To override it and have manual OnChange events, you have to call 'OverrideDefaultOnChangeEvent'.
    eg: Pg4ChkbxTree.OverrideDefaultOnChangeEvent;

* Updated WebView2 class.

* Updated license agreement.



================================================== =================

>> FMXInno hangs on Taskbar <<

Now we've evidence that the main cause of this issue is the custom font. Generally, I use the following three functions to install custom fonts into the installer:

Code:

1. InstallFMXFont
2. DeleteFMXFont
3. InvalidateFMXFont

Instead of using these three functions, try the following functions for custom fonts for now:

Code:

1. AddFontResource2
2. RemoveFontResource2

I've updated the examples, so you can check them out to see how to use these functions.

Thanks to @Tihiy_Don for conducting some tests on this.



The first post has been updated.



.

ScOOt3r 12-05-2024 12:30

Thanks @Blackfire69 this fixes my issue of the same thing to.. works Great!

ScOOt3r

BLACKFIRE69 13-05-2024 00:36

Quote:

Originally Posted by Fak Eid (Post 504421)
With the new FMXInno, so many error messages keep popping up. Can you please have a toggle to turn them off or bypass?

Quote:

Originally Posted by audiofeel (Post 504453)
I think it's better for us to catch errors than for users not to ?


  • The new error handler is a little bit tougher because effective error management is key to reducing runtime errors, especially. This approach forces you to explicitly handle errors and null values, making your code clearer and safer.

  • The new error handler provides more informative error messages tailored to specific situations, making it very convenient to deal with.

  • Why didn't previous versions display these error messages? Because they lacked an error handler altogether, thus allowing any errors to go unnoticed and potentially causing issues.


The error handler will remain active; I won't permit bypassing it. ;)



.

Fak Eid 13-05-2024 07:52

Quote:

Originally Posted by BLACKFIRE69 (Post 504454)
The error handler will remain active; I won't permit bypassing it. ;)
.

No issues. Completely understandable. I'll just rewrite my code again. Can you please implement 4, 5 and 7 (optional, if possible).

BLACKFIRE69 14-05-2024 03:50

Quote:

Originally Posted by Fak Eid (Post 504459)
No issues. Completely understandable. I'll just rewrite my code again. Can you please implement 4, 5 and 7 (optional, if possible).



Quote:

Originally Posted by Fak Eid (Post 504421)
Hi @Blackfire69,

3. Functionality to have FImgSlideShow or FFormImgSlide inside FRectangle (not HWND)

1. 'FImgSlideshow' requires its parent as 'HWND' because it's originally based on a VCL component.
2. You can create a 'FFormImgSlide' on an 'FRectangle' because its parent's type requires 'TFMXObject'.



Quote:

Originally Posted by Fak Eid (Post 504421)

4. A variable on ProgressCallback to fetch the total disk size extracted in case of multiple disks. I tried doing (Installation % * Size) div 100 but it is just workaround. (Picture 2 & 3 for reference)

the callback function already has too many parameters, so i'll add two new functions instead.

Code:

function ISArcExGetTotalSizeMBOfAllDisks: Integer;
  --> Uncompressed (Original) size of all the disks (in MB).

function ISArcExGetExtractedSizeMBOfAllDisks: Integer;
  --> Currently extracted size of all the disks (in MB).

Code:

Example:

function ProgressCallback(...): longword;
var
  S: WideString;
begin
  ...

  // Extra: Titlebar Caption
  S := 'Total Extraction:  ' + IntToStr(ISArcExGetExtractedSizeMBOfAllDisks) +
      '  MB  /  ' + IntToStr(ISArcExGetTotalSizeMBOfAllDisks) + '  MB';

  WizardForm.Caption := S;

  Result := ISArcExCancel;
end;

Code:

Stats:

data1.bf  ==  914 MB
data2.bf  ==  764 MB
data3.bf  ==  613 MB

Total == 2,291 MB



Quote:

Originally Posted by Fak Eid (Post 504421)

5. In some cases, the CpuUsage.Name gives value seperated by Tabs. Any way to remove that? Like:
Processor: { Tab Space } AMD Ryzen 9

Code:

  Something := Trim(CpuUsage.Name);


Quote:

Originally Posted by Fak Eid (Post 504421)

7. FCombineText: if have 0 Tab space must get the width of Text 1 and Text 2 should start after some space

To use spaces instead of tab spaces, use a 'Negative' value for 'Tabs'.
  • Positive values for Tabs:
    • 1 = One Tab
    • 2 = Two Tabs
    • 3 = Three Tabs
    • etc.

  • Negative values for Tabs:
    • -1 = One Space
    • -2 = Two Spaces
    • -3 = Three Spaces
    • etc.


Code:

{ ACombineText }
ACombineText.FCreate(FMXForm.Handle, 50, 80, 'The Module Name:', 'FMXInno.dll', -3, False);

ACombineText.Text1Setting('Segoe UI SemiBold', 16, ALBlack, False);
ACombineText.Text2Setting('Segoe UI', 16, ALRed, False);
ACombineText.Text1ShadowSetting(ALBlack, 0.2, 0.2);
ACombineText.Text2ShadowSetting(ALRed, 0.1, 0.6);



.

Fak Eid 16-05-2024 08:29

1 Attachment(s)
Thank you for the enhancements. But there seems to be a bug.
When trying to open this FCustomFluentWindow for the first time, I'm able to see a header on top of it which goes away after dragging.

It is only happening for the first time and for this FCustomFluentWindow. For other it is working as expected. Can you let me know what could be the issue here?

BLACKFIRE69 16-05-2024 09:00

Quote:

Originally Posted by Fak Eid (Post 504501)
Thank you for the enhancements. But there seems to be a bug.
When trying to open this FCustomFluentWindow for the first time, I'm able to see a header on top of it which goes away after dragging.

It is only happening for the first time and for this FCustomFluentWindow. For other it is working as expected. Can you let me know what could be the issue here?



Code:

SetWin11FormCorners(CusForm.ParentHandleHWND, ctw11Sharp);
this could be the cause of that.

R6S 17-05-2024 01:21

Quote:

Originally Posted by xNoah (Post 495481)
Hello upon testing this, it doesn't seem to work. I am still have the same issue.

link can downloud the best existing compression tool that works with WPI_CorePack

Fak Eid 17-05-2024 01:24

1 Attachment(s)
Quote:

Originally Posted by BLACKFIRE69 (Post 504502)
Code:

SetWin11FormCorners(CusForm.ParentHandleHWND, ctw11Sharp);
this could be the cause of that.

Commented that line of code. Now the form comes in round corners, but it is still happening. Any other fix?

Fak Eid 17-05-2024 02:16

Quote:

Originally Posted by audiofeel (Post 504516)
is the newest version of the dll from May 11th in use? and do you use a style file in your work? if so, then give it up and try again.

I use the 14th May version from the link Blackfire shared above, with my enhancements. Yes, I do use a style file for FMemo, FEdit, FCheckbox and in future for FSwitch. I tested without style.bin file but still the issue persists.

The fact that it is only happening for InstallPage: FCustomFluentWindow only for the first time and not again, and not happening for ExitPage and SettingsPage confuses me.

BLACKFIRE69 17-05-2024 04:14

Quote:

Originally Posted by Fak Eid (Post 504518)
I use the 14th May version from the link Blackfire shared above, with my enhancements. Yes, I do use a style file for FMemo, FEdit, FCheckbox and in future for FSwitch. I tested without style.bin file but still the issue persists.

The fact that it is only happening for InstallPage: FCustomFluentWindow only for the first time and not again, and not happening for ExitPage and SettingsPage confuses me.


i can't easily explain why this is happening, and i can't recreate the situation to test it. but anyway,

FMXInno - [2024-May-17].rar

Fak Eid 18-05-2024 03:00

2 Attachment(s)
Quote:

Originally Posted by BLACKFIRE69 (Post 504525)
i can't easily explain why this is happening, and i can't recreate the situation to test it. but anyway,

17th May version has some more issues.
But I figured, in 14th May version. This anomaly is only happening in InstallPage @1080p 125% resolution only which is FCustomFluentWindow with both FCreateBlankForm only(not any other FCreate functions).

For the rest other resolutions, it is working fine. Sharing you files to look and please let me know if I'm doing something wrong as well. I'll try correcting it from next time as well. [This is just dummy code set]

Required Files in 'Game' folder.
FMX files in Files/Modules
Section to review: Search by keyword 'InstallPage'

PS: Please also add GetSelectedDiskName (to get the name of the selected drive) on FDiskList.


All times are GMT -7. The time now is 05:06.

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