Skip to content

#423 Added PKG Installer build for macOS systems - #2098

Open
laim2003 wants to merge 35 commits into
devonfw:mainfrom
laim2003:feature/#433-macos-installer
Open

#423 Added PKG Installer build for macOS systems#2098
laim2003 wants to merge 35 commits into
devonfw:mainfrom
laim2003:feature/#433-macos-installer

Conversation

@laim2003

@laim2003 laim2003 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #423

Implemented changes:

  • Modifed both release.yml and nightly-build.yaml to build, upload and publish a PKG-based installer. PKG-Installers are the macOS equivalent of MSI files on windows.
  • The installer includes a license agreement and setup instructions.
grafik
  • macOS installer setup folders
  • macOS installer task is in release.yml
  • macOS installer task is in nightly-build.yml
  • Correct artifact upload
  • macOS installer gets attached to release
  • verify update behaviour

A few notes:

  • In this state, I did not add a signature to the installer, as this from what I could tell during the research I did for this issue, this requires an Apple Developer License. So for now, users will most likely have to follow the typical mac gatekeeper workaround by going to "Privacy & Security" in the settings in order to open the installer.
  • Also, this installer currently only supports the installation into the standard "[user]/projects/" path. Giving users the option to choose their own path can be implemented later, as this is a bit more complicated to implement in the macOS PKG installer.

Testing instructions

Disclaimer: Testing this requires a mac.

  1. Do a complete build by copying the commands from release.yml (Tasks: 1. Build native image and then Build MacOS PKG) and running them from /workspaces/main/ideasy/
  2. Uninstall the current version of IDEasy.
  3. verfiy IDEasy is uninstalled using ide -v
  4. As a result of the build, you should find a IDEasy-[versionname].pkg file under /macos-installer
  5. Open the file; an installer window should now show up.
  6. The title of the installer should be "IDEasy - [Version]"
  7. Follow the installer steps. They should include agreeing to IDEasys' license, then it will prompt you wether you really want to install, and then it should show you a "conclusion" screen, that includes a first-steps-instruction page.
  8. After the installation, IDeasy should be installed under the standard /projects/_ide/ folder and the ide command should be usable from the command line.
  9. Verify using ide -v in the default mac terminal
  10. Under /projects/_ide/tmp NO ideasy folder should exist after a succesful installation

Retesting:

  1. Download the PKG file that should now be included in the nightly builds and test wether it succesfully installs like above.

Checklist for this PR

Make sure everything is checked before merging this PR. For further info please also see
our DoD.

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summarizes what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labeled
    with internal
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Jul 1, 2026
@laim2003 laim2003 self-assigned this Jul 1, 2026
@laim2003 laim2003 added install installation process of IDE + tools and install commandlet macOS specific for Apple MacOS labels Jul 1, 2026
@coveralls

coveralls commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 30590298921

Coverage decreased (-0.02%) to 72.621%

