Unattended install

Hello

I have been tasked with installing sparl on 150 workstations in our Windows Active Directory environment. Majority of the workstations are Windows XP. Apparently Spark requires the user to have administrator rights in order to install and before it will install windows prompts with the following message “Do you want to allow the following program from an unknown publisher to make changes to this computer?”

My goal is to have an uunattended install using a group policy to all 150 workstations. The issue I am running into is having the installation batch file or the MSI runas an administrator and having the installation automate the response to the message that appears. I need to have this installation run without any user intervention.

Any advice on how to accomplish this? Thanks for any suggestons.

As long as i remember you don’t have to additionally provide admin credentials when installing MSI through GPO software deploying option. It will start on system startup and use System permissions.

So, the only thing is to create MSI. I haven’t done this with Spark yet, but i’ve heard some use Advanced Installer to create one. So use other tools like http://community.igniterealtime.org/docs/DOC-2126

Confirming Advanced Installer will make a .msi file for you (even with the free edition of Advanced Installer).

Another option if GPO won’t work for your needs would be to script the install with something like AutoIt (google it) and stick that in the startup directory to run once then kill itself after the install is complete. AutoIt can emulate key strokes and mouse clicks, allowing you to “script” the install and hit the “next, next next” button for you.

You don’t need to create a msi, the Spark installer4j (the exe) can be called silently with " -q" . My GPO has a call for an autoit executable that between other things installs Spark and deploys a customized spark.jar. I’ve been using it consistently for the last year and never failed me.

1 Like

If i was the topic starter i would mark M. Tejera reply as an answer Thanks a lot for that silent key (i have now looked up more install4j keys, but only -wait seems relevant in this case). Having it installing with the original exe is much better, because you don’t need to create msi every time new version comes up. Will be very easy to keep all workstations updated. Though i have to mention that it can take some time until it actually installs (until all the other logon tasks run). Depending on PC resources it could take 3-5 minutes.

So, i have a GPO, and in Computer Configuration > Policies > Windows Settings > Scripts > Startup i have script.cmd with only one line:

\server\share\folder\spark.exe -q

The switch i use:

-q

-overwrite (useful in case you’re making an in-place upgrade, to avoid errors in case of leftover files)

-dir (to force a specific directory)

You can also call the uninstaller with the -q switch to uninstall Spark silently.

By the way i never used -wait since i worked around it by calling the installer and waiting for it to complete.

For batch the command is “start /wait application

But overwrite switch probably won’t help if Spark is still running? I’m thinking to put upgrade switch into shutdown script and kill the spark.exe process before the installation. I never had problems with the interactive installer doing in-place upgrade, so probably won’t need overwrite switch.

I hate being a windows admin, and hate batch scripts even more. And since powershell can’t be assumed to be on every system, here’s a quick AutoIt script I wrote recently to help automate a fresh install of Spark.

It assumes a few things, mainly that the Client Control plugin is installed on Openfire and there is an uploaded Spark exe for that plguin to serve up at a special URL the plugin creaates. It also assumes that you want to backup the transcript logs and then completely wipe out the Spark Application Data directory to essentially force a complete new profile on that computer (nothing is saved it is as-if spark was installed for the first time).

AutoIt is pretty straight forward, so feel free to modify it for your situation. This could be used in a GPO if modified a little bit. At the time I wrote this, I was unaware of the silent install switch, so you can easily change that bit to avoid having any user interaction as this script runs.

http://pastebin.com/A6Xtj7Aw

Also, it’s worth noting that the Client Control plugin has an Update feature built in. If you upload a Spark exe to that plugin, next time your Spark clients check for an update, they will ask the user if they want to download it and install. This is quite helpful if you have an in-house Spark version that you maintain (for company branding, or removal of features, hard-code server names, etc).

Edit: Pastbin may not be around forever, so I attached the raw script for download. You will need to open it in AutoIt’s SciTE editor and have it build the exe for you. Then you can push this to any system even if AutoIt is not installed.

