Page 1 of 1

Using variable in Get Free Space?

Posted: Tue Feb 28, 2012 1:26 pm
by ttcn2k4
Hi:

I want to check the free disk space on the System Drive, but look like the "Check Disk Space" doesn't accept any variable in Disk Path field. I always get 0. The hard coding in the disk path works fine.

Is there any way that I can perform the check using variable?

Thanks
Nhan

Re: Using variable in Get Free Space?

Posted: Wed Feb 29, 2012 6:16 am
by FrancescoT
Dear Nhan,

are you sure that you are correctly dereferencing the variable you may want to use, in this way: $VARNAME$?

Set Variable MYDISK to C:
Set Variable MYDISKSPACE to 0
Get Free Space on $MYDISK$ into variable MYDISKSPACE

Regards

Re: Using variable in Get Free Space?

Posted: Thu Mar 01, 2012 8:07 am
by ttcn2k4
Hi Francesco:

It's my bad. I didn't hard code the drive letter in a variable. I get it from Windows environment variable and I made mistake by wrapping the variable in %% in IA command.

Thanks
Nhan

Re: Using variable in Get Free Space?

Posted: Thu Mar 01, 2012 8:30 am
by FrancescoT
No problem! :D

Re: Using variable in Get Free Space?

Posted: Fri Nov 22, 2024 4:38 pm
by Ohmylord
I'm having an issue with the free space check.

It works in most cases but we have 2 computers with plenty of space where it fails. in one computer $DISKSPACE$ is: 193022922752. The other one that fails has: 127458758656. They are both under 200GB but the check is for 20GB (21474836480)

After the message box it says there isn't enough space. See anything I did wrong?

~InstallAware Clipboard Data~
~End~
~{754B80BE-AED9-4133-9084-AFF87E9D4114}~
~End~
~{ABB09760-9480-4828-9A91-2A6B4BEAC841}~
~Else~
~{B8C62BD6-1434-460A-9738-0B7EA1ECCE07}~
~Terminate Install~
~{3484A0D6-A3F5-45F7-BA40-A96E16A8A3EB}~
~If~
~{6BD013FB-BEEF-4BBF-BDD4-74F578B9665D}~
~DISKSPACEWARNING~
~0~
~NO~
~FALSE~
~MessageBox~
~{CBEC975A-D939-4ACB-8232-95522CAEFB52}~
~Not Enough Disk Space~
~The setup requires at least 20GB of free disk space. $NEWLINE$$NEWLINE$You can press Yes to continue if you choose Personalized setup and install the Images on a secondary drive. $NEWLINE$$NEWLINE$Or, press No to cancel the installation. ~
~1~
~4~
~DISKSPACEWARNING~
~If~
~{331C1D0E-90E7-4A94-877B-AA7E6BBDA832}~
~DISKSPACE~
~2~
~$20GB$~
~TRUE~
~MessageBox~
~{1221A00B-7B4D-454D-A3EA-E2A49D2C0529}~
~DISK SPACE~
~$DISKSPACE$$NEWLINE$$NEWLINE$Compares with 20GB:$NEWLINE$$20GB$~
~0~
~1~
~~
~Set Variable~
~{D7ED7B5A-A1A4-45DB-9101-41AE6ED2C781}~
~20GB$MYAH$MYAH$FALSE~
~21474836480~
~Check Disk Space~
~{3AB40F9F-AD0C-492B-B6F4-D7AE051610EF}~
~DISKSPACE~
~$CDRIVE$~
~TRUE~
~FALSE~

Re: Using variable in Get Free Space?

Posted: Sat Nov 23, 2024 6:07 pm
by JohnGaver
This topic applies to InstallAware Multi Platform as well.

Thanks for the report.

Seems like a classic Integer overflow as I wasn't able to reproduce it with my actual free disk space, but it reproduced with both of the values you generously provided.

Escalated for a fix. My hunch is they're using 32 bit integers for If comparisons, instead of 64 bit integers.