Using variable in Get Free Space?

Got a problem you cannot solve? Try here.
ttcn2k4
Posts: 31
Joined: Wed Feb 01, 2012 10:04 am

Using variable in Get Free Space?

Postby ttcn2k4 » Tue Feb 28, 2012 1:26 pm

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

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Using variable in Get Free Space?

Postby FrancescoT » Wed Feb 29, 2012 6:16 am

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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

ttcn2k4
Posts: 31
Joined: Wed Feb 01, 2012 10:04 am

Re: Using variable in Get Free Space?

Postby ttcn2k4 » Thu Mar 01, 2012 8:07 am

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

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Using variable in Get Free Space?

Postby FrancescoT » Thu Mar 01, 2012 8:30 am

No problem! :D
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

Ohmylord
Posts: 23
Joined: Wed Jan 23, 2013 10:19 am

Re: Using variable in Get Free Space?

Postby Ohmylord » Fri Nov 22, 2024 4:38 pm

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~

JohnGaver
Posts: 147
Joined: Mon Feb 05, 2024 6:15 pm

Re: Using variable in Get Free Space?

Postby JohnGaver » Sat Nov 23, 2024 6:07 pm

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.
John Gaver
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 26 guests