Numeric Comparison
Numeric Comparison
How can I do numeric comparisons? The Mathematics function doesn't work and the other operators do string compares.
-
- Posts: 904
- Joined: Thu Dec 22, 2005 7:03 pm
- Contact:
Mathematics works, of course. If automatically does numeric comparisons when both parameters resolve to numeric values.
Candice Jones
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
No. Mathematics does not work for me.
~InstallAware Clipboard Data~
~Comment~
~{BA079DA4-72C8-4D70-B425-DDA21BF4C856}~
~~
~Terminate Install~
~{76C49C8E-9653-43AF-A9A4-CC0C8B7573EB}~
~MessageBox~
~{69B7211B-4D05-41E9-B1FE-38AD1FBCB108}~
~~
~$Var2$~
~0~
~1~
~~
~Mathematics~
~{EC052B3B-00D3-4F9D-9DFF-91CB50DD0048}~
~Var1~
~5000~
~0~
~Var2~
~Set Variable~
~{296E37AA-DDDB-48E1-A984-396B137146FA}~
~Var2$MYAH$MYAH$FALSE~
~0~
~Set Variable~
~{60CE1C91-A955-4B3A-AE2D-63DDA9590F6F}~
~Var1$MYAH$MYAH$FALSE~
~10000~
That simple program gives me an empty string. Now what?
~InstallAware Clipboard Data~
~Comment~
~{BA079DA4-72C8-4D70-B425-DDA21BF4C856}~
~~
~Terminate Install~
~{76C49C8E-9653-43AF-A9A4-CC0C8B7573EB}~
~MessageBox~
~{69B7211B-4D05-41E9-B1FE-38AD1FBCB108}~
~~
~$Var2$~
~0~
~1~
~~
~Mathematics~
~{EC052B3B-00D3-4F9D-9DFF-91CB50DD0048}~
~Var1~
~5000~
~0~
~Var2~
~Set Variable~
~{296E37AA-DDDB-48E1-A984-396B137146FA}~
~Var2$MYAH$MYAH$FALSE~
~0~
~Set Variable~
~{60CE1C91-A955-4B3A-AE2D-63DDA9590F6F}~
~Var1$MYAH$MYAH$FALSE~
~10000~
That simple program gives me an empty string. Now what?
-
- Posts: 904
- Joined: Thu Dec 22, 2005 7:03 pm
- Contact:
There's a bug in your code
Var2 = Var1 + 5000
is wrong
$Var2$ = $Var1$ + 5000
is correct

Var2 = Var1 + 5000
is wrong
$Var2$ = $Var1$ + 5000
is correct
Candice Jones
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
OK. That works, but this doesn't. Checking disk space was how this all started for me.
~InstallAware Clipboard Data~
~Terminate Install~
~{76C49C8E-9653-43AF-A9A4-CC0C8B7573EB}~
~MessageBox~
~{69B7211B-4D05-41E9-B1FE-38AD1FBCB108}~
~~
~$Var2$~
~0~
~1~
~~
~Mathematics~
~{EC052B3B-00D3-4F9D-9DFF-91CB50DD0048}~
~$Var1$~
~5000~
~0~
~Var2~
~Set Variable~
~{296E37AA-DDDB-48E1-A984-396B137146FA}~
~Var2$MYAH$MYAH$FALSE~
~0~
~Check Disk Space~
~{55EA3C8C-4A58-470C-BD9D-FA80B2A4F975}~
~Var1~
~c:\\~
~TRUE~
~FALSE~
~Set Variable~
~{AADCFFC9-ADBF-4A9E-AF31-16CAD8562016}~
~Var1$MYAH$MYAH$FALSE~
~0~

~InstallAware Clipboard Data~
~Terminate Install~
~{76C49C8E-9653-43AF-A9A4-CC0C8B7573EB}~
~MessageBox~
~{69B7211B-4D05-41E9-B1FE-38AD1FBCB108}~
~~
~$Var2$~
~0~
~1~
~~
~Mathematics~
~{EC052B3B-00D3-4F9D-9DFF-91CB50DD0048}~
~$Var1$~
~5000~
~0~
~Var2~
~Set Variable~
~{296E37AA-DDDB-48E1-A984-396B137146FA}~
~Var2$MYAH$MYAH$FALSE~
~0~
~Check Disk Space~
~{55EA3C8C-4A58-470C-BD9D-FA80B2A4F975}~
~Var1~
~c:\\~
~TRUE~
~FALSE~
~Set Variable~
~{AADCFFC9-ADBF-4A9E-AF31-16CAD8562016}~
~Var1$MYAH$MYAH$FALSE~
~0~
-
- Posts: 904
- Joined: Thu Dec 22, 2005 7:03 pm
- Contact:
The value is an Int64 value which is creating the problem. We should have an update for this very soon!
Candice Jones
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
Fixed yet?
Is this bug fixed yet?
This still fails:
Get Free Space on C:\\ into variable availDiskSpace
Set Variable reqSpace to 2048000000
Evaluate Expression $availDiskSpace$ >= $reqSpace$ into variable diskSpace
diskSpace will be false, where it should return true ($availDiskSpace$ while running this is well over 2 GB).
Is there any other way to check for free disk space?
This still fails:
Get Free Space on C:\\ into variable availDiskSpace
Set Variable reqSpace to 2048000000
Evaluate Expression $availDiskSpace$ >= $reqSpace$ into variable diskSpace
diskSpace will be false, where it should return true ($availDiskSpace$ while running this is well over 2 GB).
Is there any other way to check for free disk space?
-
- Posts: 904
- Joined: Thu Dec 22, 2005 7:03 pm
- Contact:
You should use If for that. Evaluate Expression performs logical operations on strings only.
Candice Jones
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
-
- Posts: 76
- Joined: Wed Sep 12, 2007 3:34 pm
I am trying to perform the same operation as Klavelle. I have tried using the Evaluate Expression command, the Eval command provided by the Camelot plug-in and I have used the standard If statement. I have varA set to 1978 and varB set to 16327196672. When I check to see if varA is greater than varB, the Evaluate Expression and Eval commands return True and the if statement also returns true.
You mentioned that the value is an Int64 value. Did you ever get a fix for this?
You mentioned that the value is an Int64 value. Did you ever get a fix for this?
-
- Posts: 904
- Joined: Thu Dec 22, 2005 7:03 pm
- Contact:
Yes, try with InstallAware 9.01.
Candice Jones
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
Who is online
Users browsing this forum: No registered users and 93 guests