Numeric Comparison

For all your non-technical questions.
Post Reply
woreid
Posts: 6
Joined: Mon Mar 17, 2008 4:04 pm

Numeric Comparison

Post by woreid »

How can I do numeric comparisons? The Mathematics function doesn't work and the other operators do string compares.
CandiceJones
Posts: 904
Joined: Thu Dec 22, 2005 7:03 pm
Contact:

Post by CandiceJones »

Mathematics works, of course. If automatically does numeric comparisons when both parameters resolve to numeric values.
Candice Jones
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
woreid
Posts: 6
Joined: Mon Mar 17, 2008 4:04 pm

Post by woreid »

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?
CandiceJones
Posts: 904
Joined: Thu Dec 22, 2005 7:03 pm
Contact:

Post by CandiceJones »

There's a bug in your code :)

Var2 = Var1 + 5000

is wrong

$Var2$ = $Var1$ + 5000

is correct
Candice Jones
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
woreid
Posts: 6
Joined: Mon Mar 17, 2008 4:04 pm

Post by woreid »

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~
CandiceJones
Posts: 904
Joined: Thu Dec 22, 2005 7:03 pm
Contact:

Post by CandiceJones »

The value is an Int64 value which is creating the problem. We should have an update for this very soon!
Candice Jones
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
klavelle
Posts: 8
Joined: Tue Jul 01, 2008 2:04 pm

Fixed yet?

Post by klavelle »

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?
CandiceJones
Posts: 904
Joined: Thu Dec 22, 2005 7:03 pm
Contact:

Post by CandiceJones »

You should use If for that. Evaluate Expression performs logical operations on strings only.
Candice Jones
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
sdeschenes
Posts: 76
Joined: Wed Sep 12, 2007 3:34 pm

Post by sdeschenes »

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?
CandiceJones
Posts: 904
Joined: Thu Dec 22, 2005 7:03 pm
Contact:

Post by CandiceJones »

Yes, try with InstallAware 9.01.
Candice Jones
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Post Reply