notes - packaging without packaging

37
RM Seminars Spring 2013 CC4 Packages without packaging

Upload: others

Post on 03-Feb-2022

29 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Notes - Packaging without packaging

RM Seminars Spring 2013

CC4 Packages without packaging

Page 2: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 2

Introduction

Community Connect®® 4 uses Microsoft® Windows Installer Packages to deploy and install applications on to Community Connect 4 managed clients.

A Windows Installer Package is a database that contains instructions on how a piece of software should be installed and, when no longer required, removed from a computer. In this session we will look at what a Windows Installer Package is and the parts that make up a package.

Historically, you may have used the tools provided with Community Connect 4, namely RM Application Wizard and WinInstall Discover, part of WinInstall LE, to create these packages so you could manage the software installations on your computers.

In this session we will look at what these tools did and why you may have encountered problems when using Application Wizard and why you probably don’t even need to create your own packages. We will look at how you can test setup executable and Windows Installer Packages created by the software vendors themselves to see if they can be used to deploy the software to your Community Connect 4 computers.

If an installer provided by the software vendor doesn’t install and configure a piece of software the way you want it on your computers we will look at editing tools which allow you to achieve your aim.

Finally we will be looking at the next version of RM Package Blueprint and how you can use the new version to keep pieces of software, which are often updated, current on your network.

What is a Windows Installer Package?

Windows Installer is a software component used for the installation, maintenance and removal of software in Microsoft® Windows®. The installation information, and often the files themselves, are packaged in installation packages that are loosely relational databases structured as COM Structured Storages and commonly known as ‘MSI files’, because of their file extension. Windows Installer was positioned by Microsoft as an alternative to standalone executable installers in order to provide a reliable, robust installation framework that allowed for reliable uninstallation of applications when they were no longer needed.

Microsoft encourages third parties to use Windows Installer as the basis for installations, so that they synchronise correctly with other installers and keep the internal database of installed products consistent. Important features such as

Page 3: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 3

rollback and versioning depend on a consistent internal database for reliable operation. Furthermore, Windows Installer facilitates the principle of least privilege by performing software installations by proxy for unprivileged users. This means that even if a student user (or no user at all) is logged on to a Community Connect 4 client, a piece of software can still be installed using the Windows Installer service, which is a core part of Windows since Windows 2000.

The logical structure of packages

A package describes the installation of one or more full products and is universally identified by a GUID. When a Windows Installer Package is examined we can see this GUID in the ProductCode property in the Property table of the Windows Installer Package, as the screenshot below shows.

We will look at this utility, Microsoft Orca, later in this paper and how it can be used to change the behaviour of a Windows Installer package when it is used to install an application on to a computer.

A product is made up of two further parts:

• Features • Components

Features

A feature is a hierarchical group of components—a feature can contain any number of components and other features (a feature contained in another feature is called a ‘subfeature’). Many software packages only involve one feature. More complex installation programs usually display a ‘custom setup’ dialog box as part of the setup

Page 4: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 4

wizard, from which the user installing the application can select which features to install.

The package author defines the product features. For example, a word processing program might provide features for the main application executable, the applications help files and optional features such as spell checker and stationery modules.

Components

A component is the basic unit of a product; each component is treated by Windows Installer as a unit. Components can contain files, directories, COM components, registry keys, shortcuts and other data. When installing a piece of software, the user doesn’t interact with components as they would with Products and Features; the Windows Installer service manages these.

Components are identified globally by GUIDs, and because of this the same component can be shared among several features of the same package or multiple packages. Similarly, if a component is used by multiple packages, it can’t be removed by one of the packages because it is identified as being used by another application.

What does a Windows Installer Package do?

Windows Installer Packages are used by the Windows Installer Service (called msiexec.exe). This is a service which has been a core part in the operating system since Microsoft Windows 2000 (although it was available for installation on other versions of Microsoft Windows as it was included as an installer with Microsoft Office 2000) and the most current version is v5.0.9200.16384 which is part of Microsoft Windows 8. When an application is to be installed by the Windows Installer service, the location and the name of the Windows Installer Package are passed to the Windows Installer Service along with any switches needed during package installation. Later in this paper we will look at what these switches are as

Page 5: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 5

they are useful when using a third party Windows Installer Package on a Community Connect 4 network.

When a package is assigned to a managed client using the RM Management Console, the details of the Windows Installer Package location and any switches are passed to the Windows Installer Service. One of the switches passed tells the service to install the application silently. We wouldn’t want an application’s setup interface to be displayed during installation that would disrupt the user. Sometimes, for various reasons, despite these arguments being passed to the Windows Installer Service, the setup may still be displayed on screen. This is known as the installation ‘going interactive’ and there may be other options we need to pass to the Windows Installer Service to prevent this from happening. These options will be explored later in this paper.

Installing applications on a Community Connect 4 client

Most applications are centrally deployed using the RM Management Console to deploy, on the main, Windows Installer Packages. It is possible to also use setup executables to centrally deploy an application. There are a few more things we need the executable to support that needs to be checked before deploying through the RM Management Console which will be examined later in this paper. On the properties of a package in the RM Management Console, you can see whether an application is installed using a Windows Installer Package or an executable.

The Community Connect 4 components that manage installations of applications include:

• CompMan Computer Manager gets the details of computers that a package is going to

Page 6: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 6

be assigned to.

• RepoMan Repository Manager manages the package repository, the ‘master’ repository on the Community Connect 4 First server.

• Installation Agent Installation Agent manages the installation of the package.

• PackMan Package Manager is used to manage a local database on each computer which records the package installation state. This information is then passed back to the CC4 database so that we can accurately see the installation status of the package work.

• LocMan Location Manager is used to gather information about the location the computer exists in. During computer build, Location Manager gets the information for the packages assigned at the location level.

