Sign in to follow this  
Followers 0
MrAfterhours

AutoIt Scripts deployed with Altiris on Machines with no active login

24 posts in this topic

Hello,

I understand there may be other posts out there with this answer and yes I have google and forum searched with no results.

My current scenario is this. I have tons of applications out of a list of 900 to script. Most have used their installer commands no problem. I have one that is Installshield that won't uninstall silently so I decided to use this as my first AutoIt script for proof of concept. (Please don't ask me if I have tried making an answer file, this does not work as some strange window that has nothing to do with InstallShield pops up requesting verification of uninstall and nothing works to pass the command.)

My issue is this. I have written a simple uninstaller script for the app that steps through about 3 windows. It works absolutely fine when running while logged into the machine. It will not work when running from Altiris as the admin account when the admin account has no local session. If I RDP to the machine with the Admin account and run it with an active session it works, if I close the RDP session and leave the Admin session open but not active it works fine. Just not when no session from the admin account is active.

We deploy other applications using the exact same method so getting the uninstall to work this way would be ideal as well. I don't know if it matters but the organization is using UAC and all basic users are not local admins, the account used to execute all Altiris commands has local admin rights so that is not a problem.

Here is the code in it's entirety. I have far more complex scripts to build but I thought I would start small and it's disconcerting to have these types of issues on the smallest script:

#RequireAdmin
Run('RunDll32 C:\PROGRA~2\COMMON~1\INSTAL~1\engine\6\INTEL3~1\Ctor.dll,LaunchSetup "C:\Program Files (x86)\InstallShield Installation Information\{7DD54560-9EE5-11D4-B976-00A0CC326153}\Setup.exe"  -uninst ')
WinWait("", "This will remove  from your computer. Do you wish to proceed?")
ControlClick("", "This will remove  from your computer. Do you wish to proceed?", 6)
WinWait("", "has been successfully uninstalled from your machine")
ControlClick("", "has been successfully uninstalled from your machine", 2)

Any help would be greatly appreciated.

Thanks,

Dustin

Share this post


Link to post
Share on other sites



Hi, MrAfterHours, welcome to the forum. Just out of curiosity, what is the application you're trying to uninstall?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

It's an oilfield tool from Hampson Russell called HRS Applications.

Share this post


Link to post
Share on other sites

I guess my confusion is more on the unattended/no user login side. I forgot to mention, if I run the script on an XP x64 machine remotely without an active login it works just fine. If I run it on my Windows 7 x64 test machine remotely with no active login it just hangs. Never states that it failed, just hangs. Seems like it is waiting on something, maybe a "publisher not trusted window" or a "UAC" window. I dont know. I need help determining what is different and if I am missing some code to allow 7 compatiblity in a non-login push.

Share this post


Link to post
Share on other sites

Could you do the following:

1. use a clean PC

2. take a snapshot to record all settings and files.

3. Install HRS

4. take a second snapshot to gather what changed - files added, registry changes, you get the idea.

5. Create a custom uninstaller to remove all the changes. AutoIt can do this.

6. When using Altiris, use your custom installer instead so you can run the uninstall silently.

This method would allow you to remove the software cleanly and with no user interruption.

Share this post


Link to post
Share on other sites

I agree with Bellicus on the steps he outlined above. One thing I would ask/suggest first, just because it is the easier to test, have you attempted to run this uninstall package as the System account, rather than the Altiris account?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

I appreciate that it may be easier to create snapshots and manually make uninstallers but this is only an AutoIt test on a simple package. I have much more complicated ones coming up and I would rather not perform this every time I need to make a software install and uninstall.

I have tried running the script as the system as well and it does not install either. I need to understand why the same script that works unattended on XP isn't working on Win7... What has changed???

I would like to think I am not the only one having this issue. I will have installers/uninstallers that I will need to script later. So just making custom install/uninstalls isn't going to work for us.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Has anyone successfully created an AutoIt script, compiled it, ran it remotely to a Windows 7 machine without an active login session, and not had a problem?

This doesn't have to be in just Altiris, SCCM or PSEXEC would work as well since they are the same concept

Edited by MrAfterhours

Share this post


Link to post
Share on other sites

This doesn't have to be in just Altiris, SCCM or PSEXEC would work as well since they are the same concept

That is why I suggested using the system account, MrAfterHours. I handle customers that use Altiris 6.x and 7.x, as well as one that is using SCCM 2007. In all cases they use psexec pretty heavily. I have created probably 150 packages in both Altiris and SCCM that use custom AutoIt scripts, and this has worked well both on XP and Win7 under the system account. I'm confused as to why this is not working for you.

