Home > Bash scripting, Mac administration, Office 2011, Packaging > Repackaging the Microsoft Lync 14.0.8 installer

Repackaging the Microsoft Lync 14.0.8 installer

Microsoft has released Microsoft Lync 14.0.8, which included compatibility with Mavericks. Since we have several folks using both Lync and Mavericks, I wanted to get this into our Casper server’s Self Service as soon as possible.

To test installing it, I downloaded the installer on a disk image from Microsoft’s site, then renamed the package from Lync Installer.pkg to Lync 14.0.8 Installer.pkg. After renaming it, I set up an installation policy for Self Service, scoped the policy so that only my test machine could see it, then ran the installation.

Failed.

I go check the logs and see this entry:

/usr/sbin/jamf is version 8.73
Executing Policy Microsoft Lync...
[STEP 1 of 2]
Downloading BOM for Lync 14.0.8 Installer.pkg...
This Apple Package did not have a valid index.bom file. Assuming it is a flat file package.
Downloading http://casper.server.here/repo_name/Packages//Lync 14.0.8 Installer.pkg...
Error: The package could not be found on the server.
[STEP 2 of 2]
Running Recon...
Displaying message to end user...

OK, maybe I did that wrong. Deleted the package and this time uploaded the installer to my Casper server without changing the name from Lync Installer.pkg.

/usr/sbin/jamf is version 8.73
Executing Policy Microsoft Lync...
[STEP 1 of 2]
Downloading BOM for Lync Installer.pkg...
This Apple Package did not have a valid index.bom file. Assuming it is a flat file package.
Downloading http://casper.server.here/repo_name/Packages//Lync Installer.pkg...
Error: The package could not be found on the server.
[STEP 2 of 2]
Running Recon...
Displaying message to end user...

Failed again. Meanwhile, /var/log/install.log on my test Mac only showed that installd was starting and then stopping. In short, Casper’s logs were right; the installation process was starting but couldn’t then find a package.

At that point, I started thinking. How would the developer have installed this package? How did Q&A likely test installing it, however minimally?

Developer – Would have double-clicked on the package to install it, followed by typing in an admin password.

Q&A – Same process as the developer, except they would have tested installing it from the mounted disk image.

When I followed the process of double-clicking and running the installer from the mounted disk image, Lync 14.0.8 installed fine. That’s when I discovered the permissions issue.

The Microsoft Lync 14.0.8 installer installs the following with the file ownership of UID 502 and GID 20.

/Applications/Microsoft Lync.app
/Library/Internet Plug-Ins/MeetingJoinPlugin.plugin

UID 502 is a user that may not exist on all Macs, but GID 20 corresponds to the staff group, which is the group that all local users on the Mac are put into. The correct permissions should have had those files owned by root and the admin group, so that had to be fixed as part of the installation.

I’d run into a similar-seeming issue with National Instruments’ LabVIEW 2013 Pro, so I decided to solve my Lync problem the same way that I solved my LabView problem.

Prerequisites:

Packages
A downloaded Microsoft Lync 14.0.8 disk image

1. Set up a new Packages project and select Raw Package.

Screen Shot 2014-04-09 at 4.12.25 PM

2. In this case, I’m naming the project Microsoft Lync 14.0.8


Screen Shot 2014-04-10 at 1.02.18 PM

3. Once the Packages project opens, click on the Project tab. You’ll want to make sure that the your information is correctly set here (if you don’t know what to put in, check the Help menu for the Packages User Guide. The information you need is in Chapter 4 – Configuring a project.)

In this case, I’m not changing any of the options from what is set by default.

Screen Shot 2014-04-10 at 1.01.47 PM

4. Next, click on the Settings tab. In the case of my project, I want to install with root privileges and not require a logout, restart or shutdown.

To accomplish this, I’m choosing the following options in the Settings section:

In the Post-Installation Behavior section, set On Success: to Do Nothing

In the Options section, check the box for Require admin password for installation.

Screen Shot 2014-04-10 at 1.01.47 PM

5. Click on the Scripts tab in your Packages project.

Screen Shot 2014-04-10 at 1.03.13 PM

6. Select the Microsoft Lync 14.0.8 disk image and drag it into the Additional Resources section of your Packages project.

Screen Shot 2014-04-10 at 1.03.25 PM

7. The last piece is telling the Lync installer to run. For this, you’ll need a postinstall script. Here’s the one I’m using:

The logic of this script is as follows:

Since I was only successful when installing the software from the mounted disk image, mimic the environment that the disk image creates.

A. Mount the disk image
B. Run the installer from the mounted disk image.
C. Since I know the permissions will be wrong following installation, fix them to what they should be.

8. Once you’ve got the postinstall script built, run the following command to make the script executable:

sudo chmod a+x /path/to/postinstall

9. Once completed, add the postinstall script to your Packages project.

Screen Shot 2014-04-10 at 1.03.48 PM

10. Last step, go ahead and build the package. (If you don’t know to build, check the Help menu for the Packages User Guide. The information you need is in Chapter 3 – Creating a raw package project and Chapter 10 – Building a project.)

Screen Shot 2014-04-10 at 2.02.15 PM

Testing the installer

Once the package has been built, test it by taking it to a test machine that does not have Microsoft Lync 14.0.8 and install it. The end result should be that Lync installs along with the corrected permissions.

  1. Jason
    April 11, 2014 at 2:46 pm

    Thanks for posting. Works great for deploying via Casper Suite.

  2. Manny
    April 14, 2014 at 3:54 pm

    Rich, the permissions issue (502/20) appears to have been around since at Lync v14.0.6.

  3. Manny
    April 14, 2014 at 5:46 pm

    Rich, I had no trouble deploying Lync v14.0.8 in its original pkg on JAMF Casper v9.24. I received no errors, either via silent install or via Self Service onto an OSX Mavericks (v10.9.2) endpoint.
    Yes, the permissions are wrong (502/20), but installd had no trouble finding and installing the pkg.

  4. Adam
    April 21, 2014 at 4:32 pm

    Thanks for posting this. I am curious however why you just didn’t use capture the installer using Composer and edit any permissions issues from there?

  5. JHalvorson
    June 16, 2014 at 1:48 pm

    It appears that the 14.0.9 installer from Microsoft is correctly setting the ownership permissions of root:admin

    http://support.microsoft.com/kb/2963369

  6. Karthikeyan M
    June 25, 2014 at 2:02 pm

    Lync 14.0.9 installer does not add item to docks if installed via Terminal. It adds dock only when installed through GUI. Is this normal?

    • Karthikeyan M
      June 25, 2014 at 3:05 pm

      I noticed a different behaviour in Lync installer. Lync Installer has 4 packages (Lync, Dock, Meeting Point Plugin, app support). When run the installer through command line, it does not run any of the package post install script. It runs the scripts only through Installer.app. Is there any difference in Installer command and Installer.app. ?

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 164 other followers

%d bloggers like this: