PDA

View Full Version : Helping setting $USER_MAGIC_FOLDER_1$ in console installer for 8.0.1 Enterprise



Ssekar1
04-15-2009, 08:02 PM
Hi,

I'm trying to create a console installer and have to set a location for $USER_MAGIC_FOLDER_1$ . On console side, I added a Console:Get User Input panel and asked for the location and set it to $USER_MAGIC_FOLDER_1$ and when the installer runs, the new folder is not created/installed. So I changed the variable name to something else and used the SetInstallAnywhere variable, Single variable to set $USER_MAGIC_FOLDER_1$ to the new variable. Again, no success. I'm hoping that someone has done this successfully and will let me know how.

When I do the first step (i.e., setting the install folder directly to $USER_MAGIC_FOLDER_1$) for a GUI installer, it works correctly.

Thanks in advance,

Sarat..

pv7721
04-16-2009, 01:28 AM
Would it be possible for you to post your project?

Ssekar1
04-16-2009, 05:12 PM
Not sure what you mean by project. I'm attaching a scaled down version of my install script (the .xml file) that reproduces the behavior.

ShortTest_1 is where I use the Set InstallAnywhere Variable -> Single Variable panel to set the value for the magic folder and ShortTest_2 is where the panel result variable is set to the magic folder.

Both install scripts are identical except for this. Both scripts contains panels for both the GUI and Console installers. The GUI part works fine in Linux but the Console does not.

Any help you can provide is greatly appreciated and if you need anything more from me, let me know.

Sarat..


Would it be possible for you to post your project?

pv7721
04-17-2009, 02:52 AM
I think it should work what you've done, at least in theory. As it doesn't in practice I think you need to use the Debug Output task and have the IA variables written in different files at different stages of the installation. This most likely will show that maybe an IA variable is not set to what you think it should have been set.

Ssekar1
04-17-2009, 08:42 PM
Thanks.

I did what you suggested and put the Output Debug panels in my install scripts. I think I see where the problem is. When I run the GUI installer, the debug says

USER_MAGIC_FOLDER_1=/home/lshen/Sarat/xxx

However, when I run the console installer it says

USER_MAGIC_FOLDER_1="/home/lshen/Sarat/xxx"
USER_MAGIC_FOLDER_1_1=/home/lshen/Sarat/xxx

So it looks like the Console installer (or rather the Get User Input panel for console panel) is putting a double quote around the result and creating a new variable (re. USER_MAGIC_FOLDER_1_1).

So what would be the best way to get around this? As far as I can see, there seems to be two ways:
a) write a custom code that removes the double quotes and resets the USER_MAGIC_FOLDER_1; or
b) set the USER_MAGIC_FOLDER_1 to USER_MAGIC_FOLDER_1_1 if the latter is not null. This brings my next question, which is, how do I check that is non-null? I suppose that I can always check to see if USER_MAGIC_FOLDER_1 has a " in it and if so, use the Set InstallAnywhere variable panel to set it to USER_MAGIC_FOLDER_1_1 .

Am I on the right track and are there any other ways of doing this (hopefully something simple and more elegant)?

Thanks in advance,

Sarat..


I think it should work what you've done, at least in theory. As it doesn't in practice I think you need to use the Debug Output task and have the IA variables written in different files at different stages of the installation. This most likely will show that maybe an IA variable is not set to what you think it should have been set.

pv7721
04-18-2009, 03:00 AM
Ok, sorry for not realizing earlier this was the issue. After digging a little, it has been reported from time to time: http://community.acresso.com/showthread.php?t=184577&highlight=double+quotes

But after all, it seems to be by design (i.e. adding double quotes in console mode): http://community.zerog.com/cgi-bin/ikonboard.cgi?act=ST;f=14;t=4547 and there is a more than 4 years old feature request for not adding quotes in console mode: http://community.zerog.com/cgi-bin/ikonboard.cgi?s=49e96d4b5424ffff;act=ST;f=15;t=5189;hl=double+and+quotes

What you can do in order not to use custom code? As you said, you can test if the $USER_MAGIC_FOLDER_1_1$ is not null by testing it against the standard IA variable $NULL$ or you can test if you're in console mode by having as a very first action a variable $IS_CONSOLE$ which is set to true if $INSTALLER_UI$ equals console or CONSOLE. This way you can set the $USER_MAGIC_FOLDER_1$ directly to correct variable based on the test if you're in console mode or not.

Ssekar1
04-20-2009, 01:02 PM
Thanks, Vlad.

It works now. I kept the result variable as $USER_MAGIC_FOLDER_1$ for the console input panel and added an Set InstallAnywhere Variable panel that set it to $USER_MAGIC_FOLDER_1_1$ if the installer ui is console.

Again, thanks for your help.

Sarat..


Ok, sorry for not realizing earlier this was the issue. After digging a little, it has been reported from time to time: http://community.acresso.com/showthread.php?t=184577&highlight=double+quotes

But after all, it seems to be by design (i.e. adding double quotes in console mode): http://community.zerog.com/cgi-bin/ikonboard.cgi?act=ST;f=14;t=4547 and there is a more than 4 years old feature request for not adding quotes in console mode: http://community.zerog.com/cgi-bin/ikonboard.cgi?s=49e96d4b5424ffff;act=ST;f=15;t=5189;hl=double+and+quotes

What you can do in order not to use custom code? As you said, you can test if the $USER_MAGIC_FOLDER_1_1$ is not null by testing it against the standard IA variable $NULL$ or you can test if you're in console mode by having as a very first action a variable $IS_CONSOLE$ which is set to true if $INSTALLER_UI$ equals console or CONSOLE. This way you can set the $USER_MAGIC_FOLDER_1$ directly to correct variable based on the test if you're in console mode or not.

Ssekar1
04-20-2009, 01:04 PM
Thanks, Vlad.

It works now. I kept the result variable as $USER_MAGIC_FOLDER_1$ for the console input panel and added an Set InstallAnywhere Variable panel that set it to $USER_MAGIC_FOLDER_1_1$ if the installer ui is console.

Again, thanks for your help.

Sarat..


Ok, sorry for not realizing earlier this was the issue. After digging a little, it has been reported from time to time: http://community.acresso.com/showthread.php?t=184577&highlight=double+quotes

But after all, it seems to be by design (i.e. adding double quotes in console mode): http://community.zerog.com/cgi-bin/ikonboard.cgi?act=ST;f=14;t=4547 and there is a more than 4 years old feature request for not adding quotes in console mode: http://community.zerog.com/cgi-bin/ikonboard.cgi?s=49e96d4b5424ffff;act=ST;f=15;t=5189;hl=double+and+quotes

What you can do in order not to use custom code? As you said, you can test if the $USER_MAGIC_FOLDER_1_1$ is not null by testing it against the standard IA variable $NULL$ or you can test if you're in console mode by having as a very first action a variable $IS_CONSOLE$ which is set to true if $INSTALLER_UI$ equals console or CONSOLE. This way you can set the $USER_MAGIC_FOLDER_1$ directly to correct variable based on the test if you're in console mode or not.