• JobMan Job Manager does what it says on the tin; it creates and manages the package job. It uses some Microsoft technology at this point which we look at later when we create a package assignment task.

• CommandExec The Command Executor runs and manages the package assignment tasks, calling other CC4 components (like Installation Agent) when necessary

• SiteMan Site Manager is used where a Community Connect 4 network is ‘multi-site’, where we have the network split over disparate locations and packages are copied from one server to another, at another site, to allow package assignment to take place at remote locations.

This component receives the installation task from the Command Executor which reports it progress (which it in turn receives from the Windows Installer service), which is then reported back so the network support team can view the package installation status in the RM Management Console. In this white paper we won’t be examining the package installation process Community Connect 4 goes through, however slides are available in the RM Knowledge Library for the autumn 2011

Page 7: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 7

session ‘CC4 Package Troubleshooting’ which can be downloaded from the following RM Knowledge Library article:

http://www.rm.com/support/GeneralDownload.asp?cref=DWN2312640

What does RM Application Wizard do?

We have seen that applications are installed on to Community Connect 4 managed clients using Windows Installer Packages (the majority of the time) and the tools that are provided with Community Connect 4 allow you to create your own packages. The tools that we provide are:

- RM Application Wizard - OnDemand Discover (This is part of an application suite called WinInstall LE.)

RM Application Wizard is a simplified front end for OnDemand Discover. Because a lot of the information that Discover requires is the same, RM Application Wizard simply pre-populates that information and prompts you for the dynamic data, such as the name and description of the package and its location.

RM Application Wizard is actually a repackaging tool. Because of the way it works, using snapshots, it simply repackages an application in to a Windows Installer Package. This can be a disadvantage because the installer that OnDemand Discover creates doesn’t contain any logic – you could say it is flat because it simply takes files, registry settings, .ini file entries, and so on, and copies them to the target computer. It doesn’t handle any logic.

For example, a Windows Installer Package created with a professional packaging tool could contain the logic:

“If QuickTime is installed on the computer then don’t install it as part of this operation”.

Whereas this logic is lost in a package created with OnDemand Discover. Its logic is very simple:

“Copy the files and settings from the source to the destination.”

Meaning that if QuickTime was captured when we created the package, it would still be installed regardless of whether it was already on the destination computer or not.

When creating packages the network support team have to be extra careful about what they do in between the snapshots, when the ‘Warning! Package build in progress.’ dialog box is displayed.

Page 8: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 8

Anything that is carried out on the computer whilst this dialog is being displayed runs the risk of changing files or settings, which can then become part of the finished package.

You can help to minimise the risk of this by:

1. Before creating the package, install the application locally to familiarise yourself with it. Namely, where it installs, what it installs and anything you would need to configure in between the snapshots taken by the OnDemand Discover tool.

2. Following RM best practice by creating the package using a clean computer.

3. Using the PackageBuilder user account to create the package, which should have had its profile cleaned prior to beginning the repackaging process.

4. Prior to starting the package creation process, ensure any file and registry locations which may change during the package creation process which you don’t want to be part of the finished package be added to the files.xcp and reg.xcp files in the Windows folder on the computer. (We modify this file to exclude folders and areas of the registry to be excluded on a Community Connect 4 computer.)

5. Only running the setup program after the first snapshot has been taken.

Despite following all of the above it is inevitable that unwanted files and settings are likely to be captured. Post package creation, the Windows Installer Package that has been created can be cleaned using another tool supplied on Community Connect 4 networks, the OnDemand Software Console, however in most cases this very rarely happens.

Page 9: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 9

The OnDemand Software Console allows you to modify the contents of a Windows Installer Package created with the Discover tool. Specifically, it allowed you to remove Features and Components from a package you had created. To remove any of these you had to do this by removing the GUID for what you wanted to remove, which meant you had to manually search through the package to locate this identifier – there isn’t the ability to search a package for a filename, for example. This was one of the reasons why Windows Installer Packages were never edited once they had been completed.

As we will see in this paper there are often better, and easier, ways to add application installers to your Community Connect 4 network without having to repackage the setup program using RM Application Wizard and OnDemand Discover.

64-bit operating systems and RM Application Wizard

Windows 7 Professional 64-bit is now available for Community Connect 4 networks. In early 2013 we will also be releasing Community Connect 4.4, which offers Windows 8 Professional and Windows 8 Enterprise operating systems as a full computer build option. Many schools are looking to move to a 64-bit operating system because it offers many advantages:

- The ability to have far more RAM installed in computers.

- Applications written for a 64-bit CPU can run quicker than the same software written for a 32-bit operating system. This is often advantageous where an application requires a lot of processing power, for example graphics applications.

- Kernel Patch Protection is available in the 64-bit operating system. Kernel Patch Protection prevents another application modifying the Windows

Page 10: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 10

Kernel. This feature works by helping to prevent a kernel-mode driver from extending or replacing other kernel services. Also, this feature helps prevent third party programs from updating (patching) any part of the kernel.

An important consideration if you are looking to move to 64-bit operating systems in your school is related to repackaging applications. The tools that are part of WinInstall LE that RM Application Wizard uses to repackage software will not work on a 64-bit operating system.

This isn’t to say packages that have been created using the OnDemand tools won’t work on a computer running a 64-bit version of Windows; it is only the repackaging tools that don’t work.

If you are looking to move to 64-bit operating systems then you may want to consider running two computers with a 32-bit version of Windows so that these can be used to repackage applications. Of course, the option to build computers with a 32-bit operating system will still be available in Community Connect 4, but you will have to build this time in to the repackaging process when you want to add new applications to your network. Later in this paper we will look at an alternative repackaging tool which, while not working with RM Application Wizard, will allow you to repackage an application on a computer running a 64-bit operating system.

Centrally deploying applications with an executable

Many applications can be installed using an executable, usually called setup.exe. When the executable is launched, a setup wizard guides you through installing the application on to a computer.

