#205462 - 2012-07-16 10:16 AM
Forcing Error Codes
|
SMAndy
Just in Town
Registered: 2012-07-10
Posts: 4
Loc: UK
|
Hi All.
I use Kix scripts to push out software, using SCCM. These scripts are perfect, because we can run them on any PC as long as we link to the correct files. Currently, most of our installs are something along the lines of... 1. message box saying "this is going to be installed. Do you want it? Click Yes or No." 2. script jumps to section relevant to their choice. 3. script either exits, or runs the install.
Now I want to use a script like this in a different way. It's being run before an install, but the script itself can't point at the install (different installation process). This means I essentially need it to give an error code at a certain point in the script, so the installation fails when someone clicks No. The reason being that if the script ends, for whatever reason, it'll jump to the next bit, which is an installation.
Does anyone know how I can force a script to give me an error code? Even if it's something as simple as a piece of code that makes no sense, and will fail with an error code... The code itself doesn't need to be something specific, as long as the system will read it as "Fail."
Thanks,
Andy.
|
|
Top
|
|
|
|
#205464 - 2012-07-16 11:01 AM
Re: Forcing Error Codes
[Re: Mart]
|
SMAndy
Just in Town
Registered: 2012-07-10
Posts: 4
Loc: UK
|
And I'm guessing error code 0 is, as with everything else, a success, while anything else would be shown as a failure?
I spose the only way is to test it Thanks for the help.
|
|
Top
|
|
|
|
#205466 - 2012-07-16 11:25 AM
Re: Forcing Error Codes
[Re: Mart]
|
SMAndy
Just in Town
Registered: 2012-07-10
Posts: 4
Loc: UK
|
Excellent!
In that case, do you know how to customise the response buttons? I mean, Yes, No and Cancel might do...
That way I can force it to repeat itself if someone clicks "No" to a question of "do you want to install this now?" but it would work better if the button said "delay" or something...
I found this page: http://www.scriptlogic.com/Kixtart/htmlhelp/Functions/messagebox.htm to give me some ideas on the message box, but there doesn't seem to be a customisable section for what the buttons say.
Because Quit is a full exit in kix, can you do quit 2 to force an error code? Exit technically only ends a function, right?
Sorry for all the questions I'm VERY new to Kix.
|
|
Top
|
|
|
|
#205468 - 2012-07-16 11:57 AM
Re: Forcing Error Codes
[Re: Mart]
|
SMAndy
Just in Town
Registered: 2012-07-10
Posts: 4
Loc: UK
|
Thanks for all your help, if there were karma buttons here, I'd be upping yours.
edit: found the ratings
Edited by SMAndy (2012-07-16 11:58 AM)
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 793 anonymous users online.
|
|
|