Global Mapper

From psadt | Evergreen Application Management
Jump to navigation Jump to search

About

Globalmapper.png

Global Mapper is a Mapping and geographic analysis application.

Version: 21.1

Assumptions

This document assumes you are familiar with the use of a Windows Administrator Command Prompt. It also assumes your copy of the PSADT is preconfigured to write logs to C:\ProgramData\Logs.

Obtain Package Source

Download the source installer from the vendor website.

Notes

Vendor install is an EXE wrapper with embedded MSI (MSI cannot be run standalone).

The installer is runwith a silent install switch, and the desktop shortcut is removed post-install. Legacy versions will be detected, logged and removed.

There is also an issue in the latest version where it copies the uninstall files to the user profile (%AppData%) instead of the legacy %ProgramData% location. This is not an issue for manual installs, but creates a problem when deploying from Endpoint Manager, as the registry entry for ModifyPath is changed to a Windows system location which does not exist post-install. For this reason a copy function has been added to move those files to the legacy location in %ProgramData%, and the ModifyPath registry entry adjusted to match.

The Package Cache folder created by the script is removed during uninstall.

Deploy Info

Global Mapper 21.1 (64-bit)
Blue Marble Geographics
C:\Program Files\GlobalMapper21.1_64bit\global_mapper.exe

Hive: HKEY_LOCAL_MACHINE
Key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Global Mapper 21.1 (64-bit)
Value: DisplayVersion
DataType: Version
Data: 21.01.0000
Operator: Greater than or equal to
32-bit: Yes
SCCM Requirement: None


Global Mapper 21.1 (64-bit)

Hive: HKEY_LOCAL_MACHINE
Key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{91EAD192-1AF0-4B2B-A34A-0CB68446F27E}
Value: DisplayVersion
DataType: Version
Data: 21.01.0000
Operator: Greater than or equal to
32-bit: No
SCCM Requirement: None

Deploy-Application.ps1

Relevant extracts from the script are as follows:

##*===============================================
##* VARIABLE DECLARATION
##*===============================================
## Variables: Application
[string]$appVendor = 'Blue Marble Geographics'
[string]$appName = 'Global Mapper'
[string]$appVersion = '21.01.0000'
[string]$appArch = 'x64'
[string]$appLang = 'EN'
[string]$appRevision = 'R01'
[string]$appScriptVersion = '1.0.0'
[string]$appScriptDate = '27/07/2020'
[string]$appScriptAuthor = 'psadt.com'
[string]$Parms = "REMOVE=TRUE /s"
[string]$packageCache = "$env:ProgramData\Package Cache\{CAF8F325-ADEC-4BED-BC69-BD29621A209D}"
[string]$appRegPath = "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Global Mapper 21.1 (64-bit)"
##*===============================================



##*===============================================
##* PRE-INSTALLATION
##*===============================================

## <Perform Pre-Installation tasks here>

# Remove previous versions if exist
ForEach ($regKey in $regKeyApplications)
	{
	$appVer = Get-ChildItem -Path $regKey |
		Get-ItemProperty |
			Where-Object {$_.DisplayName -like "*Global Mapper*" } |
				Select-Object -Property DisplayName, DisplayVersion, ModifyPath
	ForEach ($ver in $appVer)
		{
		If ($ver.ModifyPath)
			{
			$appExist = 1
			$appRemove = $ver.DisplayName
			$oldVersion = $ver.DisplayVersion
			$Uninst = $ver.ModifyPath

			If ($oldVersion -ne $appVersion)
				{
				If (Test-Path $Uninst)
					{
					Write-Log -Message "Uninstalling $appRemove $oldVersion" -LogType 'CMTrace'
					Write-Log -Message "Executing $Uninst $Parms" -LogType 'CMTrace'
					Start-Process $Uninst -ArgumentList $Parms -Wait -PassThru -NoNewWindow -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Out-Null
					}
				}
			ElseIf ($oldVersion -eq $appVersion)
				{
				Write-Log -Message "$appRemove $appVersion is already installed." -LogType 'CMTrace'
				Exit-Script -ExitCode 0
				}
			}
		}
	}
If ($appExist -ne 1)
	{Write-Log -Message "No $appName installations detected." -LogType 'CMTrace'}

Remove-folder -Path $packageCache




##*===============================================
##* INSTALLATION 
##*===============================================

## <Perform Installation tasks here>

Execute-Process -Path 'BlueMarbleGeographics_GlobalMapper_21.01.0000_R01.exe' -Parameters "/s" -WindowStyle Hidden
Remove-File -Path "$env:Public\Desktop\Global Mapper 21.1 (64-bit).lnk"
Copy-File -Path "$dirFiles\{CAF8F325-ADEC-4BED-BC69-BD29621A209D}\*.*" -Destination $packageCache -Recurse
Set-RegistryKey -Key $appRegPath -Name 'ModifyPath' -Value "$packageCache\GlobalMapper64.exe"




##*===============================================
##* UNINSTALLATION
##*===============================================
[string]$installPhase = 'Uninstallation'

## Handle Zero-Config MSI Uninstallations
If ($useDefaultMsi) {
	[hashtable]$ExecuteDefaultMSISplat =  @{ Action = 'Uninstall'; Path = $defaultMsiFile }; If ($defaultMstFile) { $ExecuteDefaultMSISplat.Add('Transform', $defaultMstFile) }
	Execute-MSI @ExecuteDefaultMSISplat
}

# <Perform Uninstallation tasks here>

# Remove any version if exist
ForEach ($regKey in $regKeyApplications)
	{
	$appVer = Get-ChildItem -Path $regKey |
		Get-ItemProperty |
			Where-Object {$_.DisplayName -like "*Global Mapper*" } |
				Select-Object -Property DisplayName, DisplayVersion, ModifyPath
	ForEach ($ver in $appVer)
		{
		If ($ver.ModifyPath)
			{
			$appExist = 1
			$appRemove = $ver.DisplayName
			$oldVersion = $ver.DisplayVersion
			$Uninst = $ver.ModifyPath

			# Uninstall
			Write-Log -Message "Uninstalling $appRemove $oldVersion" -LogType 'CMTrace'
			Write-Log -Message "Executing $Uninst $Parms" -LogType 'CMTrace'
			Start-Process $Uninst -ArgumentList $Parms -Wait -PassThru -NoNewWindow -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Out-Null
			}
		}
	}
If ($appExist -ne 1)
	{
	Write-Log -Message "No $appName installations detected." -LogType 'CMTrace'
	Exit-Script -ExitCode 1605
	}

Remove-folder -Path $packageCache

Manual installation

global_mapper-21_1-x64.exe

Globalmapper01.png

Globalmapper02.png

Globalmapper03.png

Click Next


Globalmapper04.png

Click Next


Globalmapper05.png

Click Next


Globalmapper06.png

Click Next


Globalmapper07.png

Click Next


Globalmapper08.png

Monitor install and allow it to finish


Globalmapper07.png

Click Finish