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

Reply
 
Thread Tools Display Modes
  #1  
Old 21-02-2019, 14:23
ahmedwaill ahmedwaill is offline
Registered User
 
Join Date: Sep 2018
Location: Egypt
Posts: 25
Thanks: 4
Thanked 7 Times in 6 Posts
ahmedwaill is on a distinguished road
i got a question about variables in inno

hello, i've got a question i'm using the WPI script, but i wanted to add in the

Code:
[Setup]
UninstallDisplaySize={#Size2}
and i can easily define a variable and called it Size 2 with the number, it should be like the file size in MB×1024×1024
so can't i just make a variable to calculate it automatically ?
i got already a variable called
Size
that got the file size in MB, so i can't use it like
Code:
define Size2 "{#Size}*1024*1024"
or something like that ?!
thanks a lot.
Reply With Quote
Sponsored Links
  #2  
Old 21-02-2019, 14:47
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 3,582
Thanks: 942
Thanked 5,845 Times in 2,158 Posts
KaktoR is on a distinguished road
It would be better to write a function to do this math and then use the code for the function in UninstallDisplaySize
__________________
Haters gonna hate
Reply With Quote
  #3  
Old 21-02-2019, 15:01
ahmedwaill ahmedwaill is offline
Registered User
 
Join Date: Sep 2018
Location: Egypt
Posts: 25
Thanks: 4
Thanked 7 Times in 6 Posts
ahmedwaill is on a distinguished road
well u mean i define first a variable as longint, then do the calculations ?
but if that's how to goes how i can use it in the [Setup] section ? since that section is written before the [Code] section...
Reply With Quote
  #4  
Old 21-02-2019, 15:20
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 3,582
Thanks: 942
Thanked 5,845 Times in 2,158 Posts
KaktoR is on a distinguished road
Well you can use
Code:
UninstallDisplaySize={code:YourCodeName}
__________________
Haters gonna hate
Reply With Quote
  #5  
Old 21-02-2019, 15:37
ahmedwaill ahmedwaill is offline
Registered User
 
Join Date: Sep 2018
Location: Egypt
Posts: 25
Thanks: 4
Thanked 7 Times in 6 Posts
ahmedwaill is on a distinguished road
well i don't think that i can really do it since i'm not that experienced in codes stuff, can't you tell me how to do it ?
Code:
[Setup]
UninstallDisplaySize={code:Size2}
{Code}
var
Size2: Longint;
function UninstallSize
Size2={#Size}*1024*1024;
end;
something like that ?
PS in the code section i wrote it as {Code} cuz it will end the CODE box in the site... i know that it should be [ Code ]

Last edited by ahmedwaill; 22-02-2019 at 05:49.
Reply With Quote
  #6  
Old 21-02-2019, 17:30
JRD!'s Avatar
JRD! JRD! is offline
Registered User
 
Join Date: Sep 2015
Location: Matrix
Posts: 274
Thanks: 225
Thanked 591 Times in 168 Posts
JRD! is on a distinguished road
The UninstallDisplaySize section is limited to 2GB with Inno Setup 5.5.1
Code:
#define SizeInMB 2047 

[Setup]
UninstallDisplaySize={#SizeInMB * 1024 * 1024}
__________________
Practice makes perfect.
Reply With Quote
  #7  
Old 22-02-2019, 02:15
ahmedwaill ahmedwaill is offline
Registered User
 
Join Date: Sep 2018
Location: Egypt
Posts: 25
Thanks: 4
Thanked 7 Times in 6 Posts
ahmedwaill is on a distinguished road
Quote:
Originally Posted by JRD! View Post
The UninstallDisplaySize section is limited to 2GB with Inno Setup 5.5.1
Code:
#define SizeInMB 2047 

[Setup]
UninstallDisplaySize={#SizeInMB * 1024 * 1024}
alright , thanks a lot man
Reply With Quote
  #8  
Old 22-02-2019, 02:42
ahmedwaill ahmedwaill is offline
Registered User
 
Join Date: Sep 2018
Location: Egypt
Posts: 25
Thanks: 4
Thanked 7 Times in 6 Posts
ahmedwaill is on a distinguished road
well i get this error when i use it

EDIT: well it's cuz of the size i made for it 2048, but idk why it's maximum 2GB , and i managed to do it 5.6GB in the FMX Project by Razor , but when i made in the script.iss
Code:
[App]
Size2=6100234885
and in the wpi1801.engine that's included inside the script.iss
Code:
#define Size2 ReadIni(SourcePath	+ "\script.iss", "App", "Size2", "0")
[Setup]
UninstallDisplaySize={#Size2}
and it worked like that as you can see in the pic



Last Edit: well the issue is when it's passed to the Uninstall Display Size it goes as STR and it should be LONGINT, so what's the Convert to LONGINT Tag for Define tag ???

Last edited by ahmedwaill; 22-02-2019 at 05:26.
Reply With Quote
  #9  
Old 22-02-2019, 12:49
JRD!'s Avatar
JRD! JRD! is offline
Registered User
 
Join Date: Sep 2015
Location: Matrix
Posts: 274
Thanks: 225
Thanked 591 Times in 168 Posts
JRD! is on a distinguished road
Quote:
Originally Posted by ahmedwaill View Post
well i get this error when i use it

EDIT: well it's cuz of the size i made for it 2048, but idk why it's maximum 2GB , and i managed to do it 5.6GB in the FMX Project by Razor , but when i made in the script.iss
Code:
[App]
Size2=6100234885
and in the wpi1801.engine that's included inside the script.iss
Code:
#define Size2 ReadIni(SourcePath	+ "\script.iss", "App", "Size2", "0")
[Setup]
UninstallDisplaySize={#Size2}
and it worked like that as you can see in the pic

The Razor program writes the value itself into the registry.

Quote:
Last Edit: well the issue is when it's passed to the Uninstall Display Size it goes as STR and it should be LONGINT, so what's the Convert to LONGINT Tag for Define tag ???
The typecasting is automatic if you go through ISPP. What is the version of inno setup that you used in your project?
__________________
Practice makes perfect.
Reply With Quote
  #10  
Old 22-02-2019, 13:43
ahmedwaill ahmedwaill is offline
Registered User
 
Join Date: Sep 2018
Location: Egypt
Posts: 25
Thanks: 4
Thanked 7 Times in 6 Posts
ahmedwaill is on a distinguished road
5.5.1 Enhanced Edition build 121002
i managed to make it write the value i want but i have to calculate it myself so i write the exact value in bytes so it's not about having the maximum size 2GB, you can write whatever you want ...
but the values can't be auto calculated i guess for some reason, and i guess that it needs to be type Longint, not only Int ...
Reply With Quote
  #11  
Old 24-02-2019, 06:07
JRD!'s Avatar
JRD! JRD! is offline
Registered User
 
Join Date: Sep 2015
Location: Matrix
Posts: 274
Thanks: 225
Thanked 591 Times in 168 Posts
JRD! is on a distinguished road
Quote:
Originally Posted by ahmedwaill View Post
5.5.1 Enhanced Edition build 121002
i managed to make it write the value i want but i have to calculate it myself so i write the exact value in bytes so it's not about having the maximum size 2GB, you can write whatever you want ...
but the values can't be auto calculated i guess for some reason, and i guess that it needs to be type Longint, not only Int ...
1. The easiest way is not to go through UninstallDisplaySize, by default Inno setup write the value by calculating the weight of the files. (I do not know if it supports 2GB + or 4GB +)
2. The safest way is to create a small program or dll that writes the size of the game in the registry at the end.

Like this:
Code:
if bAllOK then
   SetGameSizeInRegisrty('5420m');
Regedit path:

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ GAMENAME_is1

Note:

The size is stored in a DWORD value (32BITS), but it is expressed in KB, so we can store values ​​up to 3.99TB
__________________
Practice makes perfect.
Reply With Quote
The Following User Says Thank You to JRD! For This Useful Post:
ahmedwaill (24-02-2019)
  #12  
Old 24-02-2019, 07:57
ahmedwaill ahmedwaill is offline
Registered User
 
Join Date: Sep 2018
Location: Egypt
Posts: 25
Thanks: 4
Thanked 7 Times in 6 Posts
ahmedwaill is on a distinguished road
well i got it to work with this way
Code:
UninstallDisplaySize= 2147483648
and got it to work like that too
Code:
ExtraDiskSpaceRequired= 2147483648
and those two displays 2GB, and i could make it more than that aswell, since u couldn't make it automatically calculated so i had to manually add the size in bytes so i guess the case is solved atm
thanks bro for your time and effort in trying to help me ..
as i said the issue is in the calculations itself.
Reply With Quote
  #13  
Old 25-02-2019, 10:51
JRD!'s Avatar
JRD! JRD! is offline
Registered User
 
Join Date: Sep 2015
Location: Matrix
Posts: 274
Thanks: 225
Thanked 591 Times in 168 Posts
JRD! is on a distinguished road
Sorry that I did not use Inno setup anymore, you can do it like this:

Code:
#define GameSize "42803" ; Size of game in MB;

[Setup]
UninstallDisplaySize="{#GameSize}000000"
__________________
Practice makes perfect.
Reply With Quote
  #14  
Old 26-02-2019, 08:19
ahmedwaill ahmedwaill is offline
Registered User
 
Join Date: Sep 2018
Location: Egypt
Posts: 25
Thanks: 4
Thanked 7 Times in 6 Posts
ahmedwaill is on a distinguished road
Quote:
Originally Posted by JRD! View Post
Sorry that I did not use Inno setup anymore, you can do it like this:

Code:
#define GameSize "42803" ; Size of game in MB;

[Setup]
UninstallDisplaySize="{#GameSize}000000"
wow interesting one, alright mate will try it once am free cuz am kinda busy today. thanks mate<3
Reply With Quote
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
INNO TROUBLESHOOT - Tutorials and Answers about INNO Setup REV0 Conversion Tutorials 129 21-05-2021 05:51
Useful Dll for Inno Setup users peterf1999 Conversion Tutorials 88 01-12-2017 16:00
Create Dll C++ in VS 2015 compatible with Inno Setup MCI Conversion Tutorials 14 08-09-2017 09:07
INNO TUTORIAL - Using Unicode and ANSI Versions of INNO Setup REV0 Conversion Tutorials 51 26-03-2015 06:57
One question with Inno Setup? quake4 PC Games - CD/DVD Conversions 3 22-08-2012 04:30



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


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