I'm more confused that there are no silent uninstall switches for this application, especially since you stated it is an InstallShield app (the very definition of a Windows Installer package that should support a myriad of switches). Unfortunately, without the application to play with, I can't offer you much more.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Jlogan,

Thanks for the responses, it's truly appreciated. I would give you a copy of the app if it weren't licensed and sensitive. I am glad to hear that yours are working, that means that there is light at the end of the tunnel. I imagine there is something funny I am not putting the script properly or something. Can you give me a small snippet or maybe a script for an open source bit of software that I can test and see if I can get your install work?

The reason this InstallSHield doesn't work is because it calls some window (it has no name or anything to tell me what it is). This is why the script's have to wait for a window wtih text and not a title. The setup.iss file generated doesn't incorporate an answer to this window, nor does it incorporate an answer to the "completed" window. So, after the setup.iss file is created and run you still manually have to click OK on the first window and then OK on the last window.

Are your clients using locked down UAC controls?

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Does running it manually with the silent switch in CMD work?

Edited by mechaflash213

Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Share this post


Link to post
Share on other sites

Are you referring to the application run with a silent switch or the compiled autoit script?

Share this post


Link to post
Share on other sites

I have UAC completely disabled and have tested the script and it still doesn't work. In the task manager I can see the autoit script EXE kick off but it just sits there. Using no CPU or memory.

Again, this script works in XP so it must be a syntax or some other issue that Win7 doesn't like. Is my code correct for a silent, non-login script on Win7? Can anyone provide an example of some code that does work, possibly for an opensource install that I can test in my environment?

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

Are you referring to the application run with a silent switch or the compiled autoit script?

Yes the application NOT the autoit script. Does the application uninstall correctly if you run your uninstaller manually in CMD with the silent switch?

EDIT: If it does work, try throwing that same command into a batch script, put it in a scheduled task for a couple of minutes ahead to run whether or not the user is logged on, use system user, and logout of the machine and see if it does it as well. Then we can at least narrow down if it truly is a windows security issue.

Edited by mechaflash213

Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Share this post


Link to post
Share on other sites

And I know you say your Altiris runs commands at an admin level, but just for shits-and-giggles try using RunAs() instead of Run() with an admin or system credentials.


Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Share this post


Link to post
Share on other sites

The application (HRS) doesn't uninstall silently from the CMD. This is the only reason I am even attempting to use AutoIt. If it worked I would have been happy just doing that. It throws up a window asking for confirmation that can't be CMD line scripted to bypass. Thats when I employed the use of AutoIt to perform the clicking of OK for me. And in turn finding myself in this predicament.

I need window interaction in a non logged in windows machine. The scripts work PERFECT if I use Altiris to run the batch in the context of the logged in user. This doesn't work when the user account used to run the script isn't logged in. And you can't write the script 2500 times for each employee in the company after painstakingly asking every single one of them for their password jsut so you can try and run it in their context.

What I don't understand is, an install EXE can be run on a machine wihtout anyone being logged in. WITHOUT A DOUBT. Why is it that an EXE from AutoIt run in the same way fails???? And only on Win7. I need someone to show me some code and prove that this scenario has actually worked. I hear theoreticals but no one is showing proof. I have googled my face off about this and I find forum posts all over AutoIt about it but no one has an actual resolution. And the amazing "FAQ" has a 3 line entry about interacting with the desktop and all it states is to use commands like "WinWait" not "WinWaitActive". I've done this. Now I need to know how to realistically apply this to a scenario.

Share this post


Link to post
Share on other sites

Bump

Share this post


Link to post
Share on other sites

I don't have a problem with a window. The script performs perfectly through the steps of the uninstaller. The ONLY problem I have is why the script won't run when executed remotely via Altiris on a machine that doesn't have anyone logged into it. The same exact way you would push any other install through Altiris, SCCM, KACE, etc... I want to run the Altiris script remotely, under an AD admin credential, on a machine with no one logged in, and have it run through the steps of the uninstall the exact same way you would with a normal software's exe.

  • Write batch for ISS removal (setup.exe -s -f1".uninstall.iss")
  • Push to machine using altiris and admin credentials
  • Wait for batch to complete execution
  • high five your neighbor because it actually worked
That process above I want to EXACTLY mirror. Only, because step 1 doesn't work I am writing an AutoIt script to perform that, then in step 3 we are waiting for the autoit EXE to finish not the batch file.

Share this post


Link to post
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
Sign in to follow this  
Followers 0