Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials

Reply
 
Thread Tools Display Modes
  #16  
Old 30-07-2022, 06:02
Razor12911's Avatar
Razor12911 Razor12911 is offline
Programmer
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,680
Thanks: 2,088
Thanked 10,657 Times in 2,238 Posts
Razor12911 is on a distinguished road
I am not sure how far you have gone with development however there are some information that could be helpful which I'd like to share as I've created a similar project for installer creator once before.

Colors used by FireMonkey framework are reversed compared to VCL (what Inno uses) so the function RGBtoBGR will be useful to you when you decide to add color picker.

The font sizes are different as well because the DPI used in VCL (72 dpi) is different from FMX (96 dpi) whatever font values used during design mode should be multiplied by the factor 72/96 and by 96/72 when going from inno to fmx.

In order to make the code for paging through the wizard simple (welcome, system, install), introduce TTabControl and make tabs for each one of these pages and to make the tabcontrol itself transparent, you'll need to set its StyleLookup property to "transparentedit", this applies to everything that you want to make transparent in FMX, just set the StyleLookup value to this vale.

To get a list of fonts supported by Fmx you should use Printer from FMX.Printers.Win

Code:
var
  Printer: TPrinterWin;
begin
  Printer := TPrinterWin.Create; 
  ComboBox1.BeginUpdate;
  try
    ComboBox1.Items.AddStrings(Printer.Fonts);
  finally
    ComboBox1.EndUpdate;
  end;
  Printer.Free;
It's wise to introduce class objects for things such as buttons because not only does this mean you'll write less code but this way you can consolidate any bugs/issues encountered with one simple fix.

Something like this:
Code:
type
  TDesignButton = class(TSelection)
  private
    FRectangle: TRectangle;
    FLabel: TLabel;
    procedure MyMouseEnter(Sender: TObject);
    procedure MyMouseLeave(Sender: TObject);
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    procedure SetText(AText: String);
    procedure SetFont(AName: String; ASize: Single; AColor: TAlphaColor);
    procedure SetFontStyle(ABold, AItalic: Boolean);
    procedure SetAlignment(AHorzAlign, AVertAlign: TTextAlign;
      AOffsetX, AOffsetY: Single);
    procedure SetImage(AFilename: String);
  end;

constructor TDesignButton.Create(AOwner: TComponent);
begin
  inherited Create(Owner);
  Self.HideSelection := True;
  Self.ShowHandles := False;
  Self.OnMouseEnter := MyMouseEnter;
  Self.OnMouseLeave := MyMouseLeave;
  FRectangle := TRectangle.Create(Self);
  FRectangle.Parent := Self;
  FRectangle.Align := TAlignLayout.Client;
  FRectangle.HitTest := False;
  FRectangle.Fill.Bitmap.WrapMode := TWrapMode.TileStretch;
  FRectangle.Stroke.Thickness := 0;
  FLabel := TLabel.Create(FRectangle);
  FLabel.Parent := FRectangle;
  FLabel.Align := TAlignLayout.Client;
  FLabel.HitTest := False;
  FLabel.Text := '';
  FLabel.StyledSettings := [];
end;

destructor TDesignButton.Destroy;
begin
  inherited Destroy;
end;

procedure TDesignButton.MyMouseEnter(Sender: TObject);
begin
  Self.HideSelection := False;
  Self.ShowHandles := True;
end;

procedure TDesignButton.MyMouseLeave(Sender: TObject);
begin
  Self.HideSelection := True;
  Self.ShowHandles := False;
end;

procedure TDesignButton.SetText(AText: String);
begin
  FLabel.Text := AText;
end;

procedure TDesignButton.SetFont(AName: String; ASize: Single;
  AColor: TAlphaColor);
begin
  FLabel.Font.Family := AName;
  FLabel.Font.Size := ASize;
  FLabel.FontColor := AColor;
end;

procedure TDesignButton.SetFontStyle(ABold, AItalic: Boolean);
begin
  FLabel.Font.Style := [];
  if ABold then
    FLabel.Font.Style := FLabel.Font.Style + [TFontStyle.fsBold];
  if AItalic then
    FLabel.Font.Style := FLabel.Font.Style + [TFontStyle.fsItalic];
end;

procedure TDesignButton.SetAlignment(AHorzAlign, AVertAlign: TTextAlign;
  AOffsetX, AOffsetY: Single);
