Deploy a Win32 App with Intune (Cmtrace)

Deploy a Win32 App with Intune (Cmtrace)

In this guide I explain how to Deploy a Win32 App with Intune. I have chosen CMtrace because this tool is useful for troubleshooting and analyzing Intune logs, and it is a perfect first example to learn how to Deploy a Win32 App with Intune from scratch.

W32 applications must always be uploaded as .intunewin package. It is not possible to simply upload an .exe file. How to create such an .intunewin package, and how to Deploy a Win32 App with Intune end to end, I will show you now.

Prepare installation sources

Download the ConfigMgr Toolkit installer to deploy a Win32 app with Intune
  • Install the MSI. After running the MSI you can find the sources in C:\Program Files (x86)\ConfigMgr 2012 Toolkit R2\.
ConfigMgr 2012 Toolkit R2 folder with the CMtrace source files
  • Copy the CMTrace tool from the ClientTools folder into a temp folder e.g. C:\temp\cmtrace\sources
CMtrace sources folder prepared in a temp directory

Install the  Microsoft Intune Win32 App Packaging Tool

Download the Microsoft Win32 Content Prep Tool ZIP from GitHub
  • Extract the folder and copy the IntuneWinAppUtil.exe to the temp folder.
Windows temp folder containing IntuneWinAppUtil in File Explorer

Creating the installation and uninstallation script

Create two text files with the name install.bat and deinstall.bat

install.bat and deinstall.bat scripts for the CMtrace package
  • Add the following content to the scripts:

install.bat

mkdir c:\windows\_Tools
Xcopy cmtrace.exe c:\windows\_Tools /e /i

deinstall.bat

del c:\windows\_Tools\cmtrace.exe

Hint: The path can of course be chosen as you like

Creating the Intunewin file

  • Open PowerShell as administrator and navigate to the temp folder.
  • Enter the following command:
Set-ExecutionPolicy Bypass
Setting the PowerShell execution policy to Bypass
  • Enter the following Command:
.\IntuneWinAppUtil -c C:\temp\cmtrace\sources\ -s C:\temp\cmtrace\sources\install.bat -o C:\temp\cmtrace
  • -c = Folder of the setup files
  • -s = Setupfile
  • -o = Output folder for the .intunewin file
IntuneWinAppUtil creating the .intunewin package in PowerShell
  • Now the intunewin installation file is created
The finished CMtrace .intunewin file in the output folder

Deploy a Win32 App with Intune in the admin center

With the package ready, it is finally time to Deploy a Win32 App with Intune from the Microsoft Intune admin center. Follow the steps below to create the application.

  • Navigate to Apps -> Windows
  • Click Add
  • Select Windows app (Win32) as App type
Selecting Windows app Win32 as the app type in Intune
  • Click Select app package file
  • Click upload and select the .intunewin file
  • Click OK
Deploy a Win32 App with Intune by uploading the .intunewin package
  • Give the application a name and customize the app information.
  • Click Next
Filling in the app information for the CMtrace Win32 app
  • Enter the install.bat and deinstall.bat as install/uninstall command
  • Change the Device restart behavior to No specific action
  • Click Next

Hint: If you use a PowerShell script insert the following command:

%windir%\system32\windowspowershell\v1.0\powershell.exe -executionpolicy bypass -windowstyle hidden -file "File.ps1"
Program settings with install and uninstall commands in Intune
  • Select 32-bit and 64-bit as Operating system architecture
  • Select a minimum OS Version

Hints: If you want to specify further requirements, such as minimum free disk space, you can do this in this step.
It is also possible to specify a file, a registry value or a script as a requirement.

Setting OS architecture and requirements for the Win32 app
  • Select Manually configure detection rules as Rules format
  • Click Add
  • Select File as Rule type
  • Enter your file path and the file name. The detection method is File or folder exists
  • Click Next
Configuring a file based detection rule for the Win32 app
  • We can skip the dependencies and supersedence step, click next.

Add an assignment. Add a group as required, the app will be installed automatically. If you select available the app will only be offered in the Company Portal for installation. This assignment step is what makes you actually Deploy a Win32 App with Intune to your devices.

Assigning the Win32 app to a device group in Intune

When you click on one of the hyperlinks behind the group you still have possibilities to make some additional configurations. E.g. the download type for delivery optimization (Foreground or Background) or you can also hide the installation notifications.

Additional Microsoft Intune Win32 app assignment options
  • Click Next > Create

That is everything you need to Deploy a Win32 App with Intune. For more background on packaging requirements, see the official Microsoft Learn Win32 app management documentation, and check out my other Intune guides on jannikreinhard.com for more deployment walkthroughs.

Common pitfalls and troubleshooting

A few mistakes come up again and again when you Deploy a Win32 App with Intune. The most common one is a detection rule that never matches the real install location. If your install command copies the file to C:\windows\_Tools, the detection rule must point to exactly that path, otherwise Intune keeps reporting the app as “not installed” and retries the deployment in a loop.

The second classic issue is a wrong working directory in your batch script. Win32 apps run from a temporary cache folder, so always use absolute paths or change into the script directory first. Finally, if the app installs but the user sees nothing, check the assignment notification settings and the install behaviour (System vs. User) so the deployment runs in the context you expect.

Stay healthy, Cheers
Jannik

6 thoughts on “Deploy a Win32 App with Intune (Cmtrace)

Comments are closed.