Deploy Microsoft Project and Visio (Click-to-run)

I got a request at work if I could create the deployment of the latest versions (Click-to-run) of Microsoft Visio and Project and set the Monthly update channel. The deployment of the applications should be made available in the Company Portal for users that are a member of the Entra ID synced Active Directory group to which the Visio and or Project Online plan licenses are assigned to.
We still run a 32 bits MS365 Apps on devices so got a mix of 32 bits and 64 bits MS 365 apps. The deployment should automatically detect the MS 365 apps architecture and then install the correct 32 or 64 bits version of Project and / or Visio. In this post I will show you how I did this. I will also provide all the sources and scripts you need to accomplish this.

Sources

First Download all the sources you need from my Github repo.

Extract the zip file and then you will have the following sources:

Application-Detection-Script.ps1

  • Folder Project with:
    • project.intunewin
    • setup.exe
    • Install_MS_project.ps1
    • Uninstall_MS_project.ps1
    • uninstall_project.xml
    • Project-x64.xml
    • Project-x86.xml
  • Folder Visio with:
    • Visio.Intunewin
    • setup.exe
    • Install_MS_Visio.ps1
    • Uninstall_MS_Visio.ps1
    • uninstall_Visio.xml
    • Visio-x64.xml
    • Visio-x86.xml

Setup.exe and XML files

The setup.exe is the Office Deployment tool and with this tool you can download and deploy Microsoft 365 Apps to your client computers. This tool gives you control over an Office installation: you can define which products and languages are installed, how those products should be updated, and whether or not to display the install experience to your users.

If you want more information about the Office Deployment Tool click the link below.

Overview of the Office Deployment Tool – Deploy Office | Microsoft Learn

You can download the latest setup.exe from here, extract the self-extracting executable file and extract the setup.exe or keep the setup.exe in the zip you downloaded above from my github.

You also need an xml file so you can define what options you want during the installation of the 365 App ( 32 or 64-bit, EULA automatically accepted, update channel and more) and then run setup.exe from the command line together with this xml file.

More information about the settings you can configure in the xml can be found here.

I already created the xml files you need to deploy the 32 or 64 bits Apps and the uninstall xml to remove the application.

You can set the Display Level of the installation or uninstall in the xml files to FULL or NONE to show installation splash screens or do not show them. Keep in mind that the Display version Full won’t work when deploying with Intune. I am not sure why yet.

Installation scripts

I already created the install scripts for Visio and Project for you to use. The script checks if the Microsoft 365 apps are installed if so it checks what architecture is installed and the script then installs the same Visio/Project architecture.
Because Visio and Project click to run can’t be a different architecture then the already installed 365 apps when installing. Because this would result in an installation error.

If no 365 apps are detected it will install the default architecture (you can change this variable in the script). It also created a logfile.

You can change the logfile location to: $env:ProgramData\Microsoft\IntuneManagementExtension\Logs If you want the logfile to be collected with the Intune Device diagnostics.

# Create Variables

$Logfile = "$env:windir\logs\Install_Visio.log"

$checkOfficeArchitectureInstalled = (Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration).Platform

$VisioDefaultArchitecture = "X86" #If no Microsoft 365 Apps are detected the script wil install this Visio Architecture

# Create Logfile Function

function WriteLog
{
Param ([string]$LogString)
$Stamp = (Get-Date).toString("dd/MM/yyy HH:mm:ss")
$LogMessage = "$Stamp $LogString"
Add-content $LogFile -value $LogMessage
}

If($checkOfficeArchitectureInstalled -eq $Null)

{

WriteLog "Microsoft 365 Apps not detected"
WriteLog "Use default architecture install $VisioDefaultArchitecture"
$Architecture = $VisioDefaultArchitecture

}

else

{

WriteLog "Microsoft 365 Apps $checkOfficeArchitectureInstalled detected" 
WriteLog "Use same architecture install for Visio as installed 365 Apps that is: $checkOfficeArchitectureInstalled"
$Architecture = $checkOfficeArchitectureInstalled

}

# Compile XML name based on detected architecture Microsoft Apps and install Visio

WriteLog "Compiling installation XML file name"
$XML = "Visio-"+$Architecture+".xml"
WriteLog "Used XML $XML for installation"

        Try
            {
                WriteLog "Starting Microsoft Visio $Architecture installation"
                $Process = Start-Process -FilePath $PSScriptRoot\setup.exe -ArgumentList "/configure $XML" -Wait -WindowStyle Hidden -ErrorAction Stop
                WriteLog "Finished installation of Microsoft Visio $Architecture"
            }

        Catch 
            {
              WriteLog "Microsoft Visio $Architecture installation failed"
              WriteLog $Error[0]
              
            }


Detection script

