Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Adobe Requirement Script #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

asjimene
Copy link
Contributor

Pull Request Type

  • New Script
  • Edit Script
  • Repository Improvement

Brief summary of changes

Update the Adobe Requirement Script to also detect if a 32-bit version of Acrobat Pro or Standard is installed instead of detecting only a 64-bit version is installed.

Describe your Testing

Tested with a customer that brought forth an issue with the previous script.

Checklist

  • Did you Clean your script - No environment details, comments are PG-13
  • Did you test your script
  • If required, did you create, and include a Read Me as outlined in Community Scripts Read Me

Notes for PMPC Team

Hi

@asjimene asjimene requested a review from a team as a code owner March 15, 2024 22:09
@DanGough DanGough self-assigned this Jul 24, 2024
@DanGough
Copy link
Contributor

DanGough commented Jul 24, 2024

Hard-coding to look at Wow6432Node will not work on a 32-bit OS...

There's another way to address this, which is to look at the ProductCodes installed on the system? Something like this:

$AdobeReaderProducts = @{
    '{AC76BA86-7AD7-FFFF-7B44-AC0F074E4100}' = 'Acrobat Reader x86 MUI'
    '{AC76BA86-7AD7-?0??-7B44-AC0F074E4100}' = 'Acrobat Reader x86' # ?0?? can match a language code like 1033
    '{AC76BA86-1033-FF00-7760-BC15014EA700}' = 'Acrobat Reader x64 MUI'
    '{AC76BA86-?0??-1033-7760-BC15014EA700}' = 'Acrobat Reader x64' # ?0?? can match a language code like 1033
    '{AC76BA86-7AD7-FFFF-7B44-AE1401753200}' = 'Acrobat Reader 2020 MUI'
}
$AdobeProProducts = @{
    '{AC76BA86-1033-FFFF-7760-0C0F074E4100}' = 'Acrobat Pro/Std x86'
    '{AC76BA86-1033-0000-7760-0C0F074E4100}' = 'Acrobat Pro/Std x86'
    '{AC76D478-1033-F450-3478-0C0F074E4100}' = 'Acrobat Pro/Std x86'
    '{AC76BA86-1033-FFFF-7760-BC15014EA700}' = 'Acrobat Pro/Std x64'
    '{AC76BA86-1033-0000-7760-BC15014EA700}' = 'Acrobat Pro/Std x64'
    '{AC76BA86-1033-FFFF-7760-0E1401753200}' = 'Acrobat Pro/Std 2020'
}

$AcrobatProFound = $false

$InstalledProducts = (Get-Item -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall','HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall' -ErrorAction Ignore).GetSubKeyNames()

foreach ($InstalledProduct in $InstalledProducts) {
    foreach ($AdobeProductCode in $AdobeReaderProducts.Keys) {
        if ($InstalledProduct -like $AdobeProductCode) {
            Write-Host "$($AdobeReaderProducts[$AdobeProductCode]) found"
        }
    }
    foreach ($AdobeProductCode in $AdobeProProducts.Keys) {
        if ($InstalledProduct -like $AdobeProductCode) {
            $AcrobatProFound = $true
            Write-Host "$($AdobeProProducts[$AdobeProductCode]) found"
        }
    }
}

if ($AcrobatProFound) {
    Write-Output "NotApplicable"
}
else {
    Write-Output "Applicable"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants