FileForums

FileForums (https://fileforums.com/index.php)
-   Conversion Tutorials (https://fileforums.com/forumdisplay.php?f=55)
-   -   ASIS: Advanced Simple Installer Script (https://fileforums.com/showthread.php?t=99481)

Cesar82 23-03-2019 19:41

ASIS - Valid Component
 
1 Attachment(s)
Quote:

Originally Posted by Schabik (Post 480327)
The extract part is OK, although I'm having problems with understanding the new code.

I have to run a program conditionally that targets in AC1 .forge.patch files.

The condition is that it only should run when Polish or Czech language is selected. How to check if Polish (for example component3.Name=cm:PL) is selected to run the program and run it if the condition is fulfilled?

In Beta6 or 7 it was easy, check if "IsComponentSelected('lang\PolishLang')" and then run program to patch the forge files but now it's not clear for me.

How to use by ID (ID is the number of the component represented by "#" in keys Component#.Name=):
Code:

  if IsComponentSelectedByID(3) then
    MsgBox('True', mbInformation, MB_OK)
  else
    MsgBox('False', mbInformation, MB_OK);

How to use by Name (Same name that you used in INI):
- If you have "Character Backslash" in the name you will check with dependence on "Level".
- If you do not have "Character Backslash" in the name you will only check on the components with "Component#.File" other than empty.
Code:

  if IsComponentSelectedByName('Game Components\') then
    MsgBox('True', mbInformation, MB_OK)
  else
    MsgBox('False', mbInformation, MB_OK);

Code:

  if IsComponentSelectedByName('Game Components\Custom Name') then
    MsgBox('True', mbInformation, MB_OK)
  else
    MsgBox('False', mbInformation, MB_OK);

Code:

  if IsComponentSelectedByName('Game Components\cm:FR') then
    MsgBox('True', mbInformation, MB_OK)
  else
    MsgBox('False', mbInformation, MB_OK);


Schabik 24-03-2019 09:45

Quote:

Originally Posted by Cesar82 (Post 480343)
How to use by ID (ID is the number of the component represented by "#" in keys Component#.Name=):
Code:

  if IsComponentSelectedByID(3) then
    MsgBox('True', mbInformation, MB_OK)
  else
    MsgBox('False', mbInformation, MB_OK);

How to use by Name (Same name that you used in INI):
- If you have "" in the name you will check with dependence on "Level".
- If you do not have "" in the name you will only check on the components with "Component # .File" other than empty.
Code:

  if IsComponentSelectedByName('Game Components\') then
    MsgBox('True', mbInformation, MB_OK)
  else
    MsgBox('False', mbInformation, MB_OK);

Code:

  if IsComponentSelectedByName('Game Components\Custom Name') then
    MsgBox('True', mbInformation, MB_OK)
  else
    MsgBox('False', mbInformation, MB_OK);

Code:

  if IsComponentSelectedByName('Game Components\cm:FR') then
    MsgBox('True', mbInformation, MB_OK)
  else
    MsgBox('False', mbInformation, MB_OK);


Do I need to add some decelerations to the code for IsComponentSelectedByID or IsComponentSelectedByName functions?

KaktoR 24-03-2019 09:54

You can use the folowing for CurStep = ssPostInstall or CurStep = ssDone (like you wish)

Code:

if IsComponentSelectedByName('Game Components\cm:PL') then
    {Execute program here (you can use Exec2 function)}
if IsComponentSelectedByName('Game Components\cm:CZ') then
    {Execute program here (you can use Exec2 function)}

Btw, I rework the Redist page. New update will follow in the next days.

Schabik 24-03-2019 11:35

2 Attachment(s)
Quote:

Originally Posted by KaktoR (Post 480350)
You can use the folowing for CurStep = ssPostInstall or CurStep = ssDone (like you wish)

Code:

if IsComponentSelectedByName('Game Components\cm:PL') then
    {Execute program here (you can use Exec2 function)}
if IsComponentSelectedByName('Game Components\cm:CZ') then
    {Execute program here (you can use Exec2 function)}

Btw, I rework the Redist page. New update will follow in the next days.

OK, thanks a lot guys 😁 I'll check it out tomorrow, because today is Sunday and in my country about 8:30 PM. 😋


Ok, after adding the conditions and trying to compile I've got an error says that a comma is expected. after looking at the end of the line the comma is added but in the 94-th column there should't be a comma.
Attachment 24411


I'm attaching my script.

Cesar82 25-03-2019 01:58

1 Attachment(s)
Quote:

Originally Posted by Schabik (Post 480352)
OK, thanks a lot guys 😁 I'll check it out tomorrow, because today is Sunday and in my country about 8:30 PM. 😋


Ok, after adding the conditions and trying to compile I've got an error says that a comma is expected. after looking at the end of the line the comma is added but in the 94-th column there should't be a comma.
Attachment 24411


I'm attaching my script.

try:
Goto line 4225 and replace in this line end; by #endif
Now goto line 3945 and delete this for lines ( 3945, 3946, 3947, 3948 ) and insert:
Code:

    #if UseComponents == "1"
    if (IsComponentSelectedByName('cm:GameLang\cm:PL')) then
    begin
      WizardForm.ProgressGauge.Hide;
      WizardForm.StatusLabel.Caption := ExpandConstant('{cm:PatchingFiles}');


Attached is a way for you to simplify the code of applying the path with xdelta.
Only the file names change, so it's more practical to create a loop

Schabik 25-03-2019 02:13

Quote:

Originally Posted by Cesar82 (Post 480358)
try:
Goto line 4225 and replace in this line end; by #endif
Now goto line 3945 and delete this for lines ( 3945, 3946, 3947, 3948 ) and insert:
Code:

    #if UseComponents == "1"
    if (IsComponentSelectedByName('cm:GameLang\cm:PL')) then
    begin
      WizardForm.ProgressGauge.Hide;
      WizardForm.StatusLabel.Caption := ExpandConstant('{cm:PatchingFiles}');



Nope, still the same :(
Ok, I've got it now.


in:
Code:

RegWriteDWordValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#Name}_is1', 'EstimatedSize', Round(InstallationSize / 1024));

my {#Name} constant is "Assassin's Creed", the apostrophe causes the error...
Is there a way to replace the apostrophe for the name of the Game to be complete?
Unfortunately I think the game's name must be with the apostrophe for registry entries to work :(

Cesar82 25-03-2019 02:28

Quote:

Originally Posted by Schabik (Post 480359)
Nope, still the same :(
Ok, I've got it now.


in:
Code:

RegWriteDWordValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#Name}_is1', 'EstimatedSize', Round(InstallationSize / 1024));

my {#Name} constant is "Assassin's Creed", the apostrophe causes the error...
Is there a way to replace the apostrophe for the name of the Game to be complete?
Unfortunately I think the game's name must be with the apostrophe for registry entries to work :(

replace line by:
Code:

RegWriteDWordValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#StringChange(Name, "'", "''")}_is1', 'EstimatedSize', Round(InstallationSize / 1024));
Look at the previous post the script I posted;

Schabik 25-03-2019 03:24

2 Attachment(s)
Quote:

Originally Posted by Cesar82 (Post 480360)
replace line by:
Code:

RegWriteDWordValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#StringChange(Name, "'", "''")}_is1', 'EstimatedSize', Round(InstallationSize / 1024));
Look at the previous post the script I posted;


Thanks :)
Ok, About DPICalculator, I think it Does work for 125% Scale but on 100% it does This:


Attachment 24413


and on 150% does this:


Attachment 24414

KaktoR 25-03-2019 07:40

Unfortunatelly I only have a FullHD monitor (1920x1080) and therefore I can't test the DPI right. Maybe Cesar is in the mood to fix this someday :(

Cesar82 25-03-2019 07:41

Quote:

Originally Posted by Schabik (Post 480361)
Thanks :)
Ok, About DPICalculator, I think it Does work for 125% Scale but on 100% it does This:


Attachment 24413


and on 150% does this:


Attachment 24414

I do not know what's happening to you.
Here in Full HD resolution change to 125%, 150% 175% works normal.
https://i.imgur.com/bu87yFH.png

Schabik 25-03-2019 09:16

1 Attachment(s)
Quote:

Originally Posted by Cesar82 (Post 480364)
I do not know what's happening to you.
Here in Full HD resolution change to 125%, 150% 175% works normal.
https://i.imgur.com/bu87yFH.png

OK I'll check it out tomorrow


Ok, the case looks like this,


If I run on basic script (modified only with the statements that verify the selected components to modify files) on my PC with 100% DPI scaling it works fine, the same is after changing to 125%, 150% and 175% but with already runned setup.

I forgot to mention, on both Desktop and Laptop I have 1980x1080 resolution, and on Laptop 125% scaling, as for Desktop 100%


If I run the setup after changing the scale to for example 125% it looks like that:


Attachment 24415


so, the DPICalculator in fact does not work... :(


Edit:


Ok, @KaktoR, @Cesar82 Problem solved.


The Case was that in the original script there were absolute coordinates and sizes for the size of Forms etc.


Just change the absolute sizes to SizeX and SizeY values and Voila :D
For Example if You Have "WilkommenLabel.Width := 600" change it to "WilkommenLabel.Width := SizeX(600)", for "*.Height :=300" change to "*.Height = SizeY(300)", "Top :=" to "Top := SizeY()", "Left :=" to "Left := SizeX()".




Tested it on "WillkommenLabel" and it works.

KaktoR 28-03-2019 11:17

Thanks to @Schabik I was able to fix the DPI for 4K monitors/resolutions.

Here is the new stable version (added to post #1).

Code:

v7.1.2
_____________________________________________________
- Added Redist installation to CompactMode
- Added ISHash library to CompactMode (now really!)
- Updated ISHash library (thanks to peterf1999)
- Added components
  > With this you can unpack language archives or other archives
  > Set them in Settings.ini
  > You don't need to add them to Records.ini
- Reworked Components (thanks to Cesar82)
- Updated 7z to v19.0.0.0
- Changes 'Size=' key in Settings.ini
  > It is now possible to write size as follow:
    b,B,k,K,kb,KB,Kb,m,M,mb,MB,Mb,g,G,gb,GB,Gb,t,T,tb,TB,Tb,p,P,pb,PB,Pb
- Fixed slideshow
  > Before it always show the first picture twice.
- Fixed not correct size in Windows Control Panel
- Fixed some other bugs
- Fixed component progress on ProgressBar
- Fixed ScrollBar on LicensePage and InfoBeforePage if you use cjstyle skin
- Added Skin support to LanguageBox (thanks to Cesar82)
- Added Skin support to Uninstall progress
- Changed appearance in Components page
- Added compact mode to installer
  > This is an option for minimalistic setup with only one page
  > In CompactMode you can only use SFV and MD5 files for CRC check
    I will implement ISHash library later in CompactMode
- Fixed LogButton in CRC Check page
- Fixed other bug if CRC check is disabled
- Added checkbox for "Create Uninstaller"
  > If checkbox is checked, Uninstall files will be created
  > If checkbox is not checked, no uninstall files will be created
- Added [INISettings] to Settings.ini
  > With this you can change INI settings after installation is done
- Fixed french translation for CRC check page (forgot some spaces)
- Added RazorTools
  > ZSTD Precompressor
  > FIFA 19 Cas Decryption Tool + Precompressor
  > Project CARS 2 Bff Decryption Tool
  > LZX Precompressor
- Fixed DPI calculation if text scaling in Windows Display Settings was greater than 100% (thanks to Cesar82)


HunterEmrah 30-03-2019 11:43

1 Attachment(s)
how can i apply custommessage for Main files component ?

Script.iss
Code:

function TranslateComponentName(StrName: String): String;
begin
  case Trim(Uppercase(Copy(StrName, Pos('cm:', LowerCase(StrName)) + Length('cm:'), Length(StrName)))) of
    'EN', 'ENGLISH'  : Result := CustomMessage('CompEnglish');
    'FR', 'FRENCH'    : Result := CustomMessage('CompFrench');
    'DE', 'GERMAN'    : Result := CustomMessage('CompGerman');
    'IT', 'ITALIAN'  : Result := CustomMessage('CompItalian');
    'ES', 'SPANISH'  : Result := CustomMessage('CompSpanish');
    'PL', 'POLISH'    : Result := CustomMessage('CompPolish');
    'RU', 'RUSSIAN'  : Result := CustomMessage('CompRussian');
    'BR', 'BRAZILIAN' : Result := CustomMessage('CompPortugueseBrazil');
    'MX', 'MEXICAN'  : Result := CustomMessage('CompMexican');
    'CZ', 'CZECH'    : Result := CustomMessage('CompCzech');
    'CL', 'COMPLAN'  : Result := CustomMessage('CompLan');
    'CB', 'COMPBONUS' : Result := CustomMessage('CompBonus');
    'GC', 'COMPMAIN'  : Result := CustomMessage('CompMain');
    else
      Result := StrName;
  end;
end;

Code:

ComponentsSize := 0;
  SetArrayLength(CompIndexList, 0);
  IniFile := ExpandConstant('{tmp}\Settings.ini');
  ComponentsPageAvai := GetIniBool('ComponentsSettings', 'Enable', False, IniFile);
  if ComponentsPageAvai then
  begin
    if IniKeyExists('ComponentsSettings', 'Component' + IntToStr(I) + '.Name', IniFile) then
    begin
      CompName := 'cm:COMPMAIN';
      ComponentsList.AddCheckBox(CompName, '', 0, True, False, True, True, nil);
    end;

CustomMessages.iss
Code:

English.CompMain=Main files
also tried to type {cm:CompMain} for CompName, doesn't working

Schabik 30-03-2019 11:58

Quote:

Originally Posted by HunterEmrah (Post 480431)
how can i apply custommessage for Main files component ?

Script.iss
Code:

function TranslateComponentName(StrName: String): String;
begin
  case Trim(Uppercase(Copy(StrName, Pos('cm:', LowerCase(StrName)) + Length('cm:'), Length(StrName)))) of
    'EN', 'ENGLISH'  : Result := CustomMessage('CompEnglish');
    'FR', 'FRENCH'    : Result := CustomMessage('CompFrench');
    'DE', 'GERMAN'    : Result := CustomMessage('CompGerman');
    'IT', 'ITALIAN'  : Result := CustomMessage('CompItalian');
    'ES', 'SPANISH'  : Result := CustomMessage('CompSpanish');
    'PL', 'POLISH'    : Result := CustomMessage('CompPolish');
    'RU', 'RUSSIAN'  : Result := CustomMessage('CompRussian');
    'BR', 'BRAZILIAN' : Result := CustomMessage('CompPortugueseBrazil');
    'MX', 'MEXICAN'  : Result := CustomMessage('CompMexican');
    'CZ', 'CZECH'    : Result := CustomMessage('CompCzech');
    'CL', 'COMPLAN'  : Result := CustomMessage('CompLan');
    'CB', 'COMPBONUS' : Result := CustomMessage('CompBonus');
    'GC', 'COMPMAIN'  : Result := CustomMessage('CompMain');
    else
      Result := StrName;
  end;
end;

Code:

ComponentsSize := 0;
  SetArrayLength(CompIndexList, 0);
  IniFile := ExpandConstant('{tmp}\Settings.ini');
  ComponentsPageAvai := GetIniBool('ComponentsSettings', 'Enable', False, IniFile);
  if ComponentsPageAvai then
  begin
    if IniKeyExists('ComponentsSettings', 'Component' + IntToStr(I) + '.Name', IniFile) then
    begin
      CompName := 'cm:COMPMAIN';
      ComponentsList.AddCheckBox(CompName, '', 0, True, False, True, True, nil);
    end;

CustomMessages.iss
Code:

English.CompMain=Main files
also tried to type {cm:CompMain} for CompName, doesn't working

You have to add to function TranslateComponentName this line

Code:

'CM', 'COMPMAIN' : Result := CustomMessage('CompMain');
Or like you did:
Code:


'GC', 'COMPMAIN'  : Result := CustomMessage('CompMain');

Then to settings.ini cm:CM or cm:GC OR cm:COMPMAIN as the name for the component, just remember to use capital letters after "cm:"

And of course like as You added to CustomMessages.iss
Code:

English.CompMain=Main files
As an advice, try to translate the components names to other languages if the installer is multilang, it will be helpful for others who will use it to unpack the game

HunterEmrah 30-03-2019 12:15

1 Attachment(s)
Quote:

Originally Posted by Schabik (Post 480432)
You have to add to function TranslateComponentName this line
Code:

'CM', 'COMPMAIN' : Result := CustomMessage('CompMain');

already have

Quote:

Originally Posted by Schabik (Post 480432)
Then to settings.ini cm:CM OR cm:COMPMAIN as the name for the component

i have to say, "Main files" components doesn't associated with settings.ini, it's created in script.iss

Code:

//------------ GROUP 1 -------------------------------------
Component1.Name=cm:CompMain
Component1.Level=0
Component1.Exclusive=0
Component1.Checked=1
Component1.Enabled=0

Component2.Name=cm:CompLan
Component2.Level=0
Component2.Exclusive=0
Component2.Checked=1
Component2.Enabled=0

Component3.Name=cm:RU
Component3.File=lzl-selective-russian.bin
Component3.Size=688 mb
Component3.Level=1
Component3.Exclusive=1
Component3.Checked=1
Component3.Enabled=1

Component4.Name=cm:EN
Component4.File=lzl-selective-english.bin
Component4.Size=622 mb
Component4.Level=1
Component4.Exclusive=1
Component4.Checked=0
Component4.Enabled=1

//------------ GROUP 1 -------------------------------------

//------------ GROUP 2 -------------------------------------
Component5.Name=cm:CompBonus
Component5.Level=0
Component5.Checked=1
Component5.Enabled=1

Component6.Name=El Prez Edition Content
Component6.File=lzl-optional-bonus.bin
Component6.Size=0.474 GB
Component6.Level=1
Component6.Exclusive=0
Component6.Checked=1
Component6.Enabled=1

//------------ GROUP 2 -------------------------------------

anyway, i added Main files component in settings.ini, and now have screen like this (see the attachment)

Quote:

Originally Posted by Schabik (Post 480432)
As an advice, try to translate the components names to other languages if the installer is multilang, it will be helpful for others who will use it to unpack the game

that's what i am actually doing :)

Schabik 30-03-2019 12:20

Quote:

Originally Posted by HunterEmrah (Post 480434)
already have


i have to say, "Main files" components doesn't associated with settings.ini, it's created in script.iss

Code:

//------------ GROUP 1 -------------------------------------
Component1.Name=cm:CompMain
Component1.Level=0
Component1.Exclusive=0
Component1.Checked=1
Component1.Enabled=0

Component2.Name=cm:CompLan
Component2.Level=0
Component2.Exclusive=0
Component2.Checked=1
Component2.Enabled=0

Component3.Name=cm:RU
Component3.File=lzl-selective-russian.bin
Component3.Size=688 mb
Component3.Level=1
Component3.Exclusive=1
Component3.Checked=1
Component3.Enabled=1

Component4.Name=cm:EN
Component4.File=lzl-selective-english.bin
Component4.Size=622 mb
Component4.Level=1
Component4.Exclusive=1
Component4.Checked=0
Component4.Enabled=1

//------------ GROUP 1 -------------------------------------

//------------ GROUP 2 -------------------------------------
Component5.Name=cm:CompBonus
Component5.Level=0
Component5.Checked=1
Component5.Enabled=1

Component6.Name=El Prez Edition Content
Component6.File=lzl-optional-bonus.bin
Component6.Size=0.474 GB
Component6.Level=1
Component6.Exclusive=0
Component6.Checked=1
Component6.Enabled=1

//------------ GROUP 2 -------------------------------------

anyway, i added Main files component in settings.ini, and now have screen like this

I use original script from KaktoR and it works.

In settings.ini I had replaced only Component1.Name=Main Files with Component1.Name=cm:GAMEFILES and it worked fine. Try it with the not modified script and add the lines from previous posts

HunterEmrah 30-03-2019 12:30

3 Attachment(s)
but i'm talking about "Main files" component, not "Game Components". Here is the screenshots from untouched script. "Main files" have static title which set in script.iss

Cesar82 30-03-2019 12:54

Quote:

Originally Posted by HunterEmrah (Post 480436)
but i'm talking about "Main files" component, not "Game Components". Here is the screenshots from untouched script. "Main files" have static title which set in script.iss

in the script by text with single quotation marks (Will find in two times):
Code:

'Main Files'
Replace with:
Code:

CustomMessage('MainFiles')
Add in [CustomMessages] inside the script
Code:

English.MainFiles=Main Files
The second option: 'Game Components', to change only if included in the function TranslateComponentName and same message in [CustomMessage], and use in setup.ini into key Component#.Name=cm:SameUsedMessage
In Setup.ini, you can remove component 1
The key: Component1.Name=Game Components
and rearranging the ID of the next components.

HunterEmrah 30-03-2019 13:04

Quote:

CustomMessage('MainFiles')
that's what i needed :) thank you Cesar82

HunterEmrah 30-03-2019 15:04

how to automatically uncheck and disable the checkbox of optional/selective component if file doesn't exist. for eg:

i have only 1 language pack from 5, installer should check availability for all of components and automatically uncheck&disable which are missing

another question, maybe not last. how to integrate INIFile function which changes player name in steam_emu.ini after install, to Language changing? For eg:
During installation i will check English language and after install installer will change "Language=spanish" string to "Language=english" in steam_emu.ini.

In this way, it will be more useful for users if we automate the script. I really loved this script.

Cesar82 31-03-2019 04:01

Quote:

Originally Posted by HunterEmrah (Post 480439)
how to automatically uncheck and disable the checkbox of optional/selective component if file doesn't exist. for eg:

i have only 1 language pack from 5, installer should check availability for all of components and automatically uncheck&disable which are missing

another question, maybe not last. how to integrate INIFile function which changes player name in steam_emu.ini after install, to Language changing? For eg:
During installation i will check English language and after install installer will change "Language=spanish" string to "Language=english" in steam_emu.ini.

In this way, it will be more useful for users if we automate the script. I really loved this script.

For your first problem maybe this will work (If the installer has only one disk).
Code:

procedure CurPageChanged(CurPageID: integer);
var
  I: Integer;
  CompFile: String;
begin
  //...
  if CurPageID = wpWelcome then
  begin
    //....
    #if UseComponents == "1"
    if ComponentsPageAvai then
    begin
      for I := 0 to GetArrayLength(CompIndexList) - 1 do
      begin
        CompFile := GetIniString('ComponentsSettings', 'Component' + IntToStr(CompIndexList[I]) + '.File', '', ExpandConstant('{tmp}\Settings.ini'));
        if (ExtractFileExt(CompFile) <> '') and (not FileExists(ExpandConstant('{src}\' + CompFile))) then
        begin
          ComponentsList.Checked[CompIndexList[I]] := False;
          ComponentsList.ItemEnabled[CompIndexList[I]] := False;
        end;
      end;
    end;
    #endif
  end;
  //...
  //...
end;

To how to integrate INIFile function, ask kaktor to enter the function for this.
Or you can add the code copying from the CIU v3 (Custom Installer Ultimate) script here in the forum (just over 100 lines of code).
To adapt the code you only need change languages of the code and also the GetValStr for the Settings.ini.

HunterEmrah 31-03-2019 05:27

Quote:

Originally Posted by Cesar82 (Post 480441)
For your first problem maybe this will work (If the installer has only one disk).
Code:

procedure CurPageChanged(CurPageID: integer);
var
  I: Integer;
  CompFile: String;
begin
  //...
  if CurPageID = wpWelcome then
  begin
    //....
    #if UseComponents == "1"
    if ComponentsPageAvai then
    begin
      for I := 0 to GetArrayLength(CompIndexList) - 1 do
      begin
        CompFile := GetIniString('ComponentsSettings', 'Component' + IntToStr(CompIndexList[I]) + '.File', '', ExpandConstant('{tmp}\Settings.ini'));
        if (ExtractFileExt(CompFile) <> '') and (not FileExists(ExpandConstant('{src}\' + CompFile))) then
        begin
          ComponentsList.Checked[CompIndexList[I]] := False;
          ComponentsList.ItemEnabled[CompIndexList[I]] := False;
        end;
      end;
    end;
    #endif
  end;
  //...
  //...
end;


Perfect code. I just copied it to where it should, and it works. :p thank you

KaktoR 31-03-2019 05:45

I will add something for language in INI file.

HunterEmrah 31-03-2019 07:14

I tried something but could not give the correct size to "Main files" component, on components page first time size is right, but after clicking components it's resets.

what i changed in script.iss
Quote:

Code:

  I := 1;
  ComponentsSize := GetSizeBytes(GetIniString('Settings', 'Size', '0', IniFile));
  SetArrayLength(CompIndexList, 0);
  IniFile := ExpandConstant('{tmp}\Settings.ini');
  ComponentsPageAvai := GetIniBool('ComponentsSettings', 'Enable', False, IniFile);
  if ComponentsPageAvai then
  begin
    if IniKeyExists('ComponentsSettings', 'Component' + IntToStr(I) + '.Name', IniFile) then
    begin
      CompName := CustomMessage('CompMain'); //Main Files component
      ComponentsList.AddCheckBox(CompName, '', 0, True, False, True, True, nil);
    end;


Given size in Settings.ini
Quote:

Code:

[Settings]
Name=Tropico 6
Size=12.4 gb


I've uploaded a video for a better understanding.
https://streamable.com/wsa4j

Cesar82 31-03-2019 13:25

Quote:

Originally Posted by HunterEmrah (Post 480445)
I tried something but could not give the correct size to "Main files" component, on components page first time size is right, but after clicking components it's resets.

what i changed in script.iss


Given size in Settings.ini


I've uploaded a video for a better understanding.
https://streamable.com/wsa4j

Try this:
Leave as before the part you changed:
ComponentsSize:=0;

1. Then replace the original line (Line commented with //) with the line below in this part.
Code:

procedure ComponentsOnCheck(Sender: TObject);
var
  I: Integer;
begin
  ComponentsSize := 0;
  for I := 0 to GetArrayLength(CompIndexList) - 1 do
    if ComponentsList.Checked[CompIndexList[I]] then
      ComponentsSize := ComponentsSize + GetSizeBytes(GetIniString('ComponentsSettings', 'Component' + IntToStr(CompIndexList[I]) + '.Size', '0', ExpandConstant('{tmp}\Settings.ini')));
  //ComponentsDiskSpaceLabel.Caption := DiskSpaceMB(SetupMessage(msgComponentsDiskSpaceMBLabel), SizeBytesToMB(ComponentsSize, '', 0));
  ComponentsDiskSpaceLabel.Caption := DiskSpaceMB(SetupMessage(msgComponentsDiskSpaceMBLabel), SizeBytesToMB(ComponentsSize + GetSizeBytes(GetIniString('Settings', 'Size', '0', ExpandConstant('{tmp}\Settings.ini'))), '', 0));
end;

2/3. Then substitute the original line (Line commented with "//") by the line below (Required to replace 2 times in the script)
Code:

    //ComponentsDiskSpaceLabel.Caption := DiskSpaceMB(SetupMessage(msgComponentsDiskSpaceMBLabel), SizeBytesToMB(ComponentsSize, '', 0));
    ComponentsDiskSpaceLabel.Caption := DiskSpaceMB(SetupMessage(msgComponentsDiskSpaceMBLabel), SizeBytesToMB(ComponentsSize + GetSizeBytes(GetIniString('Settings', 'Size', '0', ExpandConstant('{tmp}\Settings.ini'))), '', 0));


KaktoR 01-04-2019 04:26

1 Attachment(s)
Code:

v7.1.3 Beta 1
_____________________________________________________
- Reworked Redist page
- Active language will be added to INIFile now
- Added file checks for components (thanks to Cesar82)


HunterEmrah 01-04-2019 08:24

1 Attachment(s)
Quote:

Originally Posted by KaktoR (Post 480450)
Code:

Active language will be added to INIFile now

Thank you for update, works well.

I think remaining time should fixed too. It's calculate time only for first archive. After unpacking first archive it shows "TIME_INFINITE"="Eternity" then "TIME_TEST"=""

KaktoR 01-04-2019 08:28

That's what I wrote somewhere on last pages. Time remaining only works with 1 archive. But it's corious that it is visible (it should not be visible if [Records2] exist in Records.ini).

HunterEmrah 01-04-2019 09:29

Quote:

Originally Posted by KaktoR (Post 480452)
Time remaining only works with 1 archive

okay then i will hide this lable.

Quote:

Originally Posted by KaktoR (Post 480450)
Active language will be added to INIFile now

I want to add something to this topic. Changing language like "English", "Russian" with steam games is ok, but not uplay and origin games. Because there should be "en-US", "ru-RU". I think this system needs a different solution. More advanced.

KaktoR 01-04-2019 10:09

I know and I don't know if it's even possible. I think this is too complex.

Titeuf 03-04-2019 02:14

Hello everyone,
I do not know if I make a mistake but in version 7.1.2 after installation in the directory of the game, there are these 2 files:
Quote:

Glossy.vsf & VclStylesInno.dll
While in previous versions, there were no such files!

How to make these 2 files not in the directory of the game once the installation finished?

thank you in advance

KaktoR 03-04-2019 02:34

1 Attachment(s)
Here is a fix for the Time Remaining label if more than one archive is extracted.

@Tifeuf: This files are neccessary for uninstall skin support.

Titeuf 03-04-2019 02:47

Quote:

Originally Posted by KaktoR (Post 480470)
Here is a fix for the Time Remaining label if more than one archive is extracted.

@Tifeuf: This files are neccessary for uninstall skin support.

Hello KaktoR,
Thank you for your answer actually if these 2 files are deleted, executing uninstall, it displays an error.
Thank you for your answer and your fixed!
Warmest regards

Titeuf 03-04-2019 02:58

KaktoR,
I just noticed something, if in the file setings.ini, I put this: "UnInstallFolder = _UnInstall" when I start the uninstallation it removes all the files but not the "main" directory of the game!
example: name of the main directory "Mygamehasme", all the files contained in it are delete but not the directory "Mygamehasme"
I hope you understand (Lol) sorry for my mediocre English
Thank you

KaktoR 03-04-2019 03:10

This happens if you open the _Uninstall folder in explorer.
If you go to the game folder (not the uninstall folder) the folder will be deleted.

I will look why this happens.

Titeuf 03-04-2019 03:13

Quote:

Originally Posted by KaktoR (Post 480473)
This happens if you open the _Uninstall folder in explorer.
If you go to the game folder (not the uninstall folder) the folder will be deleted.

I will look why this happens.

KaktoR,
Ok thank you for your information and in advance thank you for watching this.
Warmest regards

yasitha 12-04-2019 06:38

Bug Found in System Page

6GB GPUs Detect as 4GB
Maybe 8GB and 11GB cards detect as the same..
I don't have any 8GB or 11GB Cards,
if you guys have those cards,
check and report back.

also old ATI Cards detect as 0mb in Red color
It's like there's no GPU

KaktoR 12-04-2019 09:08

This is a bug in ISSysInfo library. Nothing I can do about it.

mausschieber 12-05-2019 10:17

ScriptVersion "7.1.3

Source: Resources\Decompressors\ISDone\French.ini
Source: Resources\Decompressors\ISDone\German.ini
Source: Resources\Decompressors\ISDone\Italian.ini
Source: Resources\Decompressors\ISDone\Spanish.ini
Source: Resources\Decompressors\ISDone\Polish.ini;
Source: Resources\Decompressors\ISDone\PortugueseBrazil.in i

not found the inis inst there

KaktoR 12-05-2019 10:45

Fixed.


All times are GMT -7. The time now is 08:41.

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