I also created a detection script for you to use. In this detection script you can enable the detection method you want to use. In this case I enabled the detection on registry App name and version equal to and greater then because the initial version of Visio or Project is older then the version a month later. Because the latest version of Visio and Project is installed every time the detection method would fail if you wouldn’t use equal or greater then.

# Detection script for applications.
# Author = Remy Kuster
# Date = 30-08-2023
# Enable the detection method below you want to use

$DetectionMsiGUIDandVersion = "false" # Enter true or false to do the detection based on MSI GUID and versionnumber.
$DetectionMsiGUID = " "  # Enter MSI GUID if $DetectionMsiGUIDandVersion above is true without{}.
$DetectionMsiVersion = " " # Enter the application version of the MSI installation if $DetectionMsiGUIDandVersion above is True.

$DetectionExeandVersion = "false" # Enter True or false to do the detection based on application exe and/or version number.
$DetectionExePath = " " # Enter the path to the exe including the exe name if $DetectionExeandVersion is true (example: C:\Program Files\Mozilla Firefox\Firefox.exe).
$DetectionExeRequiredVersion = " " # Enter the version of the executable if $DetectionExeandVersion is true and you also want to do detection on the version of the executable, if you only want to do detection on the executable name leave it blank.

$DetectionRegistryAppNameandEqVersion = "false" # Enter true or false to do the detection based on registry Application name AND the exact version number.
$DetectionRegistryAppName = " " # Enter the application name (DisplayName) associated with the Application found in one of these registry locations: hklm:\software\wow6432Node\microsoft\windows\Currentversion\uninstall or hklm:\software\microsoft\windows\Currentversion\uninstall if $DetectionRegistryAppNameandEqVersion above is true.
$DetectionRegistryVersion = " " # Enter the application version (DisplayVersion) found in one of these registry locations: hklm:\software\wow6432Node\microsoft\windows\Currentversion\uninstall or here hklm:\software\microsoft\windows\Currentversion\uninstall that belongs to the Application installation if $DetectionRegistryAppNameandEqVersion above is true.

$DetectionRegistryAppNameandEqANDGrThenVersion = "true" # Enter true or false to do the detection based on registry Application name AND equal to and greater than the current version number, for example in the case of an application that updates automatically after installation to a newer version.
$DetectionRegistryAppName = "Microsoft Visio - en-us" # Enter the application name (DisplayName) associated with the Application found in one of these registry locations: hklm:\software\wow6432Node\microsoft\windows\Currentversion\uninstall or here 
# hklm:\software\microsoft\windows\Currentversion\uninstall if $DetectionRegistryAppNameandEqANDGrThenVersion above is true.
$DetectionRegistryVersion = "16.0.16529.20226" # Enter the application version (DisplayVersion) found in one of these registry locations: hklm:\software\wow6432Node\microsoft\windows\Currentversion\uninstall or here hklm:\software\microsoft\windows\Currentversion\uninstall if $DetectionRegistryAppNameandEqANDGrThenVersion above is true.

if ($DetectionMsiGUIDandVersion -eq "True")

{
$InstalledApps = Get-WmiObject -Class Win32_Product | Where-Object -FilterScript {$_.IdentifyingNumber -EQ '{$DetectionMsiGUID}'}

if (($InstalledApps.IdentifyingNumber -eq '{$DetectionMsiGUID}') -and ($InstalledApps.Version -eq '$DetectionMsiVersion'))

{
Write-Host "Application is installed"
Exit 0
}

Else

{
Exit 0
}
}

if (($DetectionExeandVersion -eq "True") -and  ($DetectionExeRequiredVersion -notlike $null))

{
$DetectedExeVersion = (Get-Command $DetectionExePath).FileVersionInfo.FileVersion

if ($DetectedExeVersion -eq $DetectionExeRequiredVersion){

Write-Host "Application and version is installed"
Exit 0
}

Else

{
Exit 0
}
}

if (($DetectionExeandVersion -eq "True") -and (!$DetectionExeRequiredVersion -eq "true"))
{
$ExePathPresent = Test-Path $DetectionExePath

if ($ExePathPresent -eq "$true")

{
Write-Host "Application is installed"
Exit 0
}
Else
{
Exit 0
}
}

if ($DetectionRegistryAppNameandEqVersion -eq "True") 
{
$RegUninstallKeys = "hklm:\software\wow6432Node\microsoft\windows\Currentversion\uninstall", "hklm:\software\microsoft\windows\Currentversion\uninstall"
[array]$name = ($RegUninstallKeys | foreach-object {If (test-path $_) {GCI $_ | GP | select-object displayName,displayVersion}}) | where-object {$_.DisplayName -eq "$DetectionRegistryAppName" -and $_.DisplayVersion -eq $DetectionRegistryVersion}

if ($name -ne $Null) 
{
Write-Host "Application is installed"
Exit 0
} 
Else 
{

Exit 0
}
}

