Deploying Eclipse IDE with Intune

Tags eclipse

Zehadi Alam

The following procedure outlines the steps for deploying the Eclipse IDE using Microsoft Intune

1. From the Eclipse website, download the ZIP archive for Eclipse
Do not download the exe installer



2. Download the install script and uninstall script (attached).

installEclipse.ps1

#Replace with archive name
$EclipseArchive = "eclipse-java-2023-12-R-win32-x86_64.zip"

$DestinationFolder = "C:\Program Files\Eclipse IDE"

try {
    if (-not (Test-Path -Path $DestinationFolder)) {
        New-Item -ItemType Directory -Path $DestinationFolder
    }
   
Expand-Archive -Path $EclipseArchive -DestinationPath $DestinationFolder -Force
    Copy-Item -Path "uninstallEclipse.ps1" "$env:ProgramFiles\Eclipse IDE\eclipse\uninstallEclipse.ps1"
   
   
#Create start menu and desktop shortcuts
    $EclipsePath = "$env:ProgramFiles\Eclipse IDE\eclipse\eclipse.exe"
    $StartMenuShortcutPath = "$env:ALLUSERSPROFILE\Microsoft\Windows\Start Menu\Programs\Eclipse IDE.lnk"
    $PublicDesktopShortcutPath = "$env:Public\Desktop\Eclipse IDE.lnk"
    $WScriptShell = New-Object -ComObject WScript.Shell

   
# Check if shortcuts already exist, delete and recreate them
   
if (Test-Path -Path $StartMenuShortcutPath) {
        Remove-Item -Path $StartMenuShortcutPath -Force
    }
 
   
$StartMenuShortcut = $WScriptShell.CreateShortcut($StartMenuShortcutPath)
    $StartMenuShortCut.TargetPath = $EclipsePath
    $StartMenuShortCut.Save()

   
if (Test-Path -Path $PublicDesktopShortcutPath) {
        Remove-Item -Path $PublicDesktopShortcutPath -Force
    }

   
$PublicDesktopShortcut = $WScriptShell.CreateShortcut($PublicDesktopShortcutPath)
    $PublicDesktopShortcut.TargetPath = $EclipsePath
    $PublicDesktopShortcut.Save()
} catch {
    Write-Output "Error: $_"
}


uninstallEclipse.ps1

Stop-Process -Name eclipse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "$env:ProgramFiles\Eclipse IDE" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item "$env:Public\Desktop\Eclipse IDE.lnk" -Force -ErrorAction SilentlyContinue
Remove-Item "$env:ALLUSERSPROFILE\Microsoft\Windows\Start Menu\Programs\Eclipse IDE.lnk" -Force -ErrorAction SilentlyContinue


3. Create a folder with the following contents




4. Use the Microsoft Win32 Content Prep Tool to package the files for uploading to Intune

See guide

5. Use the following deployment options

Program options


Install command: 

C:\Windows\sysnative\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File installEclipse.ps1

Uninstall command:

C:\Windows\sysnative\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "C:\Program Files\Eclipse IDE\eclipse\uninstallEclipse.ps1"

Install behavior: System

 

Detection rules

Rule type: File
Path: C:\Program Files\Eclipse IDE\eclipse
File or folder: eclipse.exe
Detection method: File or folder exists

Print Article

Related Articles (1)

A comprehensive Windows software deployment guide using Microsoft Intune