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

Reply
 
Thread Tools Display Modes
  #676  
Old 22-03-2019, 04:53
Schabik Schabik is offline
Registered User
 
Join Date: Dec 2008
Location: Somewhere in Poland
Posts: 133
Thanks: 15
Thanked 33 Times in 30 Posts
Schabik is on a distinguished road
Ok, sory @bubobih for the "out of the blue" question for @KaktoR but.


@KaktoR can You tell me what I must add to Your script if I want to check if the component was selected or not and components are checked ("=1") in the settings.ini



For example I want to check if Components are enabled in settings.ini and Polish language was selected (As Components name I'll use cm:PL) can I check if it is selected by adding something like this:

Code:
 if ({#UseComponents} = 1) and (IsComponentSelected(GetIniString('ComponentsSettings', 'Component' + IntToStr(CompIndexList[I])+ '.Name' = 'cm:PL')) then
      begin

Of course I know the code above is wrong and It won't work but with some adjustments I'm sure it would.
Reply With Quote
Sponsored Links
  #677  
Old 22-03-2019, 06:07
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 2,612
Thanks: 658
Thanked 3,789 Times in 1,365 Posts
KaktoR is on a distinguished road
I think I don't understand your question right.

If you select a cmomponent in installer, it will be extracted. If it is not selected, installer will not extract it.
__________________
Haters gonna hate
RIP GOD
Reply With Quote
The Following User Says Thank You to KaktoR For This Useful Post:
Titeuf (22-03-2019)
  #678  
Old 22-03-2019, 07:10
Schabik Schabik is offline
Registered User
 
Join Date: Dec 2008
Location: Somewhere in Poland
Posts: 133
Thanks: 15
Thanked 33 Times in 30 Posts
Schabik is on a distinguished road
Quote:
Originally Posted by KaktoR View Post
I think I don't understand your question right.

If you select a cmomponent in installer, it will be extracted. If it is not selected, installer will not extract it.
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.

Last edited by Schabik; 22-03-2019 at 07:13.
Reply With Quote
The Following User Says Thank You to Schabik For This Useful Post:
KaktoR (22-03-2019)
  #679  
Old 22-03-2019, 14:57
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 2,612
Thanks: 658
Thanked 3,789 Times in 1,365 Posts
KaktoR is on a distinguished road
Ok now I understand.

I will look.
__________________
Haters gonna hate
RIP GOD
Reply With Quote
  #680  
Old 22-03-2019, 22:09
Schabik Schabik is offline
Registered User
 
Join Date: Dec 2008
Location: Somewhere in Poland
Posts: 133
Thanks: 15
Thanked 33 Times in 30 Posts
Schabik is on a distinguished road
Quote:
Originally Posted by KaktoR View Post
Ok now I understand.

I will look.
Thanks 😊
Reply With Quote
  #681  
Old 23-03-2019, 19:41
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 212
Thanks: 251
Thanked 407 Times in 110 Posts
Cesar82 is on a distinguished road
ASIS - Valid Component

Quote:
Originally Posted by Schabik View Post
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);
Attached Files
File Type: 7z 7.1.2.beta8.FIX (Valid Components).7z (21.2 KB, 7 views)

Last edited by Cesar82; 24-03-2019 at 16:29.
Reply With Quote
The Following 4 Users Say Thank You to Cesar82 For This Useful Post:
KaktoR (24-03-2019), mausschieber (24-03-2019), pakrat2k2 (24-03-2019), Titeuf (24-03-2019)
  #682  
Old 24-03-2019, 09:45
Schabik Schabik is offline
Registered User
 
Join Date: Dec 2008
Location: Somewhere in Poland
Posts: 133
Thanks: 15
Thanked 33 Times in 30 Posts
Schabik is on a distinguished road
Quote:
Originally Posted by Cesar82 View Post
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?
Reply With Quote
  #683  
Old 24-03-2019, 09:54
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 2,612
Thanks: 658
Thanked 3,789 Times in 1,365 Posts
KaktoR is on a distinguished road
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.
__________________
Haters gonna hate
RIP GOD
Reply With Quote
  #684  
Old 24-03-2019, 11:35
Schabik Schabik is offline
Registered User
 
Join Date: Dec 2008
Location: Somewhere in Poland
Posts: 133
Thanks: 15
Thanked 33 Times in 30 Posts
Schabik is on a distinguished road
Quote:
Originally Posted by KaktoR View Post
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.
2019-03-25_09h12_11.png


I'm attaching my script.
Attached Files
File Type: 7z Script712b9.7z (23.2 KB, 5 views)

Last edited by Schabik; 25-03-2019 at 00:15.
Reply With Quote
The Following User Says Thank You to Schabik For This Useful Post:
Titeuf (25-03-2019)
  #685  
Old 25-03-2019, 01:58
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 212
Thanks: 251
Thanked 407 Times in 110 Posts
Cesar82 is on a distinguished road
Quote:
Originally Posted by Schabik View Post
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
Attached Files
File Type: 7z Simplification_Path_Code.7z (971 Bytes, 1 views)

Last edited by Cesar82; 25-03-2019 at 02:23.
Reply With Quote
The Following User Says Thank You to Cesar82 For This Useful Post:
Titeuf (25-03-2019)
  #686  
Old 25-03-2019, 02:13
Schabik Schabik is offline
Registered User
 
Join Date: Dec 2008
Location: Somewhere in Poland
Posts: 133
Thanks: 15
Thanked 33 Times in 30 Posts
Schabik is on a distinguished road
Quote:
Originally Posted by Cesar82 View Post
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

Last edited by Schabik; 25-03-2019 at 02:18.
Reply With Quote
  #687  
Old 25-03-2019, 02:28
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 212
Thanks: 251
Thanked 407 Times in 110 Posts
Cesar82 is on a distinguished road
Quote:
Originally Posted by Schabik View Post
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;
Reply With Quote
  #688  
Old 25-03-2019, 03:24
Schabik Schabik is offline
Registered User
 
Join Date: Dec 2008
Location: Somewhere in Poland
Posts: 133
Thanks: 15
Thanked 33 Times in 30 Posts
Schabik is on a distinguished road
Quote:
Originally Posted by Cesar82 View Post
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:


2019-03-25_14h14_37.png


and on 150% does this:


2019-03-25_14h15_52.png

Last edited by Schabik; 25-03-2019 at 05:17.
Reply With Quote
The Following User Says Thank You to Schabik For This Useful Post:
Cesar82 (25-03-2019)
  #689  
Old 25-03-2019, 07:40
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 2,612
Thanks: 658
Thanked 3,789 Times in 1,365 Posts
KaktoR is on a distinguished road
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
__________________
Haters gonna hate
RIP GOD
Reply With Quote
  #690  
Old 25-03-2019, 07:41
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 212
Thanks: 251
Thanked 407 Times in 110 Posts
Cesar82 is on a distinguished road
Quote:
Originally Posted by Schabik View Post
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.
Reply With Quote
The Following User Says Thank You to Cesar82 For This Useful Post:
Titeuf (25-03-2019)
Reply

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
Simple Arc Installer 78372 Conversion Tutorials 1 15-06-2017 15:37
INDEX - Conversion Tutorial Index Razor12911 Conversion Tutorials 7 01-10-2016 16:28
[Help] need Advanced Installer script with Razor1911's UltraArc module rez3vil Conversion Tutorials 1 29-09-2016 04:10
MSC+Srep+lzma Simple Script Example gozarck Conversion Tutorials 10 07-09-2015 16:31
Portable Installer Inno Setup Script y_thelastknight Conversion Tutorials 57 04-06-2015 23:43



All times are GMT -7. The time now is 04:27.


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