if ($DetectionRegistryAppNameandEqANDGrThenVersion -eq "True") 
{
$RegUninstallKeys = "hklm:\software\wow6432Node\microsoft\windows\Currentversion\uninstall", "hklm:\software\microsoft\windows\Currentversion\uninstall"
[array]$name = ($RegUninstallKeys | foreach-object {If (test-path $_) {GCI $_ | GP | select-object displayName,displayVersion}}) | where-object {$_.DisplayName -eq "$DetectionRegistryAppName" -and $_.DisplayVersion -ge $DetectionRegistryVersion}

if ($name -ne $Null) 
{
Write-Host "Application is installed"
Exit 0
} 
Else 
{

Exit 0
}
}

Intunewin

The zip file also includes the .intunewin files for Project and Visio. This file format is required to create the Win32 applications of Visio and Project in intune. The .intunewin file is a source container containing al the sources needed to install the application.

You can use the already made .intunewin files or create your own by following the steps below.

First download a tool to convert source files to an IntuneWin file. I recommend this tool I found.

Download the zip and extract it and run the PSGUIIntuneWinAppUtility.ps1 with PowerShell.

Select the source folder and then select a file in the source folder don’t worry the other files in the same source folder will also be converted in the Intunewim file.

Select what your output folder should be and click create.

Now all the files in the source folder are converted in an Intunewin file:

If you want to know what sources are in an IntuneWin file you can install this easy to use IntuneWin extractor:

Intunewin right-click extract: extract content of intunewin file with a right-click on it | Syst & Deploy (systanddeploy.com)

Create Application (Intune) Microsoft Visio

Log into the Intune portal with an Entra account that has the correct intune role assigned to create a Win32 application.

  • Application Manager
  • Intune Administrator

Select AppsAll AppsAddApp type: Windows app (Win32)Select

Click Select app package fileopen the folder button and select the Visio.intunewin file and click open.

Now the intunewin file is loaded, click OK

Now you can change the App information settings.

  • Name: Microsoft Visio
  • Description: Microsoft Visio is software for drawing a variety of diagrams. These include flowcharts, org charts, building plans, floor plans, data flow diagrams, process flow diagrams, business process modeling, swimlane diagrams, 3D maps, and many more.
  • Publisher: Microsoft
  • Category: Office
  • Information URL: https://support.office.com/en-us/article/visio-training-e058bcfa-1d90-4653-afc6-e84d54cf94a6
  • Developer: Microsoft
  • Logo: I found a great icon github repo, you can download the icon you need.

    Click Next.

Now you can change the Program settings.

  • Install command: %windir%\SysNative\WindowsPowershell\v1.0\PowerShell.exe -executionpolicy bypass -file .\Install_MS_Visio.ps1
  • Uninstall command: %windir%\SysNative\WindowsPowershell\v1.0\PowerShell.exe -executionpolicy bypass -file .\Uninstall_MS_Visio.ps1

    We use the path: %windir%\SysNative\WindowsPowershell\v1.0\PowerShell.exe to run the PowerShell in 64 bits, this is required because the script needs to detect a certain regkey. If you don’t run PowerShell from this path this regkey check fails.
  • Allow available uninstall: Yes
  • Install Behavior: System
  • Device restart behavior: No specific action

Click Next.

Now you can change the Requirements.

  • Operating system architecture: 64-bit
  • Minimum operating system: Windows 10 22H2 (change this in the minimum OS you want to be required)

Click Next.

Now you can change the select the detection rules.

Click Use a custom detection script open the folder button and select the Application-Detection-Script.ps1 file and click open.

Now the script file is selected and set the Enforce script signature check and run script silently to No.

Click Next.

Click Next.

Click Next

Click Next.

Now assign the Visio or Project app as available to the same Entra ID usergroup that enables Visio and Project online plans for the users. This way the process is fully automated from adding a license to a user to make the Visio or Project apps available to install. Click Next.

Check the summary of the created Win32 app and click Create.

Follow the same steps for the project app creation. The Win32App is created now lets see how the user is experiencing this deployment.

User experience

The employee assigned a license and now member of the assigned Visio license group will see the app Microsoft Visio in the Company Portal.

When clicking Install the application will start installing.

The logfile created can be found in C:\Windows\Logs.

In the logfile you can see the MS 365 apps 64 bits were detected, so the Visio x64 is installed.

The user can also uninstall the Visio application if needed by clicking Uninstall.

Conclusion

So if you have got 32 and 64 bits Office versions installed in your environment and you need to install Visio and / or Project you can automate this. The Visio and Project click to run versions have to be the same architecture as the installed MS 365 apps on the device. The script in this post installs the correct architecture of Project and Visio.

Theme: Overlay by Kaira