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

devon ide update scripts: previous version of devon scripts installed in home directory instead of latest ones. #1312

Open
hohwille opened this issue Aug 4, 2023 · 1 comment
Labels
bug Something isn't working scripts related to shell scripts (bash and CMD) update related to updating software or the entire devonfw-ide windows specific for Microsoft Windows OS

Comments

@hohwille
Copy link
Member

hohwille commented Aug 4, 2023

Expected behavior

After running devon ide update scripts, I do not only want to have my current IDE installation updated to the latest version (if an update is available) but also have the global scripts ~/.devon/devon and ~/scripts/devon.bat updated to the latest version.

Actual behavior

On windows the scripts of the previous release that I did run the devon ide update scripts on are installed in my home directory.
In case I have a very old instance of devonfw-ide this can cause problems as I then get that very old devon scripts installed globally that could break all my newly updated installations.

Steps to reproduce (bug) / Use Case of feature request (enhancement)

  1. go to an old installation of devonfw-ide on a Windows machine
  2. run devon ide update scripts
  3. run devon -v

Related/Dependent Issues

Comments/Hints:

From #1032:
I guess a general problem is that we are obviously running the "old" version of the devon script to trigger the update. On windows this is causing issues with file locks as windows is locking the script while it is running so it cannot replace itself. As a workaround we do that asynchronously. Therefore, we cannot invoke the "fix" synchronously in this case.
The magic spots related to this can be found here:

if [ "${2}" = "${DEVON_IDE_HOME}" ]

if [ "${target}" = "${DEVON_IDE_HOME}/scripts" ] && doIsWindows
then
(sleep 10;doBackup "${target}" "${3}";doRunCommand "mv '${1}' '${target}'") &

Affected version:

  • IDE: any version up to the latest 2023.08.001
  • OS: Windows
@hohwille hohwille added bug Something isn't working windows specific for Microsoft Windows OS scripts related to shell scripts (bash and CMD) update related to updating software or the entire devonfw-ide labels Aug 4, 2023
@hohwille
Copy link
Member Author

hohwille commented Aug 4, 2023

Maybe a solution to this would be to move the following update logic to a new function:

cp "${DEVON_IDE_HOME}/scripts/devon" ~/.devon/devon
fi
if doIsWindows
then
if [ "${target_version}" = "LATEST" ]
then
cp "${DEVON_IDE_HOME}/scripts/devon.bat" "${USERPROFILE}/scripts/devon.bat"

Then we invoke it in the old place but only if we are not on windows.
Additionally here we also need to invoke it then:

(sleep 10;doBackup "${target}" "${3}";doRunCommand "mv '${1}' '${target}'") &

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working scripts related to shell scripts (bash and CMD) update related to updating software or the entire devonfw-ide windows specific for Microsoft Windows OS
Projects
None yet
Development

No branches or pull requests

1 participant