Details

  • Coverage decreased (-0.02%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 1 coverage regression across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/tools/ide/version/VersionSegment.java 1 91.08%

Coverage Stats

Coverage Status
Relevant Lines: 17282
Covered Lines: 13086
Line Coverage: 75.72%
Relevant Branches: 7653
Covered Branches: 5022
Branch Coverage: 65.62%
Branches in Coverage %: Yes
Coverage Strength: 3.21 hits per line

💛 - Coveralls

@laim2003 laim2003 moved this from 🆕 New to 🏗 In progress in IDEasy board Jul 3, 2026
@oanding-blrng oanding-blrng self-assigned this Jul 3, 2026
@laim2003 laim2003 changed the title #433 Added PKG Installer build for macOS systems #432 Added PKG Installer build for macOS systems Jul 3, 2026
@laim2003 laim2003 changed the title #432 Added PKG Installer build for macOS systems #423 Added PKG Installer build for macOS systems Jul 3, 2026
@laim2003
laim2003 force-pushed the feature/#433-macos-installer branch from 4a6b166 to 51a5cc9 Compare July 3, 2026 16:31
@laim2003 laim2003 moved this from 🏗 In progress to Team Review in IDEasy board Jul 4, 2026
@laim2003
laim2003 marked this pull request as ready for review July 4, 2026 13:09
@oanding-blrng

oanding-blrng commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

@laim2003
I'm able to create the PKG installer, but I can't install IDEasy with it. It get the following output from the installer which is fine due to the mentioned lack of the Apple Developer License. But the mac gatekeeper workaround isn't working for me, because the option to allow the specific program doesn't appear. The workaround still works for the traditional way via extracting the .tar.gz and running setup.

Bild 06 07 26 um 10 44

@laim2003

laim2003 commented Jul 6, 2026 via email

Copy link
Copy Markdown
Contributor Author

@OscarVertonix

OscarVertonix commented Jul 6, 2026

Copy link
Copy Markdown

Installation protocol (Error and status messages):

Jul  6 13:26:31 MacBookPro Installer[7862]: @(#)PROGRAM:Install  PROJECT:Install-1000
Jul  6 13:26:31 MacBookPro Installer[7862]: @(#)PROGRAM:Installer  PROJECT:Installer-1359.120.1
Jul  6 13:26:31 MacBookPro Installer[7862]: Hardware: MacBookPro18,1 @ 2.40 GHz (x 10), 32768 MB RAM
Jul  6 13:26:31 MacBookPro Installer[7862]: Running OS Build: macOS 26.5.1 (25F80)
Jul  6 13:26:31 MacBookPro Installer[7862]: IDEasy - 2026.07.001  Installation Log
Jul  6 13:26:31 MacBookPro Installer[7862]: Opened from: /Users/vertonix/projects/IDEasy/workspaces/pr-2098-pkg-installer-macos/IDEasy/macos-installer/IDEasy-2026.07.001.pkg
Jul  6 13:26:31 MacBookPro Installer[7862]: Failed to load specified background image
Jul  6 13:26:31 MacBookPro Installer[7862]: Could not load resource readme: (null)
Jul  6 13:26:36 MacBookPro Installer[7862]: ================================================================================
Jul  6 13:26:36 MacBookPro Installer[7862]: User picked Standard Install
Jul  6 13:26:36 MacBookPro Installer[7862]: Choices selected for installation:
Jul  6 13:26:36 MacBookPro Installer[7862]: 	Installieren: "IDEasy - 2026.07.001"
Jul  6 13:26:36 MacBookPro Installer[7862]: 	Installieren: "(null)"
Jul  6 13:26:36 MacBookPro Installer[7862]: ================================================================================
Jul  6 13:26:38 MacBookPro Installer[7862]: Configuring volume "Macintosh HD"
Jul  6 13:26:38 MacBookPro Installer[7862]: Free space on "Macintosh HD": 237,04 GB (237036875776 bytes).
Jul  6 13:26:38 MacBookPro Installer[7862]: Create temporary directory "/var/folders/7t/bmvv3jrd7k9chztwf_9_spwm0000gn/T//Install.7862P2zivJ"
Jul  6 13:26:38 MacBookPro Installer[7862]: IFPKInstallElement (1 packages)
Jul  6 13:26:38 MacBookPro Installer[7862]: PackageKit: Enqueuing install with framework-specified quality of service (utility)
Jul  6 13:26:38 MacBookPro installd[759]: PackageKit: ----- Begin install -----
Jul  6 13:26:41 MacBookPro installd[759]: PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=112 "Beim Ausführen der Skripts aus dem Paket „IDEasy-2026.07.001.pkg“ ist ein Fehler aufgetreten." UserInfo={NSFilePath=./postinstall, NSURL=file:///Users/vertonix/projects/IDEasy/workspaces/pr-2098-pkg-installer-macos/IDEasy/macos-installer/IDEasy-2026.07.001.pkg#IDEasyComponent.pkg, PKInstallPackageIdentifier=com.devonfw.ideasy, NSLocalizedDescription=Beim Ausführen der Skripts aus dem Paket „IDEasy-2026.07.001.pkg“ ist ein Fehler aufgetreten.} {
	    NSFilePath = "./postinstall";
	    NSLocalizedDescription = "Beim Ausf\U00fchren der Skripts aus dem Paket \U201eIDEasy-2026.07.001.pkg\U201c ist ein Fehler aufgetreten.";
	    NSURL = "file:///Users/vertonix/projects/IDEasy/workspaces/pr-2098-pkg-installer-macos/IDEasy/macos-installer/IDEasy-2026.07.001.pkg#IDEasyComponent.pkg";
	    PKInstallPackageIdentifier = "com.devonfw.ideasy";
	}
Jul  6 13:26:42 MacBookPro Installer[7862]: Install failed: Die Installation ist aufgrund eines Fehlers fehlgeschlagen. Wende dich an den Hersteller der Software.
Jul  6 13:26:42 MacBookPro Installer[7862]: IFDInstallController 29C0000 state = 8
Jul  6 13:26:42 MacBookPro Installer[7862]: Displaying 'Install Failed' UI.
Jul  6 13:26:42 MacBookPro Installer[7862]: 'Install Failed' UI displayed message:'Die Installation ist aufgrund eines Fehlers fehlgeschlagen. Wende dich an den Hersteller der Software.'.

Last message mentioned a problem with the UI. Maybe the underlying problem here is connected to the nightly build (https://github.com/devonfw/IDEasy/actions/runs/28696754044/job/85107587327).

@laim2003

laim2003 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@oanding-blrng i quickly pushed a small fix. now, when you look at the installation log, you should see a log message that points to the IDEasy installation log. Also, what size did the installer display when choosing the disk?

@OscarVertonix

Copy link
Copy Markdown

The installtion log:

Looking for IDE_HOME in /private/tmp/PKInstallSandbox.TAVyLP/Scripts/com.devonfw.ideasy.E2YkRS
Looking for IDE_HOME in /private/tmp/PKInstallSandbox.TAVyLP/Scripts
Looking for IDE_HOME in /private/tmp/PKInstallSandbox.TAVyLP
Looking for IDE_HOME in /private/tmp
Looking for IDE_HOME in /private
Looking for IDE_HOME in /
System console not available - using System.in as fallback
Starting step ide with params [install]...
Trying to match arguments to commandlet install
Trying to match argument 'install'
Next property candidate to match argument is KeywordProperty[install:true]
Running commandlet InstallCommandlet[install]
Properties not found at /Users/vertonix/.ide/ide.properties
Properties not found at /Users/vertonix/devon.properties
CONF: Variable IDE_WRITE_LOGFILE is undefined.
WORKSPACE: Variable IDE_WRITE_LOGFILE is undefined.
SETTINGS: Variable IDE_WRITE_LOGFILE is undefined.
USER@/Users/vertonix/.ide/ide.properties: Variable IDE_WRITE_LOGFILE is undefined.
SYSTEM: Variable IDE_WRITE_LOGFILE is undefined.
Cannot enable log-file since IDE_ROOT is undefined.
Detected that IDEasy is running as graalvm native image...
Installing IDEasy from /Library/IDEasy
Missing required file IDEasy.pdf
Step 'ide' ended with failure.
ide (install) failed after PT0.004S

IDEasy release is inconsistent at /Library/IDEasy [artifact=IDEasy.pdf]

The installer is showing 62,5 MB for the size. Although not in the "Choose Disk" but rather in "Installation type". I only have one big partition for the hard drive. I assume, that MacOS and the installer dosn't bother to ask if there is only one possible option to choose.

@OscarVertonix

Copy link
Copy Markdown

For better manual testing I extracted the relevant commands from the jobs of release.yaml into it's own script.

maven_config="$(cat .mvn/maven.config)"
current_version="${maven_config/#*-Drevision=}"
current_version="${current_version/ */}"
next_version="${current_version/-SNAPSHOT/}"
cd cli
mvn -B -ntp -Drevision=${next_version} -Pnative -DskipTests=true package
cd ..

cd documentation
mvn -B -ntp clean install
cd ..
mkdir -p macos-installer/pkg-root/Library/IDEasy/bin
mkdir -p macos-installer/Resources
cp documentation/target/generated-docs/LICENSE.rtf macos-installer/Resources/LICENSE.rtf
cp -r cli/target/package/* macos-installer/pkg-root/Library/IDEasy/
rm -rf macos-installer/pkg-root/Library/IDEasy/system/windows
rm -rf macos-installer/pkg-root/Library/IDEasy/system/linux
cp cli/target/ideasy macos-installer/pkg-root/Library/IDEasy/bin/
chmod +x macos-installer/pkg-root/Library/IDEasy/bin/ideasy
chmod +x macos-installer/scripts/postinstall
cd macos-installer
pkgbuild --root pkg-root --identifier com.devonfw.ideasy \
  --version $next_version --install-location "/" \
  --scripts scripts IDEasyComponent.pkg
sed -i '' "s/\${next_version}/${next_version}/" Distribution.xml
productbuild --distribution Distribution.xml --resources Resources \
  --package-path . IDEasy-$next_version.pkg

@laim2003

Copy link
Copy Markdown
Contributor Author

I now updated the cleaning task.

@laim2003

laim2003 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

So i tried the PKG installer on a completely clean, freshly installed virtual machine as well and I had no problems there. I recommend you run mvn clean, then again run the most recent version of the nightly build scripts and try again.

@laim2003 laim2003 moved this from 🏗 In progress to Team Review in IDEasy board Jul 24, 2026
@laim2003
laim2003 requested a review from oanding-blrng July 24, 2026 13:57

@oanding-blrng oanding-blrng left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to:

  • create a PKG installer with the steps mentioned in nightly-build.yml and release.yml
  • install IDEasy without additional steps regarding security settings
  • upgrade IDEasy with ide upgrade --mode=... without problems
  • install IDEasy in proper location without additional files/directories somewhere else

After the suggestion this pr can move forward.

Comment thread macos-installer/src/Distribution.xml
fixed background not visible on dark  theme systems

Co-authored-by: OAnding <oscar.anding@capgemini.com>
@laim2003 laim2003 moved this from Team Review to 👀 In review in IDEasy board Jul 27, 2026
@laim2003 laim2003 added this to the release:2026.08.001 milestone Jul 27, 2026
@laim2003
laim2003 marked this pull request as draft July 27, 2026 12:17
@laim2003
laim2003 marked this pull request as ready for review July 27, 2026 15:31
Comment thread macos-installer/Distribution.xml Outdated
Comment thread macos-installer/src/Distribution.xml
Comment thread .github/workflows/release.yml Outdated
* Windows: https://repo1.maven.org/maven2/com/devonfw/tools/IDEasy/ide-cli/${current_version}/ide-cli-${current_version}-windows-x64.tar.gz
* Mac(arm64): https://repo1.maven.org/maven2/com/devonfw/tools/IDEasy/ide-cli/${current_version}/ide-cli-${current_version}-mac-arm64.tar.gz
* Mac(x64): https://repo1.maven.org/maven2/com/devonfw/tools/IDEasy/ide-cli/${current_version}/ide-cli-${current_version}-mac-x64.tar.gz
* Mac(PKG): https://repo1.maven.org/maven2/com/devonfw/tools/IDEasy/ide-cli/${current_version}/ide-cli-${current_version}-mac.pkg

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is implemented properly. I oriented myself based on the MSI link above.

@laim2003
laim2003 requested a review from hohwille July 27, 2026 15:48

@hohwille hohwille left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@laim2003 thanks for this PR and the nice work behind all this. 👍
Sorry, that I also have to add my concerns and left you with some rework.
However, I hope it all makes sense to improve and finally merge a clean solution for this feature.

maven_config="$(cat .mvn/maven.config)"
current_version="${maven_config/#*-Drevision=}"
current_version="${current_version/ */}"
cd documentation

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not copy&paste this.
PR #2223 just introduced a clean solution to avoid this.
Please use RELEASE_VERSION variable.

Comment on lines +98 to +115
cd documentation
mvn -B -ntp clean install
cd ..
mkdir -p macos-installer/pkg-root/bin
mkdir -p macos-installer/Resources
cp documentation/target/generated-docs/IDEasy.pdf macos-installer/pkg-root/
cp documentation/target/generated-docs/LICENSE.rtf macos-installer/Resources/LICENSE.rtf
cp cli/target/macos-installer/Distribution.xml macos-installer/Distribution.xml
cp -r cli/target/package/* macos-installer/pkg-root/
cp cli/target/ideasy macos-installer/pkg-root/bin/
rm -rf macos-installer/pkg-root/system/windows
rm -rf macos-installer/pkg-root/system/linux
chmod +x macos-installer/pkg-root/bin/ideasy
chmod +x macos-installer/scripts/postinstall
cd macos-installer
pkgbuild --root pkg-root --identifier com.devonfw.ideasy --version $current_version --install-location /projects/_ide/tmp/ideasy --scripts scripts IDEasyComponent.pkg
productbuild --distribution Distribution.xml --resources Resources --package-path . ideasy.pkg
# pkgbuild is responsible for building the installation bundle. By using productbuild, we can custimze the installation process, including things like showing a license.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

workflows are hard to test, read and maintain.
Maybe better extract to a shell script in our repo that you call from the workflow.
Then mac developers can also update and test this script in isolation without the workflow that is hard to test.

Comment on lines +122 to +125
maven_config="$(cat .mvn/maven.config)"
current_version="${maven_config/#*-Drevision=}"
current_version="${current_version/ */}"
next_version="${current_version/-SNAPSHOT/}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Use new variables.

Comment on lines +126 to +143
cd documentation
mvn -B -ntp clean install
cd ..
mkdir -p macos-installer/pkg-root/bin
mkdir -p macos-installer/Resources
cp documentation/target/generated-docs/IDEasy.pdf macos-installer/pkg-root/
cp documentation/target/generated-docs/LICENSE.rtf macos-installer/Resources/LICENSE.rtf
cp cli/target/macos-installer/Distribution.xml macos-installer/Distribution.xml
cp -r cli/target/package/* macos-installer/pkg-root/
cp cli/target/ideasy macos-installer/pkg-root/bin/
rm -rf macos-installer/pkg-root/system/windows
rm -rf macos-installer/pkg-root/system/linux
chmod +x macos-installer/pkg-root/bin/ideasy
chmod +x macos-installer/scripts/postinstall
cd macos-installer
pkgbuild --root pkg-root --identifier com.devonfw.ideasy --version $next_version --install-location /projects/_ide/tmp/ideasy --scripts scripts IDEasyComponent.pkg
productbuild --distribution Distribution.xml --resources Resources --package-path . ideasy.pkg
# pkgbuild is responsible for building the installation bundle. By using productbuild, we can custimze the installation process, including things like showing a license.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirmed that we need to extract as script to avoid this copy&paste redundancies.

Comment thread cli/pom.xml
</configuration>
</execution>
<execution>
<id>Copy Distribution.xml [macOS Installer]</id>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an execution ID is not a descriptive comment but a short unique identifier without spaces and special characters. It may be there to be reference it from CLI or other POMs.
To add documentation simply use an XML comment.

Comment thread cli/pom.xml
Comment on lines +207 to +209
<delimiters>
<delimiter>$[*]</delimiter>
</delimiters>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of copy&paste you should extract this to <configuration> element outside of the <executions>.
It will then be inherited by all executions.

Comment thread .gitignore
graphify-out/

#macOs installer files
macos-installer/*.pkg

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
macos-installer/*.pkg
*.pkg

Comment thread pom.xml

<!-- Clean up macOS installer artifacts -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO we should improve the design how you integrated this into maven.
What if you instead create a new pom.xml inside macos-installer and add it as module in our top-level pom.xml.
Then you can do all the magic inside that POM and things get clear and consistent.
Currently it is buggy (if I call mvn clean on cli it will not revert what mvn install on cli has created) and hard to understand because aspects for macos-installer are spread across different POMs as well as copy commands in the workflow files (where we also could use maven or a script as already suggested).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

install installation process of IDE + tools and install commandlet macOS specific for Apple MacOS

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

Create installer for MacOS

5 participants