Tripredacus Posted October 8, 2007 Share Posted October 8, 2007 Greetings, I am working with a couple companies right now who seem to be having a problem using a deployment engine to run one of the scripts I have created. Through testing, we have determined the following: 1. The script runs perfectly fine if executed manually 2. The script runs perfectly fine if executed manually (after modification) from a USB Key 3. The script has unknown results after being deployed. Their deployment software, which (my understanding) works similar to Rumba or (in part) Altiris, where they can push a file to a remote computer and execute it. These remote computers are always (or supposed to be) logged in with a limited user account, so the program we make for them are designed to work properly in this way. Previously, they only pushed MSI files into a folder, and once a month, a scheduled task would execute the MSI to install whatever it was. Now, a problem occurred where the scheduled tasks had failed to run. This was caused by the task itself to have become corrupted due to a Windows bug we did not discover until 2000+ machines were delivered. A fix was created, but we are unable to deploy this fix remotely. So this begins my quest for information. Currently, I have little information about the deployment platform and only what the client says they require. Our customer, who sells the software, and their client, who receives the computer from us. The client uses the deployment platform. Their techs are reporting that their software is timing out because it is expecting a return code of 0. AutoIT uses return codes of 1 and 0 to determine whether or not it is to display an error message or not. Does AutoIT also send any such codes to Windows? The basic issue seems to be that after the file is pushed, the client software executes the EXE, but does not get any response that it has been completed or not. Where should I start looking at for informat? I am going to call the client right now to see what information they have for me. Thanks. Twitter | MSFN | VGCollect Link to comment Share on other sites More sharing options...
Jazkal Posted October 8, 2007 Share Posted October 8, 2007 Check the AutoIt3 Help file and look under the Function 'Exit' Link to comment Share on other sites More sharing options...
weaponx Posted October 8, 2007 Share Posted October 8, 2007 (edited) If you use Sysinternals psexec to launch an AutoIt compiled script remotely, psexec will return the exitcode of that script. So if you do something like: $result = RunWait("psexec.exe bla bla bla script.exe") You should get the exitcode from script.exe Edited October 8, 2007 by weaponx Link to comment Share on other sites More sharing options...
Tripredacus Posted October 8, 2007 Author Share Posted October 8, 2007 (edited) OK I used the example script in Func OnAutoItExit ()...EndFunc page in the help file, and it confirms that an exit code of 0 is being sent. 0 being 'natural closing'. So, this exit code, to where is it being sent? Is this exit code only sent for the AutoIT script itself? or is it receivable by another program? The fellow I spoke to on the phone says his software monitors for Windows System Return Codes. Edited October 8, 2007 by Tripredacus Twitter | MSFN | VGCollect Link to comment Share on other sites More sharing options...
weaponx Posted October 8, 2007 Share Posted October 8, 2007 When you use Exit(1) your deployment program should see that as the return value. There is no standard that says Exit(0) = Success Exit(1) = Failure In some cases it's reversed Exit(1) = Success Exit(0) = Failure You can make the exit code whatever you want. Link to comment Share on other sites More sharing options...
Richard Robertson Posted October 8, 2007 Share Posted October 8, 2007 That value gets returned to Windows, and any program that has a handle to your process can read the exit code and act accordingly. Usually 0 is success, and other values indicate irregular operation, but this is, as stated above, not always true. Link to comment Share on other sites More sharing options...
Tripredacus Posted October 8, 2007 Author Share Posted October 8, 2007 Even though I was able to confirm that the program sends a exit code of zero, I used Exit(0) as well. If they say that their software still times out waiting for a response, the only explanation is that AutoIT is not sending the exit code to the message queue that receives Windows System Error Messages. If this turns out to be the case, I will see about having the program write to the event log instead. Twitter | MSFN | VGCollect Link to comment Share on other sites More sharing options...
Tripredacus Posted October 12, 2007 Author Share Posted October 12, 2007 I have gotten a little more information concerning this issue and have gotten new ideas. It appears they are using a call to Netmon to monitor the system event queue. Thus I should be able to send an exit code using COM+. I have not tried that type of thing before. What information can I get about sending COM messages from AutoIT? Please move this topic to COM+ forum if needed. Twitter | MSFN | VGCollect Link to comment Share on other sites More sharing options...
Tripredacus Posted October 12, 2007 Author Share Posted October 12, 2007 OK the test results came back from my 2 testing apps. Here they are: fixtask_one [using Exit(1)], the client sees an exit code of 1 while it monitors the system events. fixtask_zero [using Exit(0)], the client times out waiting for an exit code. So does this code for AutoIT not actually notify windows when a program is completed? Could this be a bug? Twitter | MSFN | VGCollect Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now