Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 8th July 2009, 15:44   #1
Vukashin
Junior Member
 
Join Date: Jul 2009
Posts: 5
Question Silent installer aborts without obvious reason

Hi all, I've recently, for the first time, started working on an installer using NSIS. I've managed to create installer but I have problem when I try to start it from the command line (silent install).
I know, I have to put /S to be able to install it silently. I'm using this function:
code:
${GetOptions}

for getting command line parameters.
Problem is that all of a sudden installer aborts on this line:
code:

StrCmp "" $0 +1 +2



Here is a part of the code:
code:

${GetOptions} $R0 /PASSWORD= $0
StrCpy $password $0
StrCmp $password "" +1 +2
${LogText} "Password is not specified."
continue:
${GetOptions} $R0 /WINACC= $0
${LogText} "win acc: $0"
StrCpy $accountName $0
${LogText} "win acc2: $accountName"
${LogText} "win acc again1: $0"
StrCmp "" $0 +1 +2 ; this is the line where it aborts
${LogText} "Windows account is not specified."
${LogText} "after win acc"


Before this point, I also have this function called:
code:
${GetParameters} $R0

Strange thing is that I have called StrCmp function couple of times before this.
Function
code:
${LogText}

is used for logging.
I have put so many LogText statements for debugging reasons. All the code I wrote here is located in .onInit function. I don't know if that means something.
I'm really confused what is wrong here, if anyone knows what is the problem, please tell me. If you want more detail fill free to ask.
Vukashin is offline   Reply With Quote
Old 8th July 2009, 16:05   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
Your logic is messed up to start with. Even if you don't specify a password your script will print a message and then continue! Use LogicLib and if needed call Abort.

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 8th July 2009, 16:47   #3
Vukashin
Junior Member
 
Join Date: Jul 2009
Posts: 5
Actually, this is what I did, I deliberately altered code like this because I didn't wanted to Abort. That is why I changed Abort calls on lines 4 and 12 with ${LogText} calls. And instead of jumping on label continue I made a relative jump +2. That is, now I don't abort on mistake but rather log it. Problem is that on the line which I marked with comment, installer script aborts, without any reason logical to me.
Vukashin is offline   Reply With Quote
Old 8th July 2009, 16:53   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
Could you produce a script that reproduces the problem?

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 8th July 2009, 16:59   #5
Vukashin
Junior Member
 
Join Date: Jul 2009
Posts: 5
No. Actually, I have two other similar scripts (almost the same) and they are working flawlessly. That's why I am so confused. I think problem is hidden somewhere in this script, but I just can't find it. To create all these scripts I used wizard from the NSIS plug-in for Eclipse. I created a MUI2 installer, if that is important. I just thought that someone maybe had similar problem. I don't have that script with me now, but I'll attach it tomorrow. Maybe you or someone else can spot the error.

BTW, thanks for quick replay.
Vukashin is offline   Reply With Quote
Old 8th July 2009, 19:37   #6
demiller9
Senior Member
 
Join Date: Mar 2006
Location: Dallas
Posts: 442
Macros do not count as a single line. If your macro LogText has multiple lines then this
code:
StrCmp "" $0 +1 +2
${LogText} "Windows account is not specified."

will be jumping someplace inside the macro. You should either use LogicLib or add specific labels and put those on the StrCmp. LogicLib would really be a better choice, in my opinion.
code:
${If} $0 == ""
${LogText} "Windows account is not specified."
${EndIf}

Don
demiller9 is offline   Reply With Quote
Old 8th July 2009, 20:29   #7
Vukashin
Junior Member
 
Join Date: Jul 2009
Posts: 5
Hmmm... That sounds interesting. I'll try it tomorrow. Thank you, too.
Vukashin is offline   Reply With Quote
Old 13th July 2009, 10:14   #8
Vukashin
Junior Member
 
Join Date: Jul 2009
Posts: 5
Sorry for late reply, demiller9, you were right, macros were my problem. I've solved it, thanks to you and Afrow UK.
Vukashin is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump