Numeric Comparison

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

Numeric Comparison

Postby woreid » Fri May 09, 2008 12:27 pm

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:

Postby CandiceJones » Sat May 10, 2008 5:34 am

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/

woreid
Posts: 6
Joined: Mon Mar 17, 2008 4:04 pm

Postby woreid » Mon May 12, 2008 6:54 am

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:

Postby CandiceJones » Mon May 12, 2008 9:04 am

There's a bug in your code :)

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/

woreid
Posts: 6
Joined: Mon Mar 17, 2008 4:04 pm

Postby woreid » Mon May 12, 2008 10:03 am

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:

Postby CandiceJones » Mon May 12, 2008 4:42 pm

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/

klavelle
Posts: 8
Joined: Tue Jul 01, 2008 2:04 pm

Fixed yet?

Postby klavelle » Thu Jul 10, 2008 2:33 pm

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:

Postby CandiceJones » Thu Jul 10, 2008 7:27 pm

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/

sdeschenes
Posts: 76
Joined: Wed Sep 12, 2007 3:34 pm

Postby sdeschenes » Tue May 19, 2009 12:08 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?

CandiceJones
Posts: 904
Joined: Thu Dec 22, 2005 7:03 pm
Contact:

Postby CandiceJones » Tue May 19, 2009 5:02 pm

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/


Return to “Non-Technical”

Who is online

Users browsing this forum: No registered users and 35 guests