Adobe Digital Editions

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

About

AdobeDigitalEditions.png

Adobe Digital Editions is an ebook reader software program from Adobe Systems, built initially using Adobe Flash.

Version: 4.5.10

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 Adobe Digital Editions executable package installer.

Notes

Script will check for and remove earlier versions of Adobe Digital Editions. The package produces an error code of 1223 even when successfully installed, so this has been suppressed in the install script (error code 1223 means the user cancelled the install - not applicable in a silent deployment, so definitely a bug).


Deploy Info

Adobe Digital Editions 4.5
Adobe Systems Incorporated
C:\Program Files (x86)\Adobe\Adobe Digital Editions 4.5\DigitalEditions.exe

Hive: HKEY_LOCAL_MACHINE
Key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Digital Editions 4.5
Value: DisplayVersion
DataType: Version
Data: 4.5.10
Operator: Greater than or equal to
32-bit: Yes
SCCM Requirement: None


Deploy-Application.ps1

Relevant extracts from the script are as follows:

##*===============================================
##* VARIABLE DECLARATION
##*===============================================
## Variables: Application
[string]$appVendor = 'Adobe'
[string]$appName = 'Digital Editions'
[string]$appVersion = '4.5.10'
[string]$appArch = 'x86'
[string]$appLang = 'EN'
[string]$appRevision = '01'
[string]$appScriptVersion = '1.0.0'
[string]$appScriptDate = '06/03/2019'
[string]$appScriptAuthor = 'psadt.com'
[string]$Parms = "/s"
##*===============================================



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

## <Perform Pre-Installation tasks here>

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

			If ($oldVersion -ne $appVersion)
				{
				# 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
				}
			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'}



##*===============================================
##* INSTALLATION 
##*===============================================
[string]$installPhase = 'Installation'

<## Handle Zero-Config MSI Installations
If ($useDefaultMsi) {
	[hashtable]$ExecuteDefaultMSISplat =  @{ Action = 'Install'; Path = $defaultMsiFile }; If ($defaultMstFile) { $ExecuteDefaultMSISplat.Add('Transform', $defaultMstFile) }
	Execute-MSI @ExecuteDefaultMSISplat; If ($defaultMspFiles) { $defaultMspFiles | ForEach-Object { Execute-MSI -Action 'Patch' -Path $_ } }
}
#>

## <Perform Installation tasks here>

Execute-Process -Path 'ADE_4.5_Installer.exe' -Parameters $Parms -IgnoreExitCodes 1223 -WindowStyle Hidden
Remove-File -Path "$env:Public\Desktop\Adobe Digital Editions 4.5.lnk"
Remove-File -Path "$envCommonStartMenuPrograms\Adobe\Adobe Digital Editions 4.5\Uninstall.lnk"




##*===============================================
##* 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 "*Adobe Digital Editions*" } |
				Select-Object -Property DisplayName, DisplayVersion, UninstallString
	ForEach ($ver in $appVer)
		{
		If ($ver.UninstallString)
			{
			$appExist = 1
			$appRemove = $ver.DisplayName
			$oldVersion = $ver.DisplayVersion
			$Uninst = $ver.UninstallString

			# 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
	}