Jump to content

Running an Interactive Installer Remotly using PSExec not working


 Share

Recommended Posts

I'm automating an Installshield installer - which I have successfully done on a local interactive session.

The goal is to initiate the autoit script remotely using nant. So far, rather then mess with WMI in vb, I thought I'd try to use psexec from psTools. I can successfully launch applications on the deployment machine via remote using pstools. But these programs do not run in an interactive session - this is expected.

My script initially consisted of many WinWaitActive elements, but since this is not an interactive session, I read something that windows in this setup would not be able to be active, so I rewrote the script to use WinExists checks instead. This script works on an interactive session, even if the Installer is not in the foreground, etc.

So now the last element is to execute the script remotely via psexec

But here I fail. Also, I can not get any debug information. I have included debug messages in the script per the FAQ, and they work fine when I run the script via an interactive login. But when I run psexec, I see autoit's executable, the installer executable (which was launched by the autoit script) but none of my winexists functions seem to work.

Below is the source - how can I automate this type of process in an non-interactive login?

If there is a better way of doing the WinExists.. please let me know. The do loop with sleep was my hack replacement for WinWaitActive

AdlibEnable("ISErrorCheck",5000)
    dbg("program start")

Run("TMSSetup.exe")

Do
    sleep(500)
    dbg("In wait loop for language")
until WinExists("Choose Setup Language")
ControlClick("Choose Setup Language","","[TEXT:OK]")
dbg("clicked language button")
Do
    sleep(500)
    dbg("In wait loop for uninstallscreen")
Until WinExists("InstallShield Wizard", "TANDBERG Management Suite - Uninstall")
ControlClick("InstallShield Wizard", "TANDBERG Management Suite - Uninstall","[TEXT:&Next >]")
    dbg("clicked next button")
Do
    sleep(500)
    dbg("In wait loop for completed")
Until WinExists("TANDBERG Management Suite", "InstallShield Wizard Complete")
ControlClick("TANDBERG Management Suite", "InstallShield Wizard Complete","[ID:503]")
ControlClick("TANDBERG Management Suite", "InstallShield Wizard Complete","[TEXT:Finish]")
WEnd

Func ISErrorCheck()
    If WinExists("InstallShield","Failed to complete") Then
        dbg("hit iserrorcheck winexists")
        ControlClick("InstallShield","Failed to complete","[TEXT:OK]")
        dbg("hit iserrorcheck button")
        Exit(1)
    EndIf
EndFunc

Func dbg($msg)
    DllCall("kernel32.dll", "none", "OutputDebugString", "str", $msg)
EndFunc
Edited by flynnibus
Link to comment
Share on other sites

  • 1 month later...

I can successfully launch applications on the deployment machine via remote using pstools. But these programs do not run in an interactive session - this is expected.

I know this is a few months old now...

The -i switch for PSEXEC will allow interactive use, if that's what you meant.

Please correct me if I am wrong in any of my posts. I like learning from my mistakes too.

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...