begin
  FLabel.TextAlign := AHorzAlign;
  FLabel.VertTextAlign := AVertAlign;
  FLabel.Margins.Left := AOffsetX;
  FLabel.Margins.Right := -AOffsetX;
  FLabel.Margins.Top := AOffsetY;
  FLabel.Margins.Bottom := -AOffsetY;
end;

procedure TDesignButton.SetImage(AFilename: String);
begin
  FRectangle.Fill.Kind := TBrushKind.Bitmap;
  FRectangle.Fill.Bitmap.Bitmap.LoadFromFile(AFilename);
end;
with its usage being:
Code:
var
  BackButton, NextButton: TDesignButton;

procedure TForm2.FormShow(Sender: TObject);
begin
  BackButton := TDesignButton.Create(Form2);
  BackButton.Parent := Form2;
  BackButton.SetBounds(20, 20, 100, 30);
  BackButton.SetText('Back');
  BackButton.SetFont('Agency FB', 14, claGreen);
  BackButton.SetFontStyle(True, False);
  BackButton.SetAlignment(TTextAlign.Center, TTextAlign.Center, -10, 0);
  BackButton.SetImage('back.png');

  NextButton := TDesignButton.Create(Form2);
  NextButton.Parent := Form2;
  NextButton.SetBounds(140, 20, 100, 30);
  NextButton.SetText('Next');
  NextButton.SetFont('Agency FB', 14, claDeepPink);
  NextButton.SetFontStyle(True, False);
  NextButton.SetAlignment(TTextAlign.Center, TTextAlign.Center, 10, 0);
  NextButton.SetImage('Next.png');
end;
I have uploaded a compiled demo of what to expect as a result, but you can improve upon this by introducing Get* functions, eg. GetText, GetFontName, GetFontSize etc etc....
Attached Files
File Type: 7z sample.7z (4.57 MB, 41 views)

Last edited by Razor12911; 30-07-2022 at 06:36.
Reply With Quote
The Following 4 Users Say Thank You to Razor12911 For This Useful Post:
Carldric Clement (30-07-2022), Cesar82 (30-07-2022), Grumpy (31-07-2022), houcine80 (31-07-2022)
Sponsored Links
  #17  
Old 30-07-2022, 07:40
Cesar82's Avatar
Cesar82 Cesar82 is online now
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 881
Thanks: 1,457
Thanked 1,915 Times in 646 Posts
Cesar82 is on a distinguished road
Thanks Razor for the information that might help.
A designer for the CIU has always been a complicated project, and often abandoned. I'm hoping that this time it can be completed, even if we have to wait a long time.

A suggestion of mine for the project is to include a "Reset Size" button or something like "Adjust To Image" so that when clicking the button display image or another component can be automatically resized to the real dimension of the png image.
Background images, LogoBG and some others cannot be resized, and those that can be resized by botva2 lose focus. So the design is better if it includes the dimensions of the components the same as the real image, but it should be allowed to freely adjust the dimensions so that the image file can be corrected later if necessary.
Reply With Quote
The Following 3 Users Say Thank You to Cesar82 For This Useful Post:
Carldric Clement (30-07-2022), Grumpy (31-07-2022), houcine80 (31-07-2022)
  #18  
Old 30-07-2022, 11:07
Carldric Clement's Avatar
Carldric Clement Carldric Clement is offline
Registered User
 
Join Date: Aug 2014
Location: Toboh, Sabah, Malaysia
Posts: 570
Thanks: 573
Thanked 606 Times in 219 Posts
Carldric Clement is on a distinguished road
Quote:
Originally Posted by Razor12911 View Post
I am not sure how far you have gone with development however there are some information that could be helpful which I'd like to share as I've created a similar project for installer creator once before.

Colors used by FireMonkey framework are reversed compared to VCL (what Inno uses) so the function RGBtoBGR will be useful to you when you decide to add color picker.

The font sizes are different as well because the DPI used in VCL (72 dpi) is different from FMX (96 dpi) whatever font values used during design mode should be multiplied by the factor 72/96 and by 96/72 when going from inno to fmx.

In order to make the code for paging through the wizard simple (welcome, system, install), introduce TTabControl and make tabs for each one of these pages and to make the tabcontrol itself transparent, you'll need to set its StyleLookup property to "transparentedit", this applies to everything that you want to make transparent in FMX, just set the StyleLookup value to this vale.

