Page 1 of 1

iritating script error

Posted: Fri Oct 01, 2010 1:50 am
by Bar_BQ
Hi,

Making debug of my installer script, I found a strange behaviour that I can't fix. Take a look on script below:

[compiler if Variable BUILDMODE not Equals PATCH]
Get Component $MS_SQLSVR_2008R2_X86$ Selection State into Variable SELECTED
if Variable SELECTED Equals TRUE
Display Dialog: progressprereq, use as progress dialog (non-modal)
Include Script: checksql2008r2_x86
if Variable SQL2008R2_X86 Equals TRUE
MessageBox: SQL Server, SQL Server instance $SQLINSTANCE_NAME$ already exists in your system.$NEWLINE$$NEWLINE$Please type different instance name or you can choose other installation type to not install SQL Server.
GoTo Label: sql_serversetup
else
Include Script: setupsql2008r2_x86
end
Hide Dialog
end
[compiler end]

If SELECTED=FALSE then script jumps to wrong end (blue instead to red one) clause. I know sometimes something wrong happens behind script engine and usually simple operations copy->cut->paste of the same code help to fix the problem. But not this time. I even tried to rewrite that code and the effect is the same.

Anybody had already such a problem?

Re: iritating script error

Posted: Fri Oct 01, 2010 8:25 am
by Bar_BQ
Guys, now I got more of these. Script has become useless because "if" checks make an uncontrolled jumps to absolutely unrelated "end".
Help!!!

Re: iritating script error

Posted: Fri Oct 01, 2010 12:19 pm
by CFConner
I *think* I see the problem - you have the statement "Include Script: checksql2008r2_x86" which perhaps the system has an issue with. Have you tried just taking the entire code block of script checksql2008r2_x86 and putting it into this MIA file to see if it works (without doing an include) to see if it works? It appears that when you do the:

IF

include script block

the "end" ends up inside the scriptblock that falls out instead. I know I may not be making sense - but can you try what I just said above?

=-Chris

Re: iritating script error

Posted: Wed Oct 06, 2010 1:39 pm
by Bar_BQ
Thank you for reply CFConner!

This might be a reson for that, but I had tried it before I posted the issue. I copied that piece of code into a new project, commented include function and on compile time I got a message that list is out of bound. It doesn't look good... :(

Re: iritating script error

Posted: Wed Oct 06, 2010 5:05 pm
by mills
Bar_BQ, can you post that sample project you created?

Re: iritating script error

Posted: Thu Oct 07, 2010 7:38 am
by Bar_BQ
Of course, but, sadly, just on Tuesday due I'm not in the office...

Re: iritating script error

Posted: Wed Oct 13, 2010 6:48 am
by Bar_BQ
Hi guys,


Indeed, CFConner were right, I had an incomplete IF clause in two scripts - in first one I had one more "end" and in a second I had one less "end".
Don't know why I hadn't found it earlier... Anyway, thanks a lot!


BarBQ

Re: iritating script error

Posted: Wed Oct 13, 2010 3:55 pm
by mills
Alright! CFConner gets a gold star!
gold_star.jpg
gold_star.jpg (22.36 KiB) Viewed 9352 times

Re: iritating script error

Posted: Thu Oct 14, 2010 1:32 am
by Bar_BQ
Definitely! :)

Re: iritating script error

Posted: Thu Oct 14, 2010 1:02 pm
by CFConner
Aw shucks! :)

Moving on - no accident here folks. :)

=-Chris