Skip to content

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

@hohwille

Description

@hohwille

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingscriptsrelated to shell scripts (bash and CMD)updaterelated to updating software or the entire devonfw-idewindowsspecific for Microsoft Windows OS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions