Skip to content

Conversation

@hinerm
Copy link
Member

@hinerm hinerm commented May 6, 2025

Because the app folder is signed as a whole, if any file changes the signing will have to change. This also means that if any file in Fiji.app is updated, we do not want to leave a .old version in the app folder as that will invalidate the signing.

Instead, if we now detect any file in the .app folder is updated, we archive the complete state of the app folder to a single .old.app, and flag all files in the .app folder for installation/update.

Because the app folder is signed as a whole, if any file changes the
signing will have to change. This also means that if any file in
Fiji.app is updated, we do not want to leave a .old version in the app
folder as that will invalidate the signing.

Instead, if we now detect any file in the .app folder is updated, we
archive the complete state of the app folder to a single .old.app, and
flag all files in the .app folder for installation/update.
@hinerm
Copy link
Member Author

hinerm commented May 6, 2025

@ctrueden this works for me and I'm happy with it. Can you test this on your system to make sure it behaves in a way you think is reasonable too?

The way I tested it was with:

  • An up-to-date Fiji
  • With a locally built copy of this imagej-updater.jar
  • With one file in Fiji.app modified (e.g. with a locally built jaunch launcher)

If you update the modified file you should end up with a Fiji.old.app that has all the old state, and a clean Fiji.app. Neither should have any .old files inside of them.

Let me know if that doesn't work for you or if you think anything should work differently here

@hinerm hinerm requested a review from ctrueden May 6, 2025 20:27
Copy link
Member

@ctrueden ctrueden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! The directory deleting and copying code is kinda clunky, but if it works, I'm not worried about it. Can always be improved later.

return file.renameTo(backup);
}

private static void deleteDirectory(Path directory) throws IOException {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you didn't use org.scijava.util.FileUtils.deleteRecursively?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:( I forgot it existed

@ctrueden ctrueden merged commit d7aab2b into master May 8, 2025
1 check passed
@hinerm hinerm deleted the update-mac-bundle branch May 12, 2025 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants