postinst.in 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/usr/bin/env bash
  2. #
  3. # Copyright (c) Contributors to the Open 3D Engine Project.
  4. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. #
  6. # SPDX-License-Identifier: Apache-2.0 OR MIT
  7. #
  8. #
  9. set -o errexit # exit on the first failure encountered
  10. {
  11. ln -s @CPACK_PACKAGING_INSTALL_PREFIX@/bin/Linux/profile/Default/o3de /usr/local/bin/o3de
  12. ln -s @CPACK_PACKAGING_INSTALL_PREFIX@/bin/Linux/profile/Default/AssetProcessor /usr/local/bin/o3de.assetprocessor
  13. ln -s @CPACK_PACKAGING_INSTALL_PREFIX@/bin/Linux/profile/Default/Editor /usr/local/bin/o3de.editor
  14. # Generate the desktop icon
  15. DESKTOP_ICON_FILE=/usr/share/applications/o3de.desktop
  16. echo -e "[Desktop Entry]\n\
  17. Version=@CPACK_PACKAGE_VERSION@\n\
  18. Name=O3DE\n\
  19. Comment=O3DE Project Manager\n\
  20. Type=Application\n\
  21. Exec=@CPACK_PACKAGING_INSTALL_PREFIX@/bin/Linux/profile/Default/o3de\n\
  22. Path=@CPACK_PACKAGING_INSTALL_PREFIX@/bin/Linux/profile/Default/\n\
  23. Icon=@CPACK_PACKAGING_INSTALL_PREFIX@/o3de.svg\n\
  24. Terminal=false\n\
  25. StartupWMClass=O3DE.SNAP\n\
  26. StartupNotify=true\n\
  27. X-GNOME-Autostart-enabled=true\n\
  28. " > $DESKTOP_ICON_FILE
  29. if [ "" != "$SUDO_USER" ]
  30. then
  31. pushd @CPACK_PACKAGING_INSTALL_PREFIX@
  32. chown -R $SUDO_USER .
  33. sudo -u $SUDO_USER python/get_python.sh
  34. popd
  35. fi
  36. }
  37. #&> /dev/null # hide output