Problems with variables in evaluation install
Problems with variables in evaluation install
Hi,
I am using the eval version to try making a install that matches our current one made in Wise.
Problem 1:
I want to grab a parameter from the command line if specified or else use a default value set in the script using the following code:
if variable CMDLINEPARAM1 Is Defined
Set Variable ACTUALPARAM1 = CMDLINEPARAM1
else
Set Variable ACTUALPARAM1 = DefaultValue
end
However when I build I get the error "Variable not defined: CMDLINEPARAM1". Is this a bug or have I misunderstood the purpose of "Is defined"?
Problem 2:
When using the pre defined var GPOPATH I also get the "Variable not defined" error.
Question:
When using a rzCheckBox in the dialog designer is the only way to set the initial value from a script variable to use the "via label capton" workaround? Would have expected it to be possible to just use the variable as input just as for edits....
Best regards,
Lars Sondergaard
I am using the eval version to try making a install that matches our current one made in Wise.
Problem 1:
I want to grab a parameter from the command line if specified or else use a default value set in the script using the following code:
if variable CMDLINEPARAM1 Is Defined
Set Variable ACTUALPARAM1 = CMDLINEPARAM1
else
Set Variable ACTUALPARAM1 = DefaultValue
end
However when I build I get the error "Variable not defined: CMDLINEPARAM1". Is this a bug or have I misunderstood the purpose of "Is defined"?
Problem 2:
When using the pre defined var GPOPATH I also get the "Variable not defined" error.
Question:
When using a rzCheckBox in the dialog designer is the only way to set the initial value from a script variable to use the "via label capton" workaround? Would have expected it to be possible to just use the variable as input just as for edits....
Best regards,
Lars Sondergaard
Still looking for an answer
Any chance of having an answer to this before my eval period expires?
-
Alex_Ronquillo
- Site Admin
- Posts: 364
- Joined: Mon Jul 30, 2007 11:51 am
- Location: USA
- Contact:
LarsS,
actually checks whether CMDLINEPARAM1 variable has a value or not, not if it has been defined. You need to define every variable dereference in IA before building your project, otherwise you will get this error.
Code: Select all
if variable CMDLINEPARAM1 Is DefinedThat is really strange, make sure you are writing the right variable. GPOPATH is always defined.When using the pre defined var GPOPATH I also get the "Variable not defined" error.
If in your script, before the dialog with your rzCheckBox, you set the value of the variable you are using in the rzCheckBox to TRUE , its default value will be checked, and if you set it to FALSE it will be uncheckedWhen using a rzCheckBox in the dialog designer is the only way to set the initial value from a script variable to use the "via label capton" workaround? Would have expected it to be possible to just use the variable as input just as for edits....
Alejandro Ronquillo
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
Thanks for the answer. However I still have the problems:
1. If all variables must be defined with a "Set Variable" how is it then possible to find out IF a variable was specified on the commandline or not? If the user specified a variable on the command line using "Set variable" will clear that value.
Maybe I am asking the wrong way. What I want to do is use the value supplied on the commandline if present and if the commandline does not contain a value then use a value hardcoded in the script.
2. I created a new blank project and onyl added the following lines of script:
if Variable GPOPATH not Equals TesValue
MessageBox: Hello, Yes it works
end
This gives an error message "Variable not defined: GPOPATH".
Thanks for any help.
Best regards
Lars Sondergaard
1. If all variables must be defined with a "Set Variable" how is it then possible to find out IF a variable was specified on the commandline or not? If the user specified a variable on the command line using "Set variable" will clear that value.
Maybe I am asking the wrong way. What I want to do is use the value supplied on the commandline if present and if the commandline does not contain a value then use a value hardcoded in the script.
2. I created a new blank project and onyl added the following lines of script:
if Variable GPOPATH not Equals TesValue
MessageBox: Hello, Yes it works
end
This gives an error message "Variable not defined: GPOPATH".
Thanks for any help.
Best regards
Lars Sondergaard
-
Alex_Ronquillo
- Site Admin
- Posts: 364
- Joined: Mon Jul 30, 2007 11:51 am
- Location: USA
- Contact:
Do the following:What I want to do is use the value supplied on the commandline if present and if the commandline does not contain a value then use a value hardcoded in the script.
Code: Select all
if Variable CMDLINE Contains (Ignore Case) CMDLINEPARAM1=
Comment: Use the value of CMDLINEPARAM1 directly
else
Set Variable CMDLINEPARAM1 to Default Value
endYou are right, try the following instead:I created a new blank project and onyl added the following lines of script:
if Variable GPOPATH not Equals TesValue
MessageBox: Hello, Yes it works
end
This gives an error message "Variable not defined: GPOPATH".
Code: Select all
Set Variable GPOPATHVAR to $GPOPATH$
if Variable GPOPATHVAR not Equals TesValue
MessageBox: Hello, Yes it works
endAlejandro Ronquillo
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
Re: Problems with variables in evaluation install
I have the same problem with GPOPATH, it was in 9.0 and is still there in 9.0 R2. - The compiler fails when using "IF GPOPATH".
The workaround works, though.
The workaround works, though.
-
MichaelNesmith
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
Re: Problems with variables in evaluation install
If has a new "Is Variable Defined" query now, actually. So you don't need to rely on the workaround and can test directly.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Re: Problems with variables in evaluation install
The problem is not with the actual check. The problem is that the compiler fails with the message "Variable not defined: GPOPATH" on this line:
Changing it to makes no difference. The compiler still fails.
Changing the code to this works (the workaround suggested by Alex_Ronquillo):
Code: Select all
If Variable GPOPATH not Equals NULLCode: Select all
if Variable GPOPATH is DefinedChanging the code to this works (the workaround suggested by Alex_Ronquillo):
Code: Select all
Set Variable GPOPATHVAR to $GPOPATH$
if Variable GPOPATHVAR not Equals NULL
-
MichaelNesmith
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
Re: Problems with variables in evaluation install
The compiler should not choke on an "Is Variable Defined" query. I was able to reproduce this easily and have escalated it to R&D. Thanks!
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
-
MichaelNesmith
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
Re: Problems with variables in evaluation install
Also, here is a useful codeform:
This lets you easily sniff custom parameters from the command line and insert them into properly defined variables.
Code: Select all
if Variable CMDLINE Contains (Ignore Case) VARTOTEST
Set Variable VARTOTEST to $VARTOTEST$
endMichael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/

