Installing a windows feature using the application model

July 16, 2015 at 6:18 pm in CM12, CM12 R2, ConfigMgr, SCCM by Kurt Depre

Hi All,

Recently I had the requirement to install IIS + some features on Windows 7 machines using the application model. After some searching this was fairly easy to accomplish using Dism and a script detection method. Let’s do this step by step.

1. Create a new Application and select “Manually specify the application information”

clip_image002

2. Fill out the application information and application catalog metadata pages and click next to go to the Deployment types page.

clip_image004

clip_image006

3. Click Add on the deployment type page to create a new DT.

clip_image008

4. Select “Script Installer” and “Manually specify the deployment type Information” and click next

clip_image010

5. Give your Deployment type a name and click next.

clip_image012

6. Leave content location empty and set the following as installation program (depends on the feature you want to install, to find a list with windows features you can use the following command: Dism.exe /Online /Get-features):

DISM.exe /Online /Enable-Feature /FeatureName: <NameOftheFeatureToEnable>

In my example it will be the following:

DISM.exe /Online /Enable-Feature /FeatureName:IIS-ASP /FeatureName:IIS-ASPNET /FeatureName:IIS-BasicAuthentication /FeatureName:IIS-WindowsAuthentication /FeatureName:IIS-NetFxExtensibility /FeatureName:IIS-ISAPIExtensions /FeatureName:IIS-ISAPIFilter /FeatureName:IIS-RequestFiltering /FeatureName:IIS-StaticContent /FeatureName:IIS-ManagementConsole /FeatureName:IIS-WebServer /FeatureName:IIS-WebServerRole /FeatureName:IIS-CommonHttpFeatures /FeatureName:IIS-DefaultDocument /FeatureName:IIS-DirectoryBrowsing /FeatureName:IIS-HttpErrors /FeatureName:IIS-HttpLogging /FeatureName:IIS-HttpRedirect

clip_image014

7. On the detection method page select “Use a custom script to detect the presence of this deployment type” and click edit to add the script

clip_image016

8. Select PowerShell and paste a script similar to mine (change or remove feature names to detect to match your scenario).

You can download the example script here : FeatureDetection.zip

clip_image018

9. Configure the User Experience, Requirements (maybe limit the OS here) and Dependency settings to match you scenario.

10. Click next a few time to confirm the creation of the Deployment type and the application

11. Deploy and test.

Till next time

Kurt

PS: If anyone has a better script to perform the detection feel free to share it

The Application Model in the real world: installing multiple Installers as part of one application.

January 7, 2015 at 2:41 pm in CM12, CM12 R2, ConfigMgr, SCCM by Kurt Depre

Hi All,

A second post about the Application Model in ConfigMgr 2012. This time I will cover the scenario where multiple components needs to be installed as part of the application, a good example is Visual C++ Runtime 2013. On x86 machines only the x86 version is needed but on x64 commonly both x86 and x64 versions are installed. One way to solve this is 2 applications with requirement rules to define on which architecture they get installed but that means 2 Applications to maintain and 2 deployments. Another approach which I prefer is creating a single application with 2 DTs and working with requirement rules & dependencies as show in the example below.

First off the flow of how things are evaluated & installed in a scenario with dependencies

DependencyandRequirementEval

Step-By-Step Example

1. Get the sources and put them on your source share

The one I use in this example can be found here: http://www.microsoft.com/en-us/download/details.aspx?id=40784

2. Create the application with a first DT (x86) with the following parameters:

Name: Microsoft Visual C++ 2013 Runtime
Publisher: Microsoft
Software Version: 2013
Deployment Type Install Method: Script Installer
DT Name: Microsoft Visual C++ 2013 Runtime (x86)
Content Location: <YourServer>\<YourShare>\<YourVisualC++2013RuntimeFolder>
Installation Program: “vcredist_x86.exe” /Install /passive /quiet /norestart /log %windir%\temp\vc2013x86.log
Uninstall Program: “vcredist_x86.exe” /Install /passive /quiet /norestart /log %windir%\temp\vc2013x86.log
Detection Method: The Product key {13A4EE12-23EA-3371-91EE-EFB36DDFFF3E} or whatever you find out when manually installing the product
Install Behavior: Install for System
Logon Requirement: Whether or not a user is logged on.
Requirements: Device –>Operating System –> Select all OSes except Windows RT & Embedded

3. Save the application

4. Create a new deployment type in the newly created application with the following parameters:

