cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
doors666
Level 3

determine if an options file is passed as an argument

Hi,

I need to determine if an options file is passed as an argument to the installer or not. How do I achieve this.

Thanx,
Vikas
Labels (1)
0 Kudos
(3) Replies
enanrum
Level 9

Can you be more specific as to why you need this info? May be easier to help you out! If I were to guess, is it because you are setting default values for Variables and when they use an options file, the values in the options file do not get used!

If you are defaulting values in the Events section OnBeginInstall those will always be used! You may want to remove all your default variable settings from the events and add them to the Property Manager and default the values there! Whatever values that are in the options file will be used and the variables they do not put in the options file will still be defaulted!

Hope this is what your looking for!

Regards,
Tom
0 Kudos
doors666
Level 3

Thanks for the reply Tom. What you said is correct, I am setting default values for the variables and when I use the options file, the values in the options file dont get used.

This project is migrated from ISMP 5.03. We are not using the events etc. What I want to do is to write a custom bean which will detect if an options file was supplied or not and set a variable to indicate that. Then I will use a string comparison condition for the sequence where I am setting the default values.

I already have the code in place where I detect the silent mode and do the same thing, but the issue is that the user might use the options file without going into the silent mode and in that case, it fails.

Thanx,
Vikas


enanrum wrote:
Can you be more specific as to why you need this info? May be easier to help you out! If I were to guess, is it because you are setting default values for Variables and when they use an options file, the values in the options file do not get used!

If you are defaulting values in the Events section OnBeginInstall those will always be used! You may want to remove all your default variable settings from the events and add them to the Property Manager and default the values there! Whatever values that are in the options file will be used and the variables they do not put in the options file will still be defaulted!

Hope this is what your looking for!

Regards,
Tom
0 Kudos
enanrum
Level 9

Hmmm...I'm not aware of any way to know if the options file is passed, (I'm sure there is), but like I said before it maybe easier to just add all the variables and default them to what you want in the 'Additional Tools'->'Property Manager' (PM) and if they pass an options file - the vars in the options file is used first!

Also - if you do the way you want to - what happens if they only set 2 variables and you have 15? Using the PM those 2 will be updated and the other 13 will still have it's default values! Doing it your way you will have to check each var to make sure it has a valid value! (Just keep that in mind)

You can even use variables for the Value in the PM!
Name -> Value
VAR1 -> path
VAR2 -> $V(VAR1)/file ==> resolve to path/file

I just think this is easier than adding a Custom Action to set the vars!
Good luck in whatever you chose!

Regards,
Tom
0 Kudos