#1917: add scripts for gui shortcut launcher windows, linux, macos#2037
#1917: add scripts for gui shortcut launcher windows, linux, macos#2037quando632 wants to merge 26 commits into
Conversation
Coverage Report for CI Build 29107234689Coverage increased (+0.02%) to 72.243%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions76 previously-covered lines in 1 file lost coverage.
Coverage Stats💛 - Coveralls |
The script works and the shortcut does appear in the Application Menu, but I cannot seem to open it either from the Launcher or by using the script in the home directory itself. |
….com/quando632/IDEasy into feature/1917-create-desktop-shortcut
There was a problem hiding this comment.
when running the create-shortcuts in windows i get this:
$ powershell -File create-shortcuts.ps1
IDEasy GUI Launcher Setup
Project: C:\Users\projects\IDEasy\workspaces\main\IDEasy
Icon generated from devonfw.png
Creating shortcut: C:\Users\OneDrive - Capgemini\Desktop\IDEasy GUI.lnk
Created: C:\Users\OneDrive - Capgemini\Desktop\IDEasy GUI.lnk
Creating shortcut: C:\Users\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\IDEasy GUI.lnk
Created: C:\Users\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\IDEasy GUI.lnk
Setup complete!
But when running the gui i get this error
Error: IDEasy is not installed or not in PATH
https://github.com/devonfw/IDEasy#setup
Press any key to continue . . .
|
In macos i get this But then when opening the shortcut i get this |
|
Tested again after the changes on Windows and macOS. The shortcut was successfully created, and when clicking on it, the GUI launches. |
|
I tested the scripts locally on Linux again from the branch checkout and it works as intended. The Also it is worth noting that the scripts are committed without the executable bit, so I had to |
Scripts were committed as 644 (likely from a Windows checkout), requiring a manual chmod +x before they could be run directly after checkout.
|
Yeah you right i have added the correct executable bit for linux now |
hohwille
left a comment
There was a problem hiding this comment.
@quando632 thanks for your PR. 👍
However, it seems things have been not clear.
Wasn't the expectation of the story #1917 that the start-menu entry and/or desktop shortcut gets installed automatically during the installation of IDEasy?
How would the end-user run create-shortcuts script if it is not included in our release that the end-user will download (he usually does not have the source-code of IDEasy)?
Further, sorry, if nobody told you before but after lots of trouble with scripting hell in CMD, Power-Shell, Bash, etc. we have decided to avoid such scripting and do as much as possible in Java avoiding any scripting as much as possible - see for example #1055
Since the scripts are not working for me, I think we need some rework.
I would suggest the following:
- ensure to include our logo into the release, please also use our IDEasy logo instead of
devonfw.pngwhat is not our project logo. - as the logo will IMHO not change, simply generate the
logo.icofor windows and also add it to git then you can avoid all the complex transformation scripting logic. - put the creation of the desktop entry into the Java installation code with OS specific if else coding. In case it is not clear where this is get started here:
IDEasy/cli/src/main/java/com/devonfw/tools/ide/tool/IdeasyCommandlet.java
Lines 267 to 301 in 423b614
- You can still include a static asset for e.g. the linux desktop file
ideasy-gui.desktopinto the OS specific folder under a new Linux subfolder. Then you can use maven filtering with placeholders so instead of hardcoding the version to1.0you can use
Version=$[project.version]
See here for how we have configured maven for this:
Line 165 in 423b614
…esktop-shortcut # Conflicts: # CHANGELOG.adoc
…-desktop-shortcut # Conflicts: # CHANGELOG.adoc
….com/quando632/IDEasy into feature/1917-create-desktop-shortcut
There was a problem hiding this comment.
@quando632 thanks for your rework. This looks great now. 👍
Sorry, I could not fully complete the review today. However, I already wanted to provide the review comments I already made.
I guess there will not come more but I still have to complete the review next week.
BTW: For the logo.png that we here use as a small icon, should we scale it down and make it smaller? Otherwise we already have the logo.png in our git. If we keep it as is can't we avoid duplicating it in git by moving it and changing the references or by including it into the Linux assembly from its existing location?
| @@ -0,0 +1,10 @@ | |||
| [Desktop Entry] | |||
| Version=test-SNAPSHOT | |||
There was a problem hiding this comment.
| Version=test-SNAPSHOT | |
| Version=$[project.version] |
| Type=Application | ||
| Name=IDEasy GUI | ||
| Comment=Launch IDEasy GUI | ||
| Exec=@IDEASY_BIN@ gui |
There was a problem hiding this comment.
Can't we come up with a simple command here that needs no additional replacement?
Something like
bash -c "$IDE_ROOT/_ide/installation/bin/ideasy gui"
| @@ -0,0 +1 @@ | |||
| logo.ico mock No newline at end of file | |||
There was a problem hiding this comment.
Can't you just remove this Downloads folder and instead in your test simply copy ../cli/src/main/package/ to the faked HOME directory and use that as "installationPath"?
Then you do not need to mock resources.
And in case you do a *.png or *.ico file it should be valid (it may be an empty image with 0x0 pixels but it should be a valid png/ico file then).
Still the easiest and most maintainable solution should be to delete this Downloads folder and copy the real files.


This PR fixes #1917
Implemented changes
Instead of separate shell scripts (which end users never have access to), the shortcut creation
is now implemented directly in Java inside
IdeasyCommandlet.installIdeasy().~/.local/share/applications/ideasy-gui.desktopfrom a bundled template,calls
update-desktop-databaseand marks it as trusted viagio set metadata::trusted~/Applications/IDEasy GUI.command(a.commandfile is executable by Finder)Shell Foldersregistry key (handlesOneDrive-redirected Desktops), then creates
.lnkshortcuts on the Desktop and in theStart Menu via PowerShell
WScript.ShellAssets added to the release package (
cli/src/main/package/gui/):logo.png— IDEasy logo used as icon on Linux/macOSlogo.ico— pre-generated ICO for Windows shortcutslinux/ideasy-gui.desktop—.desktoptemplate (version injected by Maven at build time)The old
gui/scripts/shell scripts are removed — they were never part of the releasedistribution and never reached end users.
Testing instructions
Windows
ideasy install(orsetup.batfrom a fresh download)Linux
ideasy install~/.local/share/applications/ideasy-gui.desktopis createdmacOS
ideasy install~/Applications/IDEasy GUI.commandis createdChecklist for this PR
Make sure everything is checked before merging this PR. For further info please also see
our DoD.
mvn clean testlocally all tests pass and build is successful#«issue-id»: «brief summary»(e.g.#921: fixed setup.bat). If no issue ID exists, title only.In Progressand assigned to you or there is no issue (might happen for very small PRs)with
internal