It may be possible to use this executable to deploy the application to Community Connect 4 computers rather than repackaging it, however the executable has to install the application the way users will want to use it and be configured correctly for the Community Connect 4 computer. Common settings that should be configured include:

• Does the application install in to the Program Files folder? Community Connect 4 computers are configured to allow all applications to launch from the Program Files folder. As we are not controlling this we should note where the application installs. Ideally we want it to install in to this location, but if it doesn’t this is an insurmountable problem because we can modify the Software Restrictions Policy to allow the application to run – an easier task then repackaging the entire application!

Page 11: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 11

• Any files opened or saved to the user’s home folder. The application can obtain these settings from the registry because on a Community Connect 4 computer we have configured the home folder (My Documents or Documents) to be the N: drive. If the application doesn’t default to this location for opening and saving files, you may be able to override the default settings by making a change to the shortcut to the application and changing the ‘Start in’ property of the shortcut to the N: drive.

• The language should be UK English. Many applications have the language set to US English but again, if these settings are taken from Windows then they should be configured to use the correct language.

• It shouldn’t overwrite file associations. The application shouldn’t overwrite file associations for applications which are already installed (unless of course you want them to). For example, most schools use Microsoft® Word® and use that application to open .doc and .docx files. It is unlikely that we would want another application to open these files.

• Additional applications shouldn’t also be installed. Many applications, particularly multimedia ones, have application dependencies. An application dependency is an additional piece of software the application you are adding to the network needs in order to run correctly. These dependencies should be managed separately and well-made setup programs should detect that this piece of software is already installed rather than simply installing it. This is an example of the logic that should be built in to the setup program. It may be that you have to ensure the application dependency is already installed on the computer before assigning the package containing the executable you have added to the Community Connect 4 network.

The above list isn’t exhaustive and this highlights the need to test that the executable you want to add to Community Connect 4 as a package behaves as you would expect so that in the long term this saves you time.

Page 12: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 12

Windows Installer Packages bundled with executables

It is more and more common to see a Windows Installer Package bundled within a setup executable. There is a quick tip to identify if a setup executable contains a .msi file. When you launch the setup executable, if you see the following dialog box before the setup wizard starts:

Then the setup executable has extracted a Windows Installer Package. You may be able to use this Windows Installer Package in Community Connect 4 to centrally deploy the application, rather than repackaging it or using the setup executable you are currently looking at.

Extracting a Windows Installer Package from a setup executable

There are at least two ways you can extract a Windows Installer Package from a setup executable.

In most scenarios, a Windows Installer Package that is contained within a setup executable is extracted to the following temporary folder:

C:\Users\<username>\AppData\Temp

You can quickly browse this folder by typing in the Windows Explorer address bar:

%temp%

Note: You can confirm where the temporary folder is by opening a command prompt and typing in: echo  %temp%

You can extract the Windows Installer Package from the setup executable by following these steps:

1. Launch the setup executable from the installation location.

2. When the setup wizard starts, browse to the temporary folder location %temp% and explore any folders in there, which have the name of a GUID.

Page 13: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 13

3. Locate the Windows Installer Package and copy it to a new location, for example your home folder.

4. In the setup wizard, cancel the installation.

If you still have Windows Explorer open you will notice the folder that contained the Windows Installer Package disappears. This is another benefit of Windows Installer setups, they remove any temporary installation file once the installation completes or is cancelled. You can now attempt to use this Windows Installer Package to deploy the software using the RM Management Console to other computers on your network.

If for some reason you are unable to locate the Windows Installer Package in a temporary folder then you may be able to extract it using a file compression program.

7-zip is one of the most popular file compression utilities available today. It is a free utility and can be downloaded using the following URL:

http://www.7-zip.org

7-zip allows you to open a setup executable and browse its contents. Using 7-zip you may be able to open the setup executable which is supplied to install an application and then extract the Windows Installer Package to another location where you can then begin to test whether it can be used to deploy the application using the RM Management Console.

Using a setup executable to deploy applications

Of course, not every setup executable includes a Windows Installer Package inside it and it is the executable itself that performs the installation of an application. This doesn’t necessarily mean we have to repackage the executable so it can be deployed using the RM Management Console because Community Connect 4 can install applications using an executable, but our key concern should be preventing any executables used to install applications not going interactive. Remember that when an installation goes interactive it either displays something on screen or expects an input from the user. Because Community Connect 4 installs applications silently in the background, an application could be installed while a student or teacher is logged on to the computer. Additionally, the network support team do not want to have to visit every computer on the network to enter the required information in to the setup program.

Page 14: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 14

Setup program switches

Many setup executables allow you to pass switches, or parameters to them. Parameters manipulate what happens during the installation, for example whether to install the application silently or to pass additional information, such as a product key, to the setup program.

You can check if a setup executable supports switches by following these steps:

1. On a computer, log on as an administrative level user and open a command prompt.

2. Navigate to the location where the setup program is located and type in:

<Path  to  executable>\<Setup  Program  Name>.exe  /?  

E.g.:

    N:\Application\Setup.exe  /?  

Any supported switches, and their description will be displayed in the command prompt window.

Setup programs and switches – an example

Let’s take a look at how we can use a setup program on a Community Connect 4 network to centrally deploy and install an application.

Microsoft® Silverlight® is a multimedia plugin which allows rich media to be played in a web browser in a similar way to Adobe® Flash® Player. Silverlight can be downloaded from the following URL:

http://www.microsoft.com/silverlight/

And from this website you can download the Silverlight installer which is an executable, available as a 32-bit or 64-bit version for Microsoft Windows (a version is also available for Mac OS X).

You could attempt to repackage the installation executable using RM Application Wizard and OnDemand Discover, however when the installer is launched from a command prompt using the /? Switch, then the following dialog is displayed:

Page 15: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 15

We can see there are two switches that can be used with the installer:

/q Installs Silverlight silently without requiring any user interaction.

/qu Performs a silent uninstall of Silverlight, again without the need of any interaction with a user.

We will look at the silent uninstall option later because this is relevant if we want to remove Silverlight from a computer.

Testing silent installations using an executable

It is always important that before adding an executable installer to Community Connect 4 for centralised deployment, we test that when an application is installed silently it installs the application as we want it to be installed on the Community Connect 4 client. You should never simply add this to Community Connect 4 using the RM Management Console and deploy it to all the computers – this could have an unexpected consequence and could cause damage to the computers it is installed on and, in a worse case scenario, require them to be rebuilt.

Testing a silent install is quite simple on a Community Connect 4 computer, open a command prompt and enter the name of the installer and the switch to perform a silent install.

Note: It may be advantageous to take a restore image of the computer you are testing the installer on so that, should the computer require rebuilding, it can be restored in a far shorter period of time.

Using Silverlight as an example, from a command prompt you would enter:

  Silverlight.exe  /q  

If the silent install works as expected, there shouldn’t be any information displayed on the screen of the computer during installation. During normal deployment this would be fine, however in this testing phase we need to make sure that the application has installed correctly. If this is an application that users will launch from the Start menu then you can simply launch the application and test that it works as expected. As Silverlight is a plugin there isn’t any way to launch the application

Page 16: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 16

itself. It is possible to check that Silverlight is installed on a computer by visiting the following website:

http://www.microsoft.com/getsilverlight/get-started/install/

If Silverlight has installed correctly, the following will be displayed showing the version of Silverlight that is installed on the computer:

Adding a setup executable to Community Connect 4

Once it has been confirmed an application can be installed silently using the supplied executable, we can now add it to Community Connect 4 so it can be centrally deployed to CC4 managed clients using the RM Management Console.

We can add an executable to Community Connect 4 using the Import Package method available in the RM Management Console. This method allows you to import packages from either a Community Connect 4 or Community Connect 3 network; however we can also tell the RM Management Console to import an executable.

Before using this method you need to make sure that the setup executable and any files that this needs are in a folder on their own. The reason why you need to make sure you do this is that when the executable is imported in to the Community Connect 4 package repository, it performs a file copy of the executable itself, and any other files that are in the same folder as the setup program. If the executable was in the SystemAdmin’s home folder when the executable was imported, it would also add the entire contents of the home folder as well – probably not what we want to happen!

I would also recommend you create a ‘package.ini’ file and add that to the folder where you have copied the setup executable and any associated files. The reason you create this is you can give the package a meaningful name in the RM Management Console. Without the .ini file, the package name in the RM Management Console will be the name of the setup executable, which would be fine if its name was ‘Application.exe’ however often it will have a generic name, for example ‘Setuup.exe’.

A package .ini file for an executable looks like this:

Page 17: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 17

[Package]

Name=The name of the application.

Description=A meaningful description of the application.

Version=1.0.0.0  

OS=5.WS,6.WS  

EXEFile=<The name of the setup executable>.exe

You can create this file using Notepad and then save it as a .ini file by saving the filename in speech marks. For example:

“MS Maths.ini”

Note: The name of the package is taken from the file name of the .ini file.

To add an executable to Community Connect 4, follow these steps:

1. In the RM Management Console, from the File menu, choose Import and then Package.

2. In the Import Package dialog box, select Community Connect 3 from the Package Type options.

3. Click on the Browse button, which will display the Open window. By default, the Open dialog box will only display CC3 Metadata files. If you have created a .ini file then select this and move to step 5.

4. From the File Type drop-down box, select All Files (*.*). The dialog box will now display all the files in the selected folder.

5. Browse to the location where the setup executable (and optionally .ini file) is located. Select it and click the Open button.

6. Place a tick in ‘Show package properties after importing’ and click OK. The setup executable is now imported in to the Community Connect 4 package repository and the package properties will then be displayed in the RM Management Console.

Configuring the executable to install silently

Page 18: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 18

When the package was imported in to the RM Management Console we told it to display the package properties after the executable had been imported in to the package repository. This was because after adding the executable we need to configure it with switches that will allow it to be installed silently.

Note: If a tick isn’t placed in the ‘Display package properties’ box before importing the package, then locate the package in the RM Management Console and double-click it to display the properties once it has been added to the package repository and can be viewed in the RM Management Console.

Silverlight is the example application used in this white paper and in order to perform a silent installation, the /q switch must be used with the setup executable.

Earlier, we saw we were able to pass the /qu switch to the Silverlight installation executable. If this switch is used then a silent uninstall is performed. This is useful if the network support team need to remove or upgrade the version of Silverlight installed on the computer.

In the package properties there are options to add additional command line arguments:

1. In the Package Properties dialog box, select the Contents tab and in the ‘Command line arguments’ section of the tab, in the Installation field, add /q.

2. In the Uninstallation field, add /qu.

3. Click OK and if you are prompted to provide a new version number for the package, increment the version number by 0.0.0.1.

4. If you are asked if you want to upgrade the computers where the old version of the package was assigned, click No.

The setup executable has now been added to the Community Connect 4 network with the package configured with the correct switches so a silent install can be performed on Community Connect 4 managed clients.

Adding shortcuts to the package

Once the application installer has been added to the Community Connect 4 network there is some additional work that needs to take place so the shortcut can be added to a Program Set. This allows the application to be launched by users once it has been assigned and installed to a computer, and also allows the network support team to test the application once it has been assigned to a computer.

Page 19: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 19

The shortcut for the application needs to be copied from the Start menu on a computer in to the package and you may be familiar with this process from the repackaging process you will have already done before using RM Application Wizard. The steps for adding the shortcut to the package are as follows:

1. Assign the package to the computer you want to copy the shortcut from.