To get a list of fonts supported by Fmx you should use Printer from FMX.Printers.Win

Code:
var
  Printer: TPrinterWin;
begin
  Printer := TPrinterWin.Create; 
  ComboBox1.BeginUpdate;
  try
    ComboBox1.Items.AddStrings(Printer.Fonts);
  finally
    ComboBox1.EndUpdate;
  end;
  Printer.Free;
It's wise to introduce class objects for things such as buttons because not only does this mean you'll write less code but this way you can consolidate any bugs/issues encountered with one simple fix.

Something like this:
Code:
type
  TDesignButton = class(TSelection)
  private
    FRectangle: TRectangle;
    FLabel: TLabel;
    procedure MyMouseEnter(Sender: TObject);
    procedure MyMouseLeave(Sender: TObject);
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    procedure SetText(AText: String);
    procedure SetFont(AName: String; ASize: Single; AColor: TAlphaColor);
    procedure SetFontStyle(ABold, AItalic: Boolean);
    procedure SetAlignment(AHorzAlign, AVertAlign: TTextAlign;
      AOffsetX, AOffsetY: Single);
    procedure SetImage(AFilename: String);
  end;

constructor TDesignButton.Create(AOwner: TComponent);
begin
  inherited Create(Owner);
  Self.HideSelection := True;
  Self.ShowHandles := False;
  Self.OnMouseEnter := MyMouseEnter;
  Self.OnMouseLeave := MyMouseLeave;
  FRectangle := TRectangle.Create(Self);
  FRectangle.Parent := Self;
  FRectangle.Align := TAlignLayout.Client;
  FRectangle.HitTest := False;
  FRectangle.Fill.Bitmap.WrapMode := TWrapMode.TileStretch;
  FRectangle.Stroke.Thickness := 0;
  FLabel := TLabel.Create(FRectangle);
  FLabel.Parent := FRectangle;
  FLabel.Align := TAlignLayout.Client;
  FLabel.HitTest := False;
  FLabel.Text := '';
  FLabel.StyledSettings := [];
end;

destructor TDesignButton.Destroy;
begin
  inherited Destroy;
end;

procedure TDesignButton.MyMouseEnter(Sender: TObject);
begin
  Self.HideSelection := False;
  Self.ShowHandles := True;
end;

procedure TDesignButton.MyMouseLeave(Sender: TObject);
begin
  Self.HideSelection := True;
  Self.ShowHandles := False;
end;

procedure TDesignButton.SetText(AText: String);
begin
  FLabel.Text := AText;
end;

procedure TDesignButton.SetFont(AName: String; ASize: Single;
  AColor: TAlphaColor);
begin
  FLabel.Font.Family := AName;
  FLabel.Font.Size := ASize;
  FLabel.FontColor := AColor;
end;

procedure TDesignButton.SetFontStyle(ABold, AItalic: Boolean);
begin
  FLabel.Font.Style := [];
  if ABold then
    FLabel.Font.Style := FLabel.Font.Style + [TFontStyle.fsBold];
  if AItalic then
    FLabel.Font.Style := FLabel.Font.Style + [TFontStyle.fsItalic];
end;

procedure TDesignButton.SetAlignment(AHorzAlign, AVertAlign: TTextAlign;
  AOffsetX, AOffsetY: Single);
begin
  FLabel.TextAlign := AHorzAlign;
  FLabel.VertTextAlign := AVertAlign;
  FLabel.Margins.Left := AOffsetX;
  FLabel.Margins.Right := -AOffsetX;
  FLabel.Margins.Top := AOffsetY;
  FLabel.Margins.Bottom := -AOffsetY;
end;

procedure TDesignButton.SetImage(AFilename: String);
begin
  FRectangle.Fill.Kind := TBrushKind.Bitmap;
  FRectangle.Fill.Bitmap.Bitmap.LoadFromFile(AFilename);
end;
with its usage being:
Code:
var
  BackButton, NextButton: TDesignButton;

