Jump to content

Script ran through SCCM 2012 doesn't finish


 Share

Recommended Posts

Hi people,

       I'm new to both SCCM 2012 and autoit scripts. My aim is to install and activate a program called MapInfo. I am installing MapInfo using a command wrapped in a batch file. I have created and compiled a script which opens MapInfo then selects the options to activate over the internet. My batch file is;

 
"%~dp0setup.exe" /s /v"/qb INSTALLDIR="C:Program FilesMapInfoMapInfoPro" USERNAME="Central Services" COMPANYNAME="Some Council" PIDKEY=MINWES12345678 ACCD=123456 ACTLIC=True"
 
 
"%~dp0licenceScript.exe"            <<<<<----------------compiled script
 
When the batch is ran by double clicking, MapInfo installs and my script opens MapInfo selects the option to successfully activate MapInfo over the internet.
 
Problem is when i run the same batch file through SCCM 2012, MapInfo installs, the script activates MapInfo, however in Software Center, installed software tab on the client pc i just see "Installing" with the thingwy to the right just around and around forever until I log off or restart. 
 
 
My script is;
 
#region ---Au3Recorder generated code Start (v3.3.7.0)  ---
 
#region --- Internal functions Au3Recorder Start ---
Func _Au3RecordSetup()
Opt('WinWaitDelay',100)
Opt('WinDetectHiddenText',1)
Opt('MouseCoordMode',0)
EndFunc
 
Func _WinWaitActivate($title,$text,$timeout=0)
WinWait($title,$text,$timeout)
If Not WinActive($title,$text) Then WinActivate($title,$text)
WinWaitActive($title,$text,$timeout)
EndFunc
 
_AU3RecordSetup()
#endregion --- Internal functions Au3Recorder End ---
 
 
Run('"C:Program FilesMapInfoMapInfoProMapInfow.exe"')
_WinWaitActivate("MapInfo Professional Activation","")
Send("{TAB}{TAB}{ENTER}{TAB}{TAB}{TAB}{TAB}{ENTER}")
_WinWaitActivate("Pitney Bowes Software Activation","")
Send("{ENTER}")
#endregion --- Au3Recorder generated code End ---
 
 
Any help would be appreciated 

 

Link to comment
Share on other sites

  • Moderators

SCCM is Microsoft's System Center Configuration Manager.

 

@SiBox - how are you running the install, as System or some other account? You're not going to have any luck doing a WinWaitActive under the System account.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

When you set up the package in SCCM, you select which account you're using to deliver that package. The typical choices are either the SYSTEM account, or a specific service account that is a local admin on all client computers.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Thanks for all your replies. 

 

@JLogan3o13 - I have had a look through the properties and i could not find any options that let me choose what account i want to use to deliver the package. I did find some under the Environment tab of package properties where i can select "Only when a user is logged on"  "Whether or not a user is logged on" and "only when no user is logged on". Is this what you were referring too?.

Link to comment
Share on other sites

  • Moderators

Ok, I'm doing this from memory as the customer location I am at doesn't use SCCM, but it should be close. When you create the package, you give it a Name and Description, point it to the source files, on the next screen you choose Standard program, then specify your command line parameters. On this screen, you have several drop-downs, one of which is Program can run (this is where you set either when a user is logged in or not), and Run mode. Run mode is where you set running with admin rights or not.

If you have set up a Network Access account under Site Operations, you should be able to run the package as this account.

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

So, as was stated above, if you're using a service account to run the package, it will never "see" the Window, and thus the WinWaitActive will never go anywhere. I would look into doing a completely silent install of the application.

I'm curious - Based on your script it looks like you're trying to activate MapPoint. Are you using Node-locked licenses, or Concurrent (have a license server on-site)? If they are node-locked, how do you plan on handling having to put in a different key for each?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

JLogan3o13,

I thought the session 0/1 issue was only a problem when using the SYSTEM account, not a normal AD account (service account or otherwise). If SiBox is Network Access Account does that not allow him to interact with session 1 ?

Link to comment
Share on other sites

  • Moderators

I do not believe so. The Network Access Account is simply an A.D. account that you set up in SCCM, through which all packages are deployed. In essence, it is doing a RunAs behind the scenes (at least, that is how it worked in 2007, and I haven't read of any changes).

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Based on my (limited) knowledge of the issue, I thought it was just those system-level accounts (that usually run a local service) - like SYSTEM - that run in session 0. I thought that if something was executed with a standard AD account (service account or otherwise - it all looks like a standard AD account to Win7), that it would then execute in session 1.

Either way, I'm told (by a friend who is more familiar with SCCM) that he uses AutoIt and launches external executables with SCCM packages and never has a problem with GUIs not displaying to the user as it always has with XP and previous.

Link to comment
Share on other sites

  • Moderators

Interesting, that has not been my personal experience. As I mentioned, I am no longer at a cutomer site where I have admin access to SCCM. Up until April, however, I did contract myself out as an SCCM administrator (2007), and found issues with trying to display GUI interfaces on the few occassions we tried. As I lean more toward industry standard of repackaging into MSI rather than scripts though, I will admit this did not come up but a couple times.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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