- NSIS Discussion
- Program Error on exit
Archive: Program Error on exit
JATO
8th November 2005 01:56 UTC
Program Error on exit
I've created a simple script to copy a file to a remote computer.
As soon as the script finishs copying..it generates a program error in Windows.
The files copy over fine.
I'm not sure why the script errors on exit.
I use a simple GOTO End command
and the last 2 lines are:
END:
SectionEnd
Is this the wrong way to end a script?
I've attached my script if that helps. Please advise what I am doing wrong
Animaether
8th November 2005 04:57 UTC
that Goto END is fine... however, the other gotos are exceeding the boundaries of the script. The relative gotos are for instructions only - not for line numbers.
So the Goto +2, for example, has nowhere to go as there are no 2nd-next instruction to skip to. You should change both of these to read "Goto END" as well.
Animaether
8th November 2005 05:01 UTC
P.S. The method you use to determine the Windows version relies on several things - such as the Windows directory name always being either 'windows' or 'winnt'.
See the following for a more robust method :
http://nsis.sourceforge.net/Get_Windows_version
JATO
8th November 2005 06:11 UTC
yeah, the script will run on corporate owned PCs..so they have a standardized image, so they will all have calc.exe in 1 of those 2 locations
I did that to make it as simple as possible. I know there are other, more reliable ways to pinpoint the OS.
thanks
JATO
8th November 2005 06:14 UTC
Thanks Animaether! I'll test that tomorrow from work !
I thought the Goto Ends were the problem..hehehe
Being my first time using Tags or relative jumps...I didn't know that relative jumps couldn't go to a blank space..I thought that was a good point to have them jump to...hehehehe
:)
thanks for pointing that out!
JATO
9th November 2005 00:56 UTC
Thanks Animaether!
I tested it today at work.
GoTo End command instead of relative jump WORKED. No program errors on exit.
I'll have to test further because as I recall I used the relative jumps because the it seemed that the Goto End command was being ignored.
But this solves my immediate problem.
Thanks again.
kichik
9th November 2005 08:20 UTC
Use the LogicLib, it'd be much simpler. For example:
!include LogicLib.nsh
# ...
${If} $0 == "something"
DetailPrint "$$0 is someting"
${ElseIf} $1 == "something"
DetailPrint "$$0 is someting"
${Else}
DetailPrint "bah"
${EndIf}
Animaether
9th November 2005 20:31 UTC
Small error in your example ;)
$1 == "something"
DetailPrint "$$1 is something"
kichik
10th November 2005 20:43 UTC
Damn, I better recall everything before the customers notice anything!