How to determine if variable has been defined or not?
Posted: Wed Feb 29, 2012 4:35 pm
How to determine if variable has been defined or not?
I've recently added a new variable (SYSTEMTYPE) to my setup and set it persistent (to remember when restarting). Everyting works great if installing on a new system or if installing on a system that had a newer installer (that had the new SYSTEMTYPE variable) previously ran on it.
The problem I'm seeing is when running the newer setups on a system that had a slightly older setup (any setup prior to adding new SYSTEMTYPE variable) previously ran on it.
I receive:
"Runtime error in setup script:
Line 13: Attempting to get value of undefined variable
SYSTEMTYPE"
And the setup fails.
I do want to find and use SYSTEMTYPE's value on newer systems but on older systems I just want to assign it a default value.
How can I do this? I've searched for "How can I check for a variable not defined ?" and found this post:
http://www.installaware.com/forum/viewt ... f=2&t=2329
But this didn't seem to work for me.
Is there an easy way to check if SYSTEMTYPE has been defined? If so, I'll use that value. If not, I'll assign some value.
Seems simple so I think I may be missing something...
Thanks in advance for any help!
I've recently added a new variable (SYSTEMTYPE) to my setup and set it persistent (to remember when restarting). Everyting works great if installing on a new system or if installing on a system that had a newer installer (that had the new SYSTEMTYPE variable) previously ran on it.
The problem I'm seeing is when running the newer setups on a system that had a slightly older setup (any setup prior to adding new SYSTEMTYPE variable) previously ran on it.
I receive:
"Runtime error in setup script:
Line 13: Attempting to get value of undefined variable
SYSTEMTYPE"
And the setup fails.
I do want to find and use SYSTEMTYPE's value on newer systems but on older systems I just want to assign it a default value.
How can I do this? I've searched for "How can I check for a variable not defined ?" and found this post:
http://www.installaware.com/forum/viewt ... f=2&t=2329
But this didn't seem to work for me.
Is there an easy way to check if SYSTEMTYPE has been defined? If so, I'll use that value. If not, I'll assign some value.
Seems simple so I think I may be missing something...
Thanks in advance for any help!