Jump to content

AutoIT with SMS 2.0


 Share

Recommended Posts

I created and compiled a script to uninstall an application. The script works perfectly when run manually, but it returns an error when I push it via SMS 2.0(actually just shows up as failed in advertised programs monitor). I understand that answering a question like this relies upon my assurance that I craeted and advertised the package correctly, so I know this is rough.

Long story short, it deploys and fails. I can double click the executable and it works fine. Are there known issues using SMS to push scrpts created with AutoIT3?

Edited by Anaxibius
Link to comment
Share on other sites

Some questions: Does your script impersonate a user with RunAsSet? Does your script rely on mapped drives or UNC paths that would require file permission?

If you can post your (uncompiled) script or a look-alike for your script it would be helpful for others to assist in troubleshooting. I know that it's frustrating when you post and don't get any answers, but this is a scripting forum, and without a script to diagnose many parties who would be sources of help will silently disregard your post...

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Link to comment
Share on other sites

Thanks for the advice DaveF. Here you go.

$key = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\AGCO - GIMA\Wintest 2.08.06",1)

If $key = "2.08.06" Then
    Run('"C:\Program Files\InstallShield Installation Information\{185B88AD-4522-4DBB-883F-057190B185F1}\setup.exe" -l0x9 -uninst -removeonly')
    WinWait("Wintest - InstallShield Wizard","")
    Sleep(1000)
    If Not WinActive("Wintest - InstallShield Wizard","") Then WinActivate("Wintest - InstallShield Wizard","")
    WinWaitActive("Wintest - InstallShield Wizard","")
    Sleep(1000)
    Send("!y")
    If Not WinActive("Wintest - InstallShield Wizard","") Then WinActivate("Wintest - InstallShield Wizard","Yes, I want to restart my computer now.")
    WinWaitActive("Wintest - InstallShield Wizard","Yes, I want to restart my computer now.")
    Sleep(1000)
    Send("{DOWN},{TAB},{SPACE}")

Else
    MsgBox(0, "WinTest Uninstall", "Removal of WinTest 2.08 is not necessary on this PC.  Click OK to continue.", 10)

EndIf

As I mentioned above, the script functions normally on my test machine. At the time of my writing this I have been testing logged in as a Domain Admin. As you can see it calls a local file. SMS is using a UNC path to a directory that I use on a daily basis for software rollouts.

Thanks for any help you can offer.

Edited by Anaxibius
Link to comment
Share on other sites

In answer to my own question I found out that I can do any kind of keystroke or mouse manipulation that I want from within SMS, but if I call an executable inside of the script it will fail 100% of the time. I even tried it with Notepad.exe. Just an FYI.

Link to comment
Share on other sites

In answer to my own question I found out that I can do any kind of keystroke or mouse manipulation that I want from within SMS, but if I call an executable inside of the script it will fail 100% of the time. I even tried it with Notepad.exe. Just an FYI.

Is it any EXE or just those that try to display something to the user? You can try a command line like:

Run(@Comspec & " /c mkdir c:\foo", @SystemDir)

...and see if the folder is created. I'm sorry if I'm not more help, I don't run or have access to SMS.

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...