Deployment Type Install Method: Script Installer
DT Name: Microsoft Visual C++ 2013 Runtime (x64)
Content Location: <YourServer>\<YourShare>\<YourVisualC++2013RuntimeFolder>
Installation Program: “vcredist_x64.exe” /Install /passive /quiet /norestart /log %windir%\temp\vc2013x64.log
Uninstall Program: “vcredist_x64.exe” /Install /passive /quiet /norestart /log %windir%\temp\vc2013x64.log
Detection Method: The Product key {A749D8E6-B613-3BE3-8F5F-045C84EBA29B}
or whatever you find out when manually installing the product
Install Behavior: Install for System
Logon Requirement: Whether or not a user is logged on.
Requirements: Device -> Operating System -> Select all 64 bit Oses

5. Edit the x64 Deployment Type

C  27Bis

6. Go to the dependency tab and click add.

C  29Bis

7. Enter the name for the dependency group (Microsoft Visual C++ 2013 Runtime x86 in my case) and click add

DependencyGroup

8. Search for the application your just created (Microsoft Visual C++ 2013 Runtime) select the x86 DT and click ok

C  30

9. Click OK to create your dependency group

C  31

10. Click Ok to save the changes to the DT.

C  32

11. Select the x64 Deployment type and click increase priority to pass it to Priority 1

C  27Tris

12. Click OK to save your changes

C  28Bis

13. Create a deployment for your application

14. Watch how both versions are deployed using 1 Application

Note: this also works inside task sequences

Till next time

Kurt

The Application Model in the real world: Supersedence.

January 6, 2015 at 3:27 pm in CM12, CM12 R2, ConfigMgr, SCCM by Kurt Depre

Hi all,

As you will see in my future posts, I’m a big fan of the application model in ConfigMgr 2012. The AppModel offers several interesting features to deploy your applications to your clients. In this blog post I want to cover 2 scenarios enabled by one specific feature of the application model: Supersedence

What is supersedence?

TechNet describes it as follows: Application management in Microsoft System Center 2012 Configuration Manager allows you to upgrade or replace existing applications by using a supersedence relationship. When you supersede an application, you can specify a new deployment type to replace the deployment type of the superseded application and also configure whether to upgrade or uninstall the superseded application before the superseding application is installed.

Supersedence can be very useful when you have an application that replaces an older version or another application that is already deployed. Below you will find 2 examples on how we used supersedence at a Customer

Note: supersedence does not work within task sequences.

Automated uninstall of the previous version of a software

Often when upgrading an application to a new version you first want to uninstall the previous version if it’s present. This can easily be done using supersedence.

Below you find a simplified flow of how supersedence will work to uninstall the previous version of an application or maybe an application that is being replaced by another.

SuperSedence_uninstall

How to set it up?

1. Find your Old & new App (in this Example Flash 13 (old) & Flash 14 (New))

clip_image002

2. Edit your new (superseding) application, go to the supersedence tab and click Add…

clip_image003

3. In the Specify relationship dialog click Browse…

clip_image004

4. Search for your old application. Select it and click OK

clip_image005

5. In the Specify Supersedence relationship choose which deployment type that replaces the ones from the old Application and check the Uninstall checkbox

Note: the uninstall command needs to be filled correctly on the application that is being replaced.

clip_image006

6. Verify that everything is set correctly and click OK to save your changes

clip_image007

7. Create a deployment of the new Application

8. Watch the old Application being uninstalled and the new installed

The Side-by-Side upgrade.

Sometimes you want to replace an application but not immediately upgrade all existing installations (maybe this will be done at later time). So you want all new installations to be of the new version. One option is to target a separate collection but this can bring overhead. Another option that I prefer is using supersedence. In the example below we want to replace Google Chrome by Firefox. So for now existing chrome installations will remain but all new requests will receive Firefox instead.

Below you find a simplified flow of how supersedence will work for the “Side-by-side” scenario

SuperSedence_RollingUpdate

How to set it up?

Note: It’s assumed that the previous version/Application is already deployed to the Target collection.

1. Edit the New Application, go to the supersedence tab and click Add…

clip_image009

2. On the Specify supersedence relationship dialog click Browse…

clip_image010

3. Find the application that is being replaced, select it and click OK

clip_image011

4. Specify which Deployment type will replace which one from the superseded application and click OK

clip_image012

5. Verify all settings on the application page (uncheck the checkbox allowing users to see multiple deployments of superseded apps if you are working with Available deployment and the Application Catalog’’) and Click OK to save your changes.

clip_image013

6. Create a deployment to the same collection as the superseded Application for the new App and verify that both deployments are present

clip_image014

7. Sit back and let the magic happen.

8. Optionally when you are ready to upgrade the older apps just remove the Deployment and on the next Application Deployment evaluation cycle the application will be upgraded)

Till next time.

Kurt