![]() |
#1 |
Junior Member
Join Date: Sep 2011
Posts: 2
|
Exit code on embedded installers
Bad topic title I know.
I'm running an installer from my NSIS installer/script via the following: code: However I want to abort the whole script/installer if this installer fails to complete. I.e. if the exit code != 0. I did find a 'Useful Script' that mentions this, but I'm being intellectually challenged and cant find how to apply it, as the example seems to omit this section. http://nsis.sourceforge.net/Embedding_other_installers#Using_the_return_value_from_the_ExecWait . Suggestions please? |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Sep 2011
Posts: 2
|
I saw that, however getting the exit code and handling it are different things. Its the handling that I'm struggling with.
|
![]() |
![]() |
![]() |
#4 |
Major Dude
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
|
First of all you need to figure out what ExitCode the installer you run will return in for what situation.
This depends on the individual installer and may not be answered in general. Then simply use a "StrCmp $1 <VAL> <GoIfEqual> <Otherwise>" to decide where to jump, depending on the ExitCode. code: For more complex things, you may want to have a look at ${switch} from LogicLib.nsh ![]() My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc My source of inspiration: http://youtu.be/lCwY4_0W1YI |
![]() |
![]() |
![]() |
#5 |
Major Dude
Join Date: Oct 2006
Posts: 1,892
|
Or, preferably, use the logiclib and do:
${If} $1 == "<VAL>" ;stuff ${Else} ;other stuff ${EndIf} |
![]() |
![]() |
![]() |
#6 |
Senior Member
Join Date: Mar 2006
Location: Dallas
Posts: 462
|
Include LogicLib.nsh and then
orcode: code: (Edit: overlapping posts - MSG and I are suggesting the same thing.) Last edited by demiller9; 23rd September 2011 at 12:40. Reason: overlapping posts - MSG and I are suggesting the same thing. |
![]() |
![]() |
![]() |
#7 |
Major Dude
Join Date: Oct 2006
Posts: 1,892
|
...wow, look at us being all helpful today. :P
|
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|