Referencing two pre-defined variables...

Got a problem you cannot solve? Try here.
Post Reply
CFConner
Posts: 85
Joined: Wed Jan 21, 2009 4:14 pm
Location: Syracuse, NY

Referencing two pre-defined variables...

Post 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
mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: Referencing two pre-defined variables...

Post by mills »

Try EXEDIR.
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
CFConner
Posts: 85
Joined: Wed Jan 21, 2009 4:14 pm
Location: Syracuse, NY

Re: Referencing two pre-defined variables...

Post 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
mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: Referencing two pre-defined variables...

Post 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)
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
CFConner
Posts: 85
Joined: Wed Jan 21, 2009 4:14 pm
Location: Syracuse, NY

Re: Referencing two pre-defined variables...

Post 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
Post Reply