Like most wizard-based tools, the Integration pack wizard is designed to address common scenarios for building IPs, and may not be effective in every situation. When you need to customize the creation and installation of an IP beyond what the wizard provides, it’s helpful to understand the process behind the wizard so that you can accomplish the same thing using a customized process.
The Integration Pack Wizard streamlines the process of creating an Integration Pack (.OIP) file that is installable by the Orchestrator Deployment Manager. The .OIP file is really just a .ZIP file that has been renamed to .OIP to be easily found by Deployment Manager and avoid confusing it with other compressed files. Building the OIP involves several steps:
You can look inside the OIP file by simply renaming the extension to ZIP and extracting the contents. The OIP file typically contains the following files:
In order to create the MSI, the Integration Toolkit uses WIX (a prerequisite to installing OIT), along with an intermediate file named <IP_Name>.WSX. This WSX file instructs WIX how to build the MSI from the various components. This file is not included in the final MSI or OIP.
Before you put your IP into an automated build process, you need to have the initial files (.CAP, .XML, WSX, etc.) created so they can be used as inputs to the process. However, creating these files from scratch can not only be time consuming, it can be error prone and lead to installation or usage failures related to the build, not related to your code.
The best method for initially creating the necessary files is to let the IP Wizard do it for you. When the IP Wizard builds an IP, it creates and packages the files, and many of the files you need can be obtained from an installed Integration Pack. However, there are several intermediate files that are also needed that are not available from an installed IP. So in order to obtain these intermediate files, you need to “intercept” the IP Wizard’s build process.
When you run the IP Wizard, it stores the intermediate files in a temporary directory here:
C:\Users\<username>\AppData\Local\Microsoft System Center 2012\Orchestrator\Integration Toolkit
To capture the intermediate files created by the wizard:
Assuming you’ve already created a project in source control for your Integration Pack, you will need to add directories and files to it in order to complete the IP build process. For this example, we’ll use the following project directory: $/TFSProject/Main/MyIP
You will need WIX installed on your development machine along with the Visual Studio integrations. It can be done without the integrations or on other platforms, but that won’t be covered here. To add the installer project:
You may notice that there are several other files needed during the building of the MSI that are not found in the temporary directory. These files are:
These files are included in the Integration Toolkit, and are installed into the Integration Toolkit\Bin directory under the Orchestrator installation root folder, typically here:
C:\Program Files (x86)\Microsoft System Center 2012\ You should copy these files into your installer project so they are linked inside source control with the project.
The metadata files include the CAP and XML files that are either included in the MSI or the OIP file.
Assuming that your build process will now automatically create the MSI because it’s a sub-project of the overall solution for the IP, all you have to do is update the build process to create the OIP file.
The following script will take the appropriate files and package them into a ZIP file, then rename to OIP. This script requires the following:
- It is called with 5 command line parameters (%1 through %5)
- Zip.exe (command-line ZIP) is located in the directory you specify for parameter 1
- The MSI is already built and available in the directory you specify in parameter 2
- The SolutionRoot parameter (param 3) is the parent directory of your IP’s solution directory
- Your IP Base name (i.e. MyIp) is used for your MSI file and the folder name of your IP project
setlocal set BldTool=%1 set RelPath=%2 set SolutionRoot=%3 set IpBaseName=%4 set OipName=%5 set StageDir=%RelPath%\OipStage
rem SolutionRoot = “$/TFSProject/Main” in this example
rem Stage the files to be zipped rem Assumes MSI is already built and exists in release path if exist "%RelPath%\*%IpBaseName%*.msi" ( xcopy /y "%RelPath%\*%IpBaseName%*.msi" "%StageDir%\" ) else echo MSI is missing in "%RelPath%" Rem Copy CAP file if exist "%SolutionRoot%\%IpBaseName%\XML\*cap" ( xcopy /y "%SolutionRoot%\%IpBaseName%\XML\*.cap" "%StageDir%\" ) else echo cap is missing in "%SolutionRoot%\%IpBaseName%\XML" Rem Copy Objects.Xml, QIK.XML files if exist "%SolutionRoot%\%IpBaseName%\XML\*xml" ( xcopy /y "%SolutionRoot%\%IpBaseName%\XML\*.xml" "%StageDir%\" ) else echo xml files missing in "%SolutionRoot%\%IpBaseName%\XML" Rem Copy EULA file if exist "%SolutionRoot%\%IpBaseName%\XML\*eula" ( xcopy /y "%SolutionRoot%\%IpBaseName%\XML\*.eula" "%StageDir%\" ) else echo EULA file missing in "%SolutionRoot%\%IpBaseName%\XML"
pushd "%StageDir%" "%BldTool%\zip.exe" -9 "%RelPath%\..\%OipName%.oip" *.* popd
endlocal
Your build process now simply needs to call this script to automatically generate the OIP file.
Fernando Lugão Veltem edited Revision 2. Comment: correct typos
Fernando Lugão Veltem edited Original. Comment: added toc and tags