procedure TForm2.FormShow(Sender: TObject);
begin
  BackButton := TDesignButton.Create(Form2);
  BackButton.Parent := Form2;
  BackButton.SetBounds(20, 20, 100, 30);
  BackButton.SetText('Back');
  BackButton.SetFont('Agency FB', 14, claGreen);
  BackButton.SetFontStyle(True, False);
  BackButton.SetAlignment(TTextAlign.Center, TTextAlign.Center, -10, 0);
  BackButton.SetImage('back.png');

  NextButton := TDesignButton.Create(Form2);
  NextButton.Parent := Form2;
  NextButton.SetBounds(140, 20, 100, 30);
  NextButton.SetText('Next');
  NextButton.SetFont('Agency FB', 14, claDeepPink);
  NextButton.SetFontStyle(True, False);
  NextButton.SetAlignment(TTextAlign.Center, TTextAlign.Center, 10, 0);
  NextButton.SetImage('Next.png');
end;
I have uploaded a compiled demo of what to expect as a result, but you can improve upon this by introducing Get* functions, eg. GetText, GetFontName, GetFontSize etc etc....
Thanks for the information bro. Time to change a lot of code where I use the TImage from.
Attached Images
File Type: jpg Screenshot 2022-07-31 014334.jpg (29.4 KB, 188 views)

Last edited by Carldric Clement; 31-07-2022 at 02:21.
Reply With Quote
  #19  
Old 30-07-2022, 13:02
acal3000 acal3000 is offline
Registered User
 
Join Date: Dec 2004
Location: Dancing with the Death
Posts: 511
Thanks: 1
Thanked 11 Times in 7 Posts
acal3000 is on a distinguished road
Pretty Nice GUI Customized Installer
Reply With Quote
The Following 2 Users Say Thank You to acal3000 For This Useful Post:
Carldric Clement (30-07-2022), houcine80 (02-08-2022)
  #20  
Old 31-07-2022, 02:00
Carldric Clement's Avatar
Carldric Clement Carldric Clement is offline
Registered User
 
Join Date: Aug 2014
Location: Toboh, Sabah, Malaysia
Posts: 570
Thanks: 573
Thanked 606 Times in 219 Posts
Carldric Clement is on a distinguished road
Gonna take a few changes to buttons from TImage to TDesignButton. Thanks again to Razor12911 who give some more details to make more progress button. Right now it's gonna be difficult to set the X, Y, Width, and Height from how to get the function from where I replace it.
Attached Images
File Type: jpg Screenshot 2022-07-31 155741.jpg (229.9 KB, 178 views)
Reply With Quote
The Following 5 Users Say Thank You to Carldric Clement For This Useful Post:
Cesar82 (31-07-2022), Grumpy (31-07-2022), houcine80 (31-07-2022), mausschieber (31-07-2022), Razor12911 (01-08-2022)
  #21  
Old 31-07-2022, 07:13
Carldric Clement's Avatar
Carldric Clement Carldric Clement is offline
Registered User
 
Join Date: Aug 2014
Location: Toboh, Sabah, Malaysia
Posts: 570
Thanks: 573
Thanked 606 Times in 219 Posts
Carldric Clement is on a distinguished road
I just upload some source files if you need my help with this solution. My brain got stuck for a moment. Link

Also, I've just made a little progress to make work these buttons before.
Attached Images
File Type: gif Vidz 2022-07-31 21-11-06-450-1.gif (721.6 KB, 169 views)
Reply With Quote
The Following 6 Users Say Thank You to Carldric Clement For This Useful Post:
Cesar82 (31-07-2022), fabrieunko (31-07-2022), Gehrman (17-09-2022), Grumpy (01-08-2022), houcine80 (02-08-2022), Razor12911 (01-08-2022)
  #22  
Old 17-09-2022, 08:30
Carldric Clement's Avatar
Carldric Clement Carldric Clement is offline
Registered User
 
Join Date: Aug 2014
Location: Toboh, Sabah, Malaysia
Posts: 570
Thanks: 573
Thanked 606 Times in 219 Posts
Carldric Clement is on a distinguished road
Time to add some a few setup settings?
Attached Images
File Type: jpg Screenshot 2022-09-17 222944.jpg (184.2 KB, 129 views)
Reply With Quote
The Following 5 Users Say Thank You to Carldric Clement For This Useful Post:
Cesar82 (17-09-2022), fabrieunko (26-12-2022), Gehrman (17-09-2022), houcine80 (17-09-2022), mausschieber (18-09-2022)
  #23  
Old 26-12-2022, 11:29
fabrieunko fabrieunko is offline
Registered User
 
Join Date: Sep 2021
Location: france
Posts: 129
Thanks: 187
Thanked 30 Times in 23 Posts
fabrieunko is on a distinguished road
Hello I hope the project is not dead?
Reply With Quote
  #24  
