Archive: Program Error on exit


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


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.


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


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


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!


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.


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}

Small error in your example ;)
$1 == "something"
DetailPrint "$$1 is something"


Damn, I better recall everything before the customers notice anything!