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

further improvements for extraction of MSI and PKG #1010

Closed
4 tasks
hohwille opened this issue Dec 13, 2022 · 2 comments · Fixed by #1041
Closed
4 tasks

further improvements for extraction of MSI and PKG #1010

hohwille opened this issue Dec 13, 2022 · 2 comments · Fixed by #1041
Assignees
Labels
enhancement New feature or request functions related to the collection of bash functions in functions[-core] file setup related to the setup process of devonfw-ide (setup[.bat] and devon ... setup)

Comments

@hohwille
Copy link
Member

hohwille commented Dec 13, 2022

As discussed in PR #1002 I want to further improve our doInstall function to avoid quirks in the commandlets:

  • with Support for MSI #978 we have added support for MSI extraction. However, msiexec does not only extract the MSI file but also creates a copy of the MSI in the target folder. This is undesired. As I did not find an option for msiexec to prevent this nonsense, we should simply delete the copy after calling msiexec.
  • the same way we support MSI now (Support for MSI #978), we should also support pkg packages on macos and automatically extract them rather than doing this manually in our commandlets. Again everything can be found in #978 support for msi and adjustment of aws commandlet #1002 (see my review comments)
  • we already do support special cases where an extracted package only contains a single folder that then contains the actual content. If so, we simply take that content and therefore omit the single folder automatically. For e.g. AWS we would need to extend this so it works in a loop so that also a 2nd level single folder can be omitted. However, besides *.app folders we would also need to exclude bin folders to avoid accidental buggy behavior:
    function doReplaceExtractedSkipSingleFolder() {
  • at the end we should remove the "workarounds" from the AWS commandlet that are now already handled by our updated functions.

Examples to make the last point clear (the asterisk * marks the folder containing the content that should appear inside the target folder such as software/«tool»):

«package1 root»
└── Amazon
   └── AWSCLIV2 (*)
      ├── _asyncio.pyd
      ├── ...
      ├── aws.exe
      ├── ...
      └── wheel-0.37.0.dist-info

«package2 root» (*)
└── bin
  └── my-tool

«package3 root»
└── Foo (*)
  └── bin
     └── my-tool

«package4 root»
└── Foo (*)
  └── MacOs.app
      └── Content
          ├── bin
          ├── ...
          └── README.txt

@hohwille hohwille added enhancement New feature or request Team_IDE setup related to the setup process of devonfw-ide (setup[.bat] and devon ... setup) functions related to the collection of bash functions in functions[-core] file labels Dec 13, 2022
@hohwille
Copy link
Member Author

The extraction code for pkg from aws command was:

  elif doIsMacOs
  then
    doEcho "Installing AWS for MacOS..."
    sudo installer -pkg "${path_to_package}"/aws-"${version}"-mac.pkg -target /
    if [ "${ERR}" = 0 ]
    then
      xar -C "${AWS_HOME}" -xf "${AWS_HOME}"/aws-"${version_to_install}"-mac.pkg
      tar -C "${AWS_HOME}" -xzvf "${AWS_HOME}"/aws-cli.pkg/Payload
      rm -rf "${AWS_HOME}"/Distribution "${AWS_HOME}"/Resources "${AWS_HOME}"/aws-cli.pkg
      [ ! -h "${AWS_HOME}/aws" ] && ln -s "${AWS_HOME}"/aws-cli/aws "${AWS_HOME}"/aws
      [ ! -h "${AWS_HOME}/aws_completer" ] && ln -s "${AWS_HOME}"/aws-cli/aws_completer "${AWS_HOME}"/aws_completer
      [ -f "${AWS_HOME}"/aws-"${version_to_install}"-mac.pkg ] && rm "${AWS_HOME}"/aws-"${version_to_install}"-mac.pkg
    fi

@CREITZ25
Copy link
Member

How to see the configuration of a msi Archive:
https://learn.microsoft.com/en-us/windows/win32/msi/orca-exe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request functions related to the collection of bash functions in functions[-core] file setup related to the setup process of devonfw-ide (setup[.bat] and devon ... setup)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants