Roll your own MSI for testing with the ConfigMgr 2012 Application Model

 

Do you have Visual Studio 2013 installed?

 

Want to roll your own MSI?

 

All you need to do is download the free Visual Studio Installer extension and create a new Visual Studio Installer Project.

 

It’s incredibly simple using the Setup Wizard.

 

If you need an MSI with no licensing restrictions, for demoing the Application Model in ConfigMgr then this is a perfect way to go about it.

 

A step by step guide in the form of a KB article on creating a setup package can be found here.

 

I’ll show you how easy this is to roll a custom MSI for ConfigMgr Application Model to use.

 

Firstly open up your Visual Studio 2013 and File > New > Project

 

image

 

Expand Other Project Types > Visual Studio Installer then select Setup Wizard

 

Set the name of the project and its location and select OK

 

image

 

Select Next

 

image

 

Select Create a setup for a Windows application and Select Next

 

image

 

Select Add and browse to any file you’d like to add into this project

 

image

 

The file we added now shows in the list, cool, Select Next

 

image

 

Select Finish to get things going

 

image

 

Project being baked …

 

image

 

Here it is, the tabs now show the main features such as File System, Registry, Launch Conditions, Custom Actions, User Interface and File Types, we’ll focus on just the first two

 

In the File System tab select application Folder, scroll down to DefaultLocation, this is where you applications files will be installed to:

 

[ProgramFilesFolder][Manufacturer]\[ProductName]

 

Select the project in the Solutions Explorer to get the properties

 

image

 

Scroll down to Manufacturer and change to whatever you want it to be, if you write a series of tools it might be a idea to use the same Manufacturer identity for them all, keeping in mind that they will share a common folder in [ProgramFilesFolder], as well as in the Registry

 

image

 

The ProductName is set for you but can be changed here

 

image

 

You can change the version here

 

Now let’s create a string value in the registry

 

image

 

from Visual Studio’s menu bar select View > Editor > Registry

 

image

 

In the newly shown Registry tab, navigate through to the applications registry key

 

image 

 

Right click the key and select New > String Value

 

Give it a name and a value

 

Now build your solution (F6)

 

You’ll end up with this

 

image

 

An MSI and an Executable, nice!

 

Both of these are deployable via ConfigMgr using Software Distribution or the Application Model, the MSI has a Product ID which can be found here

 

image

 

You can now use that MSI in the Application Model, custom detection rules on a Deployment Type can be created for the MSI’s Product Code, the README.txt file as well as the registry key.

 

Here’s what ConfigMgr see’s when I go to create an Application with the DemoMSI.msi

 

image 

 

Usual MSI selection done …

 

image

 

To work around this get yourself a certificate signed by a well known Certificate Authority, from one in the trusted root certificate authorities store, or self-sign and distribute it to the Trusted Root Certificate Authorities store, or just click Yes :-)

 

image

 

Yep that’s our MSI’s Product Code {74212183-51C3-4EFC-B65B-6C8A0C9DEAB7}

 

image 

 

As you can see, its going to proceed fine, with an MSI detection rule, but you could easily modify the existing Deployment Type to include a detection rule for that README.txt file, or the Registry Key.

 

Some more info to get you started here

 

Enjoy