Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

PENDING Notepad++ Upgrade 8.9.2

AleksaCvijanovic

Active Member
Messages
28
Reaction score
0
Points
1
Dear all,
  1. Does anyone know how I can deploy a new version of Notepad++ and uninstall all older versions (without restart)? Because when i run this commands i install new verision but older version still exist on devices...
  2. Is it possible to create a query or role to collect all devices with all existing Notepad++ versions, so that I can deploy the new version to them?
I have downloaded the .msi installer of the new version from the official Notepad++ website.
 

Attachments

  • DetectionRule.png
    DetectionRule.png
    24.2 KB · Views: 4
  • Installation program.png
    Installation program.png
    31.5 KB · Views: 4
Dear all,
  1. Does anyone know how I can deploy a new version of Notepad++ and uninstall all older versions (without restart)? Because when i run this commands i install new verision but older version still exist on devices...
  2. Is it possible to create a query or role to collect all devices with all existing Notepad++ versions, so that I can deploy the new version to them?
I have downloaded the .msi installer of the new version from the official Notepad++ website.
Aleksa,
I haven't seen this particular app have an issue, but when this occurs, we use PowerShell to delete any old versions prior to installing (in the same script).

Our code looks like this:

$RegUninstallPaths = @(
'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall',
'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall'
)

# If we want to keep a specific version
# $VersionsToKeep = @('Java 8 Update 261')

# Find the version(s), if installed
$VersionsToKeep = @('')
Get-CimInstance -ClassName 'Win32_Process' | Where-Object {$_.ExecutablePath -like '*Program Files\Java*'} |
Select-Object @{n='Name';e={$_.Name.Split('.')[0]}} | Stop-Process -Force
Get-process -Name *iexplore* | Stop-Process -Force -ErrorAction SilentlyContinue

# $UninstallSearchFilter = {($_.GetValue('DisplayName') -like '*Java*') -and (($_.GetValue('Publisher') -eq 'Oracle Corporation')) -and ($VersionsToKeep -notcontains $_.GetValue('DisplayName'))}
$UninstallSearchFilter = {($_.GetValue('DisplayName') -like '*Java*') -and (($_.GetValue('Publisher') -eq 'Oracle Corporation'))}

# Uninstall unwanted versions and clean up program files
foreach ($Path in $RegUninstallPaths) {
if (Test-Path $Path) {
Get-ChildItem $Path | Where-Object $UninstallSearchFilter |
foreach {
Start-Process 'C:\Windows\System32\msiexec.exe' "/X$($_.PSChildName) /qn" -Wait
}
}
}

Hope this gets you started on item 1.
 
Aleksa,
As for item 2, if you want ALL versions of an app found, you can use this query in the collection.
Hope this solves the second issue.

select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "%Java%"
 

Forum statistics

Threads
7,192
Messages
28,072
Members
18,343
Latest member
RBK

Trending content

Back
Top