Edit 2: A disclaimer before somebody runs this and looses transcript history or something. If the user this script is run under does not have full administrator permissions on that machine, then you run an extreme risk of transcripts not being backed up even though the script will report they have been. I didn’t build logic in to verify backup since this was not a problem for my network.
Fresh_Spark.au3.zip (2088 Bytes)

I’m using GPO and batch scripts for 5 or more years now. And i hate it every time This is just doesn’t feel how things should be done, especially in 2013. It’s not very intuitive or convenient to create the policy, apply (all this folder tree view of hierarchy…) , but to test and find out what is wrong is just being a blind man in the dark forest… It just makes me mad when i have to setup a test machine, all the OUs, permissions etc, restart-login-logoff-restart-gpupdate-restart-login-logoff-gpupdate-etc. But i would still use GPO instead of a third party tool. Tend to use standard tools. Especially if you can’t do everything with that 3d party tools, then you have to split policies and installs between them.

Anyway, i managed to prepare install GPO and standard Spark settings propagation with two scripts (startup and login) and i will have and upgrade one for future (shutdown). The only thing i can’t figure out is how to remove Spark’s autorun in the Administrator registry after you run the installer (i mean on all workstations). I even have a ticket for this in Jira i think, as Spark is always putting itself into startup without asking after you install it… Not a big deal, but i would be annoyed to see Spark’s login screen popping on me when i login to some workstation as admin.

Test GPO’s before pushing? Bah! Who does that? Where’s your Adventure wroot?

Completely agree, GPO’s are horrible and I would have thought M$ would come up with an easier way to manage this… luckily for me, the only win server I have to deal with now is the domain controller, everything else has been migrated to linux running on Xenserver platform (love it!)… but this leaves me stuck with GPO’s still…

Don’t write-off AutoIt though, it was originally intended to automate clicking of buttons and stuff within windows (many people used to make mmo bots with it, hehe). However it has been expanded to be capable of just about anything in windows.

It uses all the native Win32 API hooks, so basically it’s an augmented batch script that is much easier and simpler to write, read and maintain. Plus you can compile the script to an exe so it can be run on systems without AutoIt being installed. So no 3rd Party tool dependency. If you must use a batch script for some reason, you could write a 1-linner that kicks-off your compiled exe script.

I’ve been using AutoIt for a few years now and have just about replaced the need to write a batch script about 95% of the time.

Just a heads up. You can use processclose instead of making an external call to taskkill. It would make your script a bit simpler

http://www.autoitscript.com/autoit3/docs/functions/ProcessClose.htm

I found GPO improved a bit with server 2008. Microsoft bought a company that provided some interesting tools for finegraining policies, and implemented them on 2008/Vista so now you can manage printers, shared folders and a lot other things as objects in the GPO instead of having to script them. And more on the positive side, you don’t need to upgrade the domain controller, just add RSAT on a Windows Vista/7 machine and configure the GPO from there.

1 Like

Oh wow, never knew processClose() existed! Is this newerish? or has it always been there? (I must of looked a while back and didn’t find it or something… i’ve been doing things similar to that KILL_PROCESS(pid) function for a logn while). You learn something new every day!

My domain controller is still 2k3 unfortunately. Since that box literally does nothing now except be a DC, I haven’t really been able to justify the expense and time/resources to upgrade/rebuild with a newer win server version. I’ve heard good things about 2k12 but haven’t tried it out yet.

Also have heard great things about recent Samba versions and their active directory/domain controller services being greatly imrpoved… being a linux junkie, i’ve wanted to give this a go…

My DC is 2003 too, you don’t need to upgrade to use the newer GPO. So don’t worry about it.

Oh nice. Does it work for Win XP and (oh dear) Win 2000 (M$ seems to indicate it’s only for vista and up) ? I have a fair share of 2000 and Xp machines still, along with a slow migration to win7.

There’s an available patch for windows xp. Windows 2000 i have no idea.

http://www.microsoft.com/en-us/download/details.aspx?id=3628

1 Like

Ah, they call it something different on XP, probably why my google-fu failed me… probably a No on win 2000 as it’s been EOL for a long while now… might just be an incentive to finally kick those last few 2000 machines to the curb