Articles,Deployment,OS X March 14, 2013 at 9:26 am

Fixing Broken Software I: Logitech Control Center

This is part one of a series on dealing with the issues software can cause in enterprise environments, and how to combat these issues.

One of the most important skills in a Mac Admin’s toolbox is being able to identify and work around issues with vendor software.  Many vendors release software packages that are ill-suited for use with management tools such as Munki and Casper, and it is important to know how to dig into these issues to be able to support a managed environment.

If you are buying non-Apple mice and keyboards, it is very likely that they are Logitech models.  If an admin wants the full functionality of these devices,  OS X needs the drivers and control panel that Logitech distributes as the Logitech Control Center.  This installs a .prefPane as well as drivers for most modern Logitech input devices.

However, Logitech’s installer is not friendly for deployment though Munki or Casper, as it opens prompts during the installer, and then installs a registration prompt that launches when users login. Thankfully, we can easily modify the preflight and postflight scripts of the installer to recitfy all of these issues.

The download for the Logitech Control Center is a .app, but there is a package installer at Logitech Control Center.app/Contents/Resources/Logitech Control Center.mpkg.  This is a flat package, so we must expand it for modification using the following command:

https://gist.github.com/4217aef6bd862cf82d5d

Navigate to Logitech Control Center.expanded.mpkg/logitechControlCenter.pkg/Scripts, and you will find preflight and posflight scripts, both of which need to be edited.

Preflight:

https://gist.github.com/99c0fb8b9240d64f2192

In the preflight script, line 25 runs KeyboardChooser.app, prompting the selection of a region:

This will not work at the loginwindow, and users should not have to make this selection.  Using fseventer, we can see that all this application does is write to /tmp/LGT_region.plist, with a 0 for EU, 1 for US, and 2 for JP.

https://gist.github.com/cfa64654cc13533ddbe1

To take place of KeyboardChooser.app, replace lines 24 through 26 with the following script, which will write the file that the installer needs to continue.  The installer wants an XML formatted plist, so the second line will convert the binary to XML.

https://gist.github.com/29579dc762f48e7c4848

Once these modifications have been made, save the file and move on to the postflight.

Postflight

https://gist.github.com/a948470f777f4f45083c

Most of the postflight script, until line 110, is just making sure permissions are correct and drivers are loaded.  These actions are fine, but lines 125-129 add a login item for all users which greets them with an annoying registration prompt, which is particularly a problem on shared machines.

Comment out or delete lines 125-129, which will stop the the login item from being created. Save the script, as all edits have now been completed.

Wrapping Up

The main metapackage contains more than just the Logitech Control Center, it also has the Logitech Updater and Logitech Unifying software.  If you are in a managed environment, you probably do not want the updater, and if you are not using Logitech’s wireless products with the Unified Receiver, you really do not need that either.  If this is the case, you are ready to flatten the package, using this command:

https://gist.github.com/d5c90a264d0d5f4eba0e

Import the resulting package into your management software, and you are ready to deploy it to your fleet.

If you would like to use the metapackage, flatten it using the following command, and optionally use ChoiceChangesXML to choose what you would like to install.

https://gist.github.com/c350a11657a22712ff77

Conclusion

Many vendors continue to ship enterprise-unfriendly software, but by knowing how to combat the issues with this software, admins will save many long-term headaches.  With just a bit of time invested and some easy changes to a couple of scripts, a package that was previously unusable in a managed environment can become just another friendly package.  While other software may require full-on repackaging, minor changes saved the Logitech Control Center.

Of course, the best course of action is to complain to your vendors and vote with your dollars, but this may be impossible with free software or if there is no alternative.

Samuel Keeley

Samuel Keeley can frequently be found in ##osx-server on Freenode, or on Twitter @keeleysam.

More Posts - Website

Follow Me:
Twitter

Leave a reply

You must be logged in to post a comment.