Old 26-12-2022, 23:57
Carldric Clement's Avatar
Carldric Clement Carldric Clement is offline
Registered User
 
Join Date: Aug 2014
Location: Toboh, Sabah, Malaysia
Posts: 570
Thanks: 573
Thanked 606 Times in 219 Posts
Carldric Clement is on a distinguished road
Due to being a lot of busy for a few months, I've mostly forgotten that project is mostly dead... I'm back. Sorry for making you guys worried.
Attached Images
File Type: jpg Screenshot 2022-12-27 145248.jpg (182.7 KB, 82 views)
Reply With Quote
The Following 2 Users Say Thank You to Carldric Clement For This Useful Post:
fabrieunko (27-12-2022), mausschieber (27-12-2022)
  #25  
Old 27-12-2022, 09:53
fabrieunko fabrieunko is offline
Registered User
 
Join Date: Sep 2021
Location: france
Posts: 129
Thanks: 187
Thanked 30 Times in 23 Posts
fabrieunko is on a distinguished road
ha the best news for the future year.. I follow you because the project interests me a lot. I don't know how to code. but didn't drop anything. I am starting to use ciu and your program will make my task much easier.
Reply With Quote
The Following User Says Thank You to fabrieunko For This Useful Post:
mausschieber (27-12-2022)
  #26  
Old 27-12-2022, 16:27
mausschieber's Avatar
mausschieber mausschieber is offline
Conversion Designer
 
Join Date: Jan 2011
Location: germany
Posts: 2,796
Thanks: 4,739
Thanked 8,486 Times in 2,108 Posts
mausschieber is on a distinguished road
the main thing is that it continues
__________________
It would be nice if you appreciate my work with the thanks Button
Reply With Quote
The Following 2 Users Say Thank You to mausschieber For This Useful Post:
Carldric Clement (27-12-2022), fabrieunko (27-12-2022)
  #27  
Old 03-01-2023, 05:12
Carldric Clement's Avatar
Carldric Clement Carldric Clement is offline
Registered User
 
Join Date: Aug 2014
Location: Toboh, Sabah, Malaysia
Posts: 570
Thanks: 573
Thanked 606 Times in 219 Posts
Carldric Clement is on a distinguished road
[InstallOptions] is complete. Only a few things to get finish the job.
Anyway, Here's the Update 3 in case you would like to test the project.
Attached Images
File Type: png Screenshot 2023-01-03 201004.png (1.10 MB, 38 views)
Reply With Quote
The Following 4 Users Say Thank You to Carldric Clement For This Useful Post:
Cesar82 (03-01-2023), fabrieunko (03-01-2023), mausschieber (03-01-2023), Prettyboy099 (03-01-2023)
  #28  
Old 03-01-2023, 05:30
Cesar82's Avatar
Cesar82 Cesar82 is online now
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 881
Thanks: 1,457
Thanked 1,915 Times in 646 Posts
Cesar82 is on a distinguished road
At a glance only ApplicationName<LNG>= must not be correct snd functional.

ApplicationName<LNG>= there are 36 variations of the ApplicationName= key
Example: ApplicationNameAL=, ApplicationNameAR=, ApplicationNameBIA=, ApplicationNameCNS=, ApplicationNameCNT=, ApplicationNameCZ=, ApplicationNameDE=, etc

EDIT:
For the keys with boolean values (0/1), I particularly prefer a checkbox that is visually easier to understand. But either way it's good.

For the Lang= key it could be a checkbox group, one for each language and then when saving the INI it would form the key with the languages separated by a comma.

Last edited by Cesar82; 03-01-2023 at 05:39.
Reply With Quote
The Following User Says Thank You to Cesar82 For This Useful Post:
Carldric Clement (03-01-2023)
Reply

Tags
ciu designer, ciu v3

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Game Installer Designer by altef_4 altef_4 Conversion Tutorials 236 28-05-2021 03:54
Repetitive vs Stretching Progress Bar Cuttlas Conversion Tutorials 0 10-11-2020 08:14
Unpack files with progress in batch gozarck Conversion Tutorials 3 29-06-2016 13:38
Progress bar for Tasks danswano PC Games - CD/DVD Conversions 22 09-03-2013 13:09



All times are GMT -7. The time now is 12:49.


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