Conditional Requirement Type for Applications


I was playing around with Requirement Types for the application model the other day and thought it was worth blogging my solutions as I couldn’t really find any decent documentation on this. I’m sure there is some out there, somewhere in the ether of the Internet but here’s my version.

Let me start by painting the scenario. I’m currently involved in pushing out an Office 365 deployment across the globe in multiple languages, approx. 25 in total. To put all the languages into one Office 365 gives us a resultant application that is over 6GB in size, not great in some of the  locations with slow links. To great around this we are creating EMEA, APAC, NORAM and LATAM packages.

To break this down further, since we only want languages that are relevant to the country we are installing for, we are going to create separate deployment types for each country, so for example, we have an Office config file for Greece only in the EMEA application and this runs the command line setup.exe /configure el-GRconfiguration.xml. To ensure that this runs only on a device being built for Greece we have a requirement set in the deployment type.

As part of the OSD, the ‘OfficeLocale’ is a variable that is captured from our UDI wizard, and that particular variable is tattooed into the registry early on in the build process. Therefore we decided that the OfficeLocale registry key would be ideal to use as the requirement type that would determine that the deployment type would be executed.

To achieve this we simply create a global condition ConfigMgr that points to the location of the registry key we are tattooing during the build process.

globalcon-001.jpg

Then when we create our deployment type for the application, we can add in a requirement that this registry key should equal our desired reg key value, in this case el-GR for Greece,

globalcon-002.jpg

The trickier version of this was to accommodate the registry key being of two or more values, for example, if I want to install the German language for Office 365, then my OfficeLocale value could be en-DE (English-German) or en-AT (English-Austrian). So how exactly is this achieved.

If you take a look at the Operator drop down in the Edit Requirement Type box you can see an option for One of. Perfect! However, if you look around on the Internet there’s nothing really out there that tells me how to populate the values for this operator.

globalcon-003.jpg

Here’s how you can achieve it.

Method 1

After asking on Twitter, Ari Saastamoinen (@AriSaastamoinen) came up with the suggestion of entering the values on separate lines like so:

globalcon-004.jpg

This method worked perfectly.

You’ll notice that when you OK this window the requirement type appears in the console with the values comma separated. Note if you enter the values in the Requirement Type window with commas it doesn’t work, you must use the method above.

globalcon-005.jpg

Method 2

The second way to achieve this is a little more convoluted but works.

We need to create another global condition, this time it will be a Condition Type Expression. We then need to click the Add Clause button.

globalcon-006.jpg

We can then use our existing global condition to state the exact value of the registry key, in this instance the en-AT value and we can repeat this process to add the clause for en-DE, our second possible registry key value.

globalcon-007.jpg

Finally, we add the connector type to our boolean arguement. From the Connector drop down we can select OR.

globalcon-008.jpg

Now, when adding the requirement type to the our deployment it’s a simple case of choosing this global condition and setting its value to True.

globalcon-009.jpg

globalcon-010.jpg

6 comments

  1. Hi Paul,

    Thanks for the website. It has helped me a lot.

    I have got a quick question wondering if you could point me in right direction.

    A company I work for owns few businesses and a same application is used by lot of them. Currently each business installs this application using their own parameters. We are centralising the SCCM environment so I was wondering is there any way we could do it in one application package.

    We are tattooing one registry setting for each business during the build process so could we have use that.

    Ex-

    Business 1 – chrome.msi /q if registry key =x
    Business 2 – chrome.msi /qb if registry key =y

    Thanks for your help in advance.

    1. Yes you can leverage the global condition method described in this blog post. Create a global condition and check the registry key you tattoo, as in the first image. Then when you create an app you can create multiple deployments, each checking a requirement type. That requirement type can use the custom global condition you created and you can say equals key x, then create another deployment where the requirement type equals key y etc. Cheers Paul

      1. Thanks a lot Paul for your guidance. I will get that tested today and let you of the outcome.

  2. I am trying with Bitness of application ( outlook) which i have x64 and x86 in my environment but it doesn’t work, my entries are in separate lines, too.

Leave a Reply to Ankush Chawla Cancel 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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s