2. Once the application has installed, locate the shortcut on the Start menu, right-click on it and choose Copy.

Note: On a Windows 8 Community Connect 4 computer, browse to the location using File Explorer where the shortcuts are located: %Appdata%\Microsoft\Windows\Start Menu\Programs and copy the shortcut from there.

3. Paste the shortcut to a location, for example the home folder.

4. In the RM Management Console left-hand pane, expand Software,

‘Packages and Products’ and click Packages.

5. Locate the package and double-click it.

6. On the Shortcuts tab, choose Add and browse to the location where you pasted the application shortcut in step 3 above.

7. Select the shortcut and click Open.

8. Click OK in the package properties box and when prompted to provide a new version number for the package, increment the current version by 0.0.0.1. When asked if you want to update any computers where the package is already assigned, click Yes.

Note: You can delete the old version of the package from the RM Management Console once the computer where the previous version of the package has been assigned.

9. Add the shortcut to a relevant Program Set, or create a new one as required.

Page 20: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 20

One of the checks that the network support team should have carried out before adding the setup executable to Community Connect 4 was to make sure the application opened and saved files to the user’s home folder. If the application doesn’t then it may be possible to overwrite the default settings by modifying the Start In property of the application’s shortcut. Before adding the shortcut to the package, in step 6 above, modify this property of the shortcut, replacing or adding this property as N:\.

Testing the application

Once the setup executable and the shortcut have been added to the RM Management Console so it can be assigned to Community Connect 4 computers, you should test that the application works as expected. You should consider the following when testing the application:

• Does the application work with the most restrictive computer security level?

• Does the application work as different types of users, specifically student and teacher users?

In most secondary schools, the computer security level for Community Connect 4 computers is Standard. This configures NTFS permissions on computers so that most areas of the file system and registry are protected, yet let most applications run successfully.

It is common practice for the network support team to have example user accounts for teachers and users and these should be used to test the application works. Test that the application works by logging on to the computer as these types of user and run the application and make sure it is configured as you would expect.

Centrally deploying applications with their own Windows Installer Package

As we have already seen, Windows Installer Packages are becoming the most common way for software developers to distribute software for installation, either on a standalone computer or across a network. Because Microsoft have built the technology in to Windows which allows these installers to be used to install applications quickly and easily, it reduces the time for developers to create installers and allows them to be robust when it comes to installing, uninstalling and repairing application installations.

When evaluating a new piece of software you want to add to your Community Connect 4 network, the first thing you should do is check if a Windows Installer

Page 21: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 21

Package is included with the installation files. Often, this is simply a case of searching the installation media for any files that end with the .msi file extension. Alternatively, if there is only a setup executable, use the steps on page 12 to check if a Windows Installer Package is included in the executable by either double-clicking on the .exe to see if you get the Windows Installer dialog or using a utility such as 7-zip to see if you can extract a Windows Installer Package from the executable itself.

Installing an application using a Windows Installer Package.

Like many setup executables, it is possible to pass switches to the Windows Installer Service – in fact, there are several mandatory switches that need to be passed to the service so it can install an application. You can view the switches available for Windows Installer Packages by entering:

  msiexec.exe  

in a command prompt. When you do this, the following dialog box is displayed:

The complete list of arguments that can be supplied to the Windows Installer Service can be found in the following Microsoft Knowledge Base article:

http://msdn.microsoft.com/en-us/library/windows/desktop/ aa367988(v=vs.85).aspx

Using the information from the Microsoft article, we could perform a silent installation of a piece of software using a Windows Installer Package. Using the example of 7-zip, the file compression utility we have already looked at in this paper, we can install this software silently with the following command-line:

msiexec  /i  7z920-­‐x64.msi  /qn  

The /i argument is used to tell the Windows Installer Service the name of the Windows Installer Package to use (in this example it is for the utility 7-zip and is called 7z920-x64.msi).

Page 22: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 22

The /qn argument tells the Windows Installer Service to perform a silent installation with no user interaction (q) and with no user interface (n).

The /i switch is the minimum parameter for the Windows Installer Service and would allow it to install the application. If this is the only switch used then the setup wizard for the application would start on the computer and the user would have to complete the wizard before the application will install – it will go interactive.

When an application is assigned to a computer using the RM Management Console using the Community Connect 4 components which assign and install the package, the above two switches are automatically passed to the Windows Installer Service on the target computer. This will install the package and should prevent the package from going interactive. This may not be the case however if the Windows Installer Package expects additional information, this could be a product key for example. This is where the additional switches can be used.

This is the first test that should be carried out when looking to use a Windows Installer Package supplied by the software vendor to assign applications to computers. The network support team should, first of all, make sure that the Windows Installer Package will install silently without going interactive.

When we assign a package using Community Connect 4, the additional switch:

/L  v %ProgramFiles%\Research  Machines\Network  Management\  AppAgent\MSI  Logs\    

is also passed to the Windows Installer service. This switch generates verbose log files for package install and uninstalls in the path which is also supplied. These can be used for troubleshooting if an application doesn’t install or uninstall as we would expect. These can be used in conjunction with the Community Connect 4 log files which are generated based on the LogLevel settings configured in the computer’s registry.

In the RM Management Console you have four options for package assignment. These are:

- Assign - Unassign - Repair - Reassign

The Assign option installs the application. This would be used the first time an application is deployed to a computer. Unassign does the opposite, it removes the application from the computer by passing the following switches to the Windows Installer Service:

Page 23: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 23

msiexec  /x  <Package  Name>.msi  /L  v  <Path  to  log  file>  

The Repair option performs a Windows Installer repair of an application that is already installed. If a Windows Installer Package is used to install an application, and the .msi file is launched again, you often see the following dialog box:

The Repair option takes advantage of one of the benefits of Windows Installer Packages – because every file and setting can be easily identified by its GUID, if a file is replaced, deleted or becomes corrupt then it can be easily replaced by the Windows Installer Package which originally installed it. When Repair is selected in the RM Management Console, any missing files or settings are replaced with those from the Windows Installer Package. The parameters passed to the Windows Installer Service are:

msiexec  /f  <Package  Name>.msi  /L  v %ProgramFiles%\Research  Machines\Network  Management\AppAgent\MSI  Logs    

Finally the Reassign option performs a full installation of the application again. As we can see from the above, this often isn’t an option when the Windows Installer Package is launched again. Essentially what happens on Community Connect 4 are two commands are sent to the target computer – the uninstall command followed by the Install command:

msiexec  /x  <Package  Name>.msi  /L  v %ProgramFiles%\Research  Machines\Network  Management\AppAgent\MSI  Logs    

msiexec  /i  7z920-­‐x64.msi  /qn  /L  v %ProgramFiles%\Research  Machines\Network  Management\AppAgent\MSI  Logs    

Community Connect 4 therefore uses the technology built in to the Windows operating systems supported on the network alongside the components that are controlled by the network support team through the RM Management Console.

Page 24: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 24

Adding a Windows Installer Package to a Community Connect 4 network

If the application we want to add to our Community Connect 4 network is supplied with a Windows Installer Package, then it is a very similar process of adding it to the package repository so it can be assigned across the network using the RM Management Console as it is for adding an executable.

First of all make sure the Windows Installer Package and any associated files are located in the same folder (remembering that when the Windows Installer Package is added to the package repository the Windows Installer Package itself and any other files in the same folder will also be added). From the RM Management Console, import the package using the same method as on page 16 above.

You can optionally create a package .ini file as we saw earlier for Windows Installer Packages as this allows us to give the package a meaningful name when displayed in the RM Management Console. The format of a package .ini file for a Windows Installer Package is:

[Package]  

Description=A  description  of  the  package  and  its  information  

Version=1.0.0.0  

OS=5.WS,6.WS  

WIPackage=<MSI  Name>.msi  

Again, as with an imported executable, you would need to add the shortcut for the application to the package in the RM Management Console so it can then be added to a Program Set and tested by the network support team as a student and teacher user.

Editing Windows Installer Packages

Unlike setup executables it may be possible to edit Windows Installer Packages that have been provided by a software developer. It may be possible to edit the supplied Windows Installer Package so that it meets the needs of the Community Connect 4 network and the network support team. Most of the time a Windows Installer Package will work without the need to make changes to it. However there may be a need to add additional information to it so that it makes it the silent installation and easier and prevents it from going interactive.

We aren’t suggesting here that the logic of the Windows Installer Package is changed significantly, but adding additional information to the Windows Installer

Page 25: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 25

Package so it works correctly on the Community Connect 4 network. These additional settings could include:

• Adding a product key for licensing purposes.

• Adding a proxy server (however bear in mind that this requires changing if for some reason these details change in the future – the preferred way to add these settings would be from a Group Policy Object).

There are three ways that the behaviour of a Windows Installer Package can be modified:

• Setting public properties as switches.

• Creating a Microsoft Transform (.mst) file. • Directly editing the Windows Installer Package using a packaging tool.

Windows Installer Package public properties

As we have already seen, a Windows Installer Package is a table where the properties for it are listed. In the screenshot below you can see the table in Microsoft Orca:

There are two types of properties in a Windows Installer Package – private and public properties. You should never modify the private properties of a Windows Installer Package as this can affect the functionality of an application, or the installation itself may fail. However it is fine to make changes to the public properties of a Windows Installer Package.

It is easy to recognise private and public properties. A private property’s name is in lower case whereas a public property’s name is in upper case.

If we look at the Windows Installer Package for 7-zip, we can see a public property in the Windows Installer Package:

Page 26: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 26

In the screenshot above we can see the property:

ARPURLUPDATEINFO

and its property value is:

http://www.7-zip.org/download.html

The property name and what it does is quite easy to understand – this is the URL that 7-zip uses to check for software updates. On a Community Connect 4 network it isn’t recommended that an application allows the option for checking for software updates. This may prompt a user to update the application and because most of our users on a Community Connect 4 network are restricted, the update may fail, or even worse, fail to install an update successfully breaking the application itself.

Other common properties include controlling the setup wizard or the ability to add a product key in to the Windows Installer Package itself.

Rather than editing the Windows Installer Package itself, these public properties can be added as switches to the properties of the package when it is being installed. If we were performing a silent installation of 7-zip from the command line and wanted to remove the URL for 7-zip’s update web address we would use the following:

msiexec  /i  7z920-­‐x64.msi  /qn  ARPURLUPDATEINFO=  

On a Community Connect 4 network, we would add public properties to the Command-line arguments section of the package properties in the RM Management Console:

Page 27: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 27

When the package is assigned to a computer, these additional properties, on top of the /i and /qn properties would also be passed to the Windows Installer Service.

Creating a Microsoft transform file

Another way to modify how a Windows Installer Package installs is to create a Microsoft transform file.

A Windows Installer transform (.mst) file provides configuration settings for a customised application installation. A transform file contains information about components, features, setup properties and changes that you can use to customise the installation of an application. If a Windows Installer Package installs a suite of applications, you could use a single transform file to configure the installation state you want for the applications you want to be installed. For example, if you only wanted to install one of the suite of applications you could use a transform file to instruct the Windows Installer Package to do this.

Transform files can be created with a free utility from Microsoft called Orca. Orca is part of the Windows Installer Software Development Kit (or SDK). The entire SDK can be downloaded from the Microsoft website here:

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

It is advisable to download the entire SDK even if you just want to use Orca as this ensures you have the most up-to-date version available from Microsoft.

In this example we will use Microsoft Orca to create the transform file however there are many other tools available which allow you to do the same.

In this example we will remove the shortcut that is added to the Start menu when 7-zip is installed on to a computer:

