Skip to content

Commit 370f6ae

Browse files
committed
Checksum files within macOS app bundle dirs
We need to include these dirs so that the Updater can manage macOS apps shipped as *part of* Fiji, rather than the toplevel Fiji dir itself being a macOS app. These days, Apple's code-signing requirement makes it nigh-impossible to have a self-modifying app bundle (which Fiji has been until now). Simpler to ship a slim immutable signed Fiji.app that looks for resources on the outside (i.e. `Fiji.app/..`).
1 parent e6e1d7e commit 370f6ae

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/main/java/net/imagej/updater/Checksummer.java

+11
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,17 @@ protected void initializeQueue() {
500500
for (final String launcher : files.util.launchers)
501501
queueIfExists(launcher);
502502

503+
// Queue any macOS .app folders.
504+
File appDir = files.getAppRoot();
505+
if (appDir != null) {
506+
Set<String> allExtensions = Collections.singleton("");
507+
for (File file : appDir.listFiles()) {
508+
if (file.isDirectory() && file.getName().endsWith(".app")) {
509+
queueDir(file.getName(), allExtensions);
510+
}
511+
}
512+
}
513+
503514
for (int i = 0; i < directories.length; i += 2)
504515
queueDir(directories[i], directories[i + 1]);
505516

src/main/java/net/imagej/updater/FilesCollection.java

+4
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ public FilesCollection(final LogService log, final File imagejRoot) {
125125
updateSite.setOfficial(true);
126126
}
127127

128+
public File getAppRoot() {
129+
return imagejRoot;
130+
}
131+
128132
public UpdateSite addUpdateSite(final String name, final String url,
129133
final String sshHost, final String uploadDirectory, final long timestamp)
130134
{

0 commit comments

Comments
 (0)