Page 1 of 1
Referencing two pre-defined variables...
Posted: Mon Sep 20, 2010 2:04 pm
by CFConner
I am trying to reference the EXEPATH and GPOPATH information in my MSICODE. Namely, I want to know if they are populated. However, when I try to make a single file - I get an error:
Compile Error: Variable not defined: EXEPATH
Here's my MSIcode:
Code: Select all
if Variable EXEPATH Contains (Ignore Case) Set Variable MSPATHTOSEARCH TO $EXEPATH$
end
if Variable GPOPATH Contains (Ignore Case) Set Variable MSTPATHTOSEARCH to $GPOPATH$
end
By the way, if anyone didn't notice *cough* *cough* I was not sure how to test if these pre-defined variables are populated so I had it search for the slash character.

(cheesey, I know)
=-Chris
Re: Referencing two pre-defined variables...
Posted: Mon Sep 20, 2010 6:00 pm
by mills
Try EXEDIR.
Re: Referencing two pre-defined variables...
Posted: Mon Sep 20, 2010 8:34 pm
by CFConner
It turns out this is a bug (or perhaps not - but here's the workaround)
Normally, the predefined variables such as GPOPATH can be used in say a messagebox: This is the path: $GPOPATH$
However, I have found that when using the "if" command, the predefined variables cannot be dereferenced, at least not directly. Instead, I had to do the following:
Code: Select all
Set Variable GPOPathInfo to $GPOPATH$
if Variable GPOPathInfo Contains (Ignore Case) ...
...
whereas this does not work:
Code: Select all
if Variable GPOPATH Contains (Ignore Case)
(you get the compiler error GPOPATH not defined.
I hope this helps someone else if they run into this problem.
=-Chris
Re: Referencing two pre-defined variables...
Posted: Mon Sep 20, 2010 8:40 pm
by mills
What version of InstallAware are you using?
I couldn't reproduce this on R2 SP3...
I tried:
if equals
if contains
if contains (ignore case)
Re: Referencing two pre-defined variables...
Posted: Mon Sep 20, 2010 9:29 pm
by CFConner
Andy, I'm using 9 R2 SP2
I just finished the download of SP3 just now. But I can't extract it because I don't have the password yet! ARRGH! Bloody automated emails.

If you have it, can you send it to me tonight?
=-Chris