application creation eclipse from intune

Richa Kumari 286 Reputation points
2023-07-10T10:11:44.42+00:00

Hello ,I am working on eclipse app deployment .I manually test the app installation, that required first extracting the downloaded eclipse-java-2023-06-R-win32-x86_64.ZIP" zip format setup at program file location then create shortcuts at desktop using script ,that it.
command for extracting
C:>"%ProgramFiles%\7-Zip\7z.exe" x -o"%ProgramFiles%\Eclipse\java-2022" ".\eclipse-java-2023-06-R-win32-x86_64.ZIP"

I am not getting a way to copy the zip file and then extract at program file location through Intune.
What is the best way to do it.

Thanks
Richa

Microsoft Intune Application management
Microsoft Intune Application management
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Application management: The process of creating, configuring, managing, and monitoring applications.
977 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
5,541 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Nick Eckermann 596 Reputation points
    2023-07-10T14:54:16.7666667+00:00

    You should use the Microsoft Win32 Content Prep Tool and create a script to do what you need.
    You put everything in the source folder and do the work in the script from the folder "."

    https://learn.microsoft.com/en-us/mem/intune/apps/apps-win32-add
    https://learn.microsoft.com/en-us/mem/intune/apps/apps-win32-prepare

    Detection for the win32 app could check if the folder exists or you can put some logic in the script to check if the extraction succeeds and the shortcut copies successfully and then write a registry key. When running scripts in win32 app installs you need to change the context it runs in so registry keys get written correctly. Here is a quick example.

    # If we are running as a 32-bit process on an x64 system, re-launch as a 64-bit process
    if ("$env:PROCESSOR_ARCHITEW6432" -ne "ARM64")
    {
        if (Test-Path "$($env:WINDIR)\SysNative\WindowsPowerShell\v1.0\powershell.exe")
        {
            & "$($env:WINDIR)\SysNative\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy bypass -NoProfile -File "$PSCommandPath"
            Exit $lastexitcode
        }
    }
    Expand-Archive -Path ".\eclipse-java-2023-06-R-win32-x86_64.ZIP" -DestinationPath "$env:ProgramFiles\Eclipse\java-2022"
    $ShortCuts = ".\Shortcut1.lnk", ".\shortcut2.lnk"
    
    foreach ($ShortCut in $ShortCuts) {
        Copy-Item -Path $ShortCut -Destination "C:\Users\Public\Desktop\$ShortCut"
    }
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.