1. Open the Windows Installer Package using Orca and from the Transform menu choose New Transform.

Page 28: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 28

You will notice the title in Orca changes to show you are now editing a transform file.

2. In the left-hand pane, click on Shortcut and in the right-hand pane the shortcuts added to the Start menu are displayed.

3. Right-click on each of the entries (called rows) in the right-hand pane and choose ‘Drop row’.

And confirm you want to remove this row from the Shortcut table by clicking OK.

Page 29: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 29

You will notice that the row you have just dropped now shows with a line through it.

4. Repeat this for any other rows in the Shortcut table until they are crossed out.

5. Once you have made all the changes, from the Transform menu, choose Generate Transform …

6. Save the transform file with the same name and in the same location as the Windows Installer Package. You will now have everything you need to perform a customised installation of your application.

Page 30: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 30

If we were performing a silent install of 7-zip from the command line, the following would be entered in to a command prompt:

msiexec  /i  7z920-­‐x64.msi  /qn  TRANSFORMS=7z920-­‐x64.mst  

The application will be installed silently without any shortcuts being added to the Start menu, because the Windows Installer Service will use the original Windows Installer Package but apply the settings from the table in the Microsoft transform file.

Using Transform files in Community Connect 4

Once you have imported a Windows Installer Package in to the package repository so it appears in the RM Management Console and can be assigned to computers, you aren’t able to modify the package property that specifies a transform file is to be used. Of course, the network support team would know if a transform file is needed before importing it because it would have been tested to make sure the application installs correctly (and this is where the need to use a transform file could come from!).

In order to import a Windows Installer Package and a transform file in to Community Connect 4 we need to make use of the package .ini file we looked at earlier. There is an entry we can add to the package .ini to specify a transform file is to be used when assigning and installing a package on to a Community Connect 4 computer. The entry needed in the package .ini is:

  WITransform=  

So if the Windows Installer Package and transform file was going to be imported in to Community Connect 4, the package .ini file would look like this:

[Package]  

Description=A  description  of  the  package  and  its  information  

Version=1.0.0.0  

OS=5.WS,6.WS  

WIPackage=<MSI  Name>.msi  

WITransform=<MST  Name>.mst  

Once the folder structure for a Community Connect 4 package has been created and the package .ini created, using the above as an example, we can import the package in to the package repository following the steps we have already seen. When the package is imported, the transform file will also be added and can be seen in the package properties:

Page 31: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 31

Transform files can be used to modify any part of the installation but, as always, you should always thoroughly check that the application is installed and functions as users would expect before assigning to computers on the Community Connect 4 network.

Windows Installer administrative installs

Another option for customising the installation of an application using a Windows Installer Package is to perform an administrative install.

An administrative installation of an application creates a new Windows Installer Package based on the responses to the install wizard that the Windows Installer Package creates. This is useful if, for example, a Windows Installer Package installs additional software alongside the application itself (application dependencies).

By creating a new Windows Installer Package based on the responses to the setup wizard, the installation of these application dependencies could be suppressed meaning that they won’t be installed on Community Connect 4 computers as these dependencies should be managed separately.

If supported, an Administrative install is carried out by using the /a switch as a parameter with the Windows Installer Service, msiexec. Using the application, Microsoft Auto Collage as an example, the full command would be:

  msiexec  /a  MicrosoftAutoCollageSetup.msi  

An administrative installation installs a source image of the application onto the network in the folder specified as part of the setup wizard along with a new Windows Installer Package.

Page 32: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 32

Once the wizard has completed the administrative install a dialog box will be displayed confirming that a network image has been created.

The Windows Installer Service hasn’t installed the application but created a network image, containing all the required files to install the application and a Windows Installer Package to install the application on a computer using these source files.

Page 33: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 33

Although this is designed to be stored on a network source where users can install the application, the Windows Installer Package and the files can be imported in to the package repository using the RM Management Console, which can then be used to assign the package to a computer for testing before finally assigning the package to computers where the network support team want the application to be installed.

Not all Windows Installer Packages provide the ability to perform an administrative installation of an application, but it is something that can be tested when looking to add an application to the Community Connect 4 network.

RM Package Blueprint Templates

For many years we have offered you Windows Installer Packages that have been designed and tested for use on a Community Connect 4 network. Initially we offered Curriculum Choice Packs which provided a Windows Installer Package and if required Virtual CD images, which were added to the Community Connect 4 network using the RM Installation Assistant. Whilst these packs were useful we were often limited with licensing restrictions because in order to provide a Curriculum Choice Pack we had to redistribute an application, which required agreement from the software developer.

Later, we offered RM Package Blueprint. RM Package Blueprint removed the need to redistribute an application because this method of creating a package designed for Community Connect 4 required the software to be provided by the school and, using WiX technology, RM Package Blueprint creates the Windows Installer Package and added it to the package repository so it could be assigned to computers on the Community Connect 4 network. Whilst this process works fine there was often a delay from an application being released to the RM Package Blueprint becoming available.

This became especially apparent when applications are regularly updated. Applications such as Adobe Flash Player are regularly updated; sometimes only a few weeks would pass in between updates (see http://www.snapfiles.com/ apphistory/flashplayer_history.html for the release history of Adobe Flash Player for the last two years updates!). These updates are often recommended because they patch security vulnerabilities in the application, as well as adding new features that other applications may rely on.

RM Package Blueprints would only work with the version of an application that it was built for. An RM Package Blueprint designed for v11.502.135 of Adobe Flash Player wouldn’t work with v11.502.146 – the network support team would need to wait for us to create the RM Package Blueprint before it could be updated on the Community Connect 4 computers.

Page 34: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 34

Introducing RM Package Blueprint Templates

RM Package Blueprint Templates are an evolution of RM Package Blueprints. They help you to keep applications and plugins up-to-date easily by making installation and distribution of these packages quickly and easily.

An RM Package Blueprint Template is not version specific which allows the network support team to keep these regularly updated applications and plugins up-to-date quicker.

The list of RM Package Blueprints and the new RM Package Blueprint Templates can be downloaded from the following web page in the RM Knowledge Library:

http://www.rm.com/Support/NewsAndAlerts.asp?cref=NWS3050833

Using RM Package Blueprint Templates

As we have seen, RM Package Blueprint Templates allow you to keep applications and plugins up to date far more quickly than you have been able to in the past.

In order to use RM Package Blueprint Template, you will need at least the following:

• The installer for the application you are going to use with the RM Package Blueprint Template.

• The RM Package Blueprint Template that is available to download from the RM Knowledge Library.

Each RM Package Blueprint Template will have specific instructions on how to add the package to your Community Connect 4 network, but where the application provides a Windows Installer Package that can be assigned to a Community Connect 4 network as is, or with a Windows Installer .mst file, then the RM Package Blueprint Template contains the structure of a package plus a package configuration file, which can be reused when updated versions of the application are supplied by the software developer.

The package structure is the same as a Community Connect 3 package, which you may be familiar with:

In the version folder we have provided a package.ini file that contains the following information:

Page 35: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 35

[Package]  

Description=A  description  of  the  package  and  its  information  

Version=1.0.0.0  

OS=5.WS,6.WS  

WIPackage=<MSI  Name>.msi  

The steps to using the RM Package Blueprint Template are as follows:

1. Extract the RM Package Blueprint Template to the following location: \\<CC4 First Server>\RMPackages\Applications

2. Rename the package folder to reflect the name of the application and the version, e.g. Adobe Flash Player 11.2.202.233

3. Rename the <package>.ini file to the name and version of the application you have downloaded (this should be the same name as the package folder above).

4. Edit the <package>.ini file so that the wipackage section contains the name of the Windows Installer Package you have supplied.

5. Copy the Windows Installer Package in to the folder v1.0.0.0 .

6. In the RM Management Console, follow the steps from the previous examples of working with setup executables and Windows Installer Packages to import a Community Connect 4 package in to the package repository so it is available for assigning.

7. Assign the package to a Community Connect 4 computer, copy the shortcut in to the package following the steps in this white paper and add it to a Program Set.

8. Test the application as a student and teacher user to make sure it works as you would expect.

When an incremental version of the application you have used the RM Package Blueprint Template for is released, then the above steps can be repeated to add the updated version of the software to the Community Connect 4 network. It is

Page 36: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 36

important you provide the new package you are adding with a different name to previous packages in order to avoid clashes.

You shouldn’t use the RM Package Blueprint Template for major version changes to applications, for example v1 to v2. We will provide a new RM Package Blueprint Template as there could be changes to the way the application is installed, which may mean the previous major version RM Package Blueprint Template will not work.

When should you repackage an application?

As we have seen there are many options which should allow you to add applications to Community Connect 4 without the need to repackage them using RM Application Wizard and WinInstall LE. Inevitably though there will always be some applications which cannot be added using the guidance in this white paper. If this is the case the tools provided with Community Connect 4 can still be used to repackage an application. You must bear in mind what was covered at the start of this white paper – by repackaging an application using these tools, any logic built in to the original installer will be lost so extra care needs to be taken when creating the Windows Installer Package and these tools shouldn’t be used for repackaging complex applications.

There are many alternatives to the tools provided with Community Connect 4. These include professional packaging tools such as Flexera InstallShield.

More information on Flexera InstallShield® can be found here:

http://www.flexerasoftware.com/products/installshield.htm

Summary

In this white paper we have looked at how we can add application installers to a Community Connect 4 network without having to repackage them using RM Application Wizard and WinInstall LE – OnDemand Discover.

When applications are repackaged in to Windows Installer Packages all of the logic that was created within the original installer is lost – the repackaging tool simply copies the files and the settings that were added in between two scans of the computer, creating a package which doesn’t contain any logic with the exception of copying and making the application available.

If a setup executable supports a silent installation, then this can be imported and used to install an application on to a Community Connect 4 computer using the logic that is built in to the original installer to install the application.

Page 37: Notes - Packaging without packaging

RM Technical Seminars spring 2013 CC4 packages without packaging

©2013 RM Education Page 37

The Windows Installer Service is a core part of Microsoft Windows and allows software developers to create Windows Installer Packages to install applications. These Windows Installer Packages provide a resilient and robust way to install, repair and remove applications. As this standard has become more popular there may be no need to repackage an application as a Windows Installer Package - the technology used to install Windows Installer Packages to computers on a Community Connect 4 network. The network support team, after some checks, import a Windows Installer Package in to Community Connect 4 and use this, with all the logic as provided by the software developer remaining intact, to assign and install applications on to managed computers.

Whilst these packages provided by software developers can install a piece of software on to a computer they may need editing and applications such as Orca can create a Microsoft Installer Templates, or .mst files, which can modify the installation of the application on to the computer. This could be used, for example, to provide a product key for a piece of software which allows the installation of an application to complete silently without going interactive, requiring action from a user at the computer.

Despite it being a lot easier to add applications to Community Connect 4 there may still be a need to repackage software. As we saw, the tool used by RM Application Wizard to create a package, WinInstall LE, will not work with 64-bit versions of Windows. Alternative packaging tools can be used to repackage an application for assignment of applications to computers on the Community Connect 4 network.

RM Package Blueprint is a quick and simple way to add packages to the network. The slight limitation of RM Package Blueprint was that they were version specific – the version of software must match the version of RM Package Blueprint. With the release of RM Package Blueprint Templates, this limitation is removed as the template can be reused when an iterative version of a piece of software is released, to quickly and easily add the software to the package repository so it can be assigned to Community Connect 4 computers.

David Wright

[email protected]