helloSystem / ISO

helloSystem Live and installation ISO
https://github.com/helloSystem/
BSD 3-Clause "New" or "Revised" License
806 stars 58 forks source link

.app bundles in archives mounted with mountarchive do not work #150

Closed probonopd closed 3 years ago

probonopd commented 3 years ago

.app bundles in archives mounted with mountarchive do not work yet, the user has to copy out the application first.

We should make it work.

Example: https://github.com/helloSystem/Utilities/archive/master.zip

Why?

Execute permission is there, application can be executed from the terminal.

-r-xr-xr-x  0 root  wheel    12K 16 Feb. 18:49 /var/run/user/1001/_home_user_Desktop_Utilities-master.zip/Utilities-master/3D Printing/FreeCAD.app/FreeCAD
kettle-7 commented 3 years ago

How do you use mountarchive?

probonopd commented 3 years ago

When it works, then just download the zip above, double-click it, and be able to execute the applications therein. If that doesn't work yet, then we have a bug ;-)

kettle-7 commented 3 years ago

I think it mounts it, but doesn't open the mounted folder.

Edit:

No, it can't mount it because it doesn't have write access to /run

kettle-7 commented 3 years ago

More importantly (but not for this issue), how do you associate a file with a .app bundle?

kettle-7 commented 3 years ago

My Fonts.tar.gz works fine, I think it's something about that particular zip file, because running unzip from the command line didn't actually extract anything.

kettle-7 commented 3 years ago

I double-clicked the zip archive in Filer and it said 'The path is not valid,' so it's either something about .zip files in general or that particular one.

kettle-7 commented 3 years ago
archivemount -f -o readonly,nonempty,allow_root Utilities-master(1).zip /var/run/user/1001/Utilities-master(1).zip
2
launch Filer /var/run/user/1001/Utilities-master(1).zip
# Descending into "/Applications/Office"
# Descending into "/Applications/Utilities"
# Descending into "/Applications/Video"
# Descending into "/Applications/3D Printing"
# Descending into "/Applications/Developer Preview"
# Descending into "/Applications/Graphics"
# Descending into "/Applications/Preferences"
# Descending into "/Applications/Developer"
# Descending into "/Applications/Audio"
# Descending into "/Applications/Autostart"
################### Checking "/System/Filer.AppDir/AppRun"
# Found "/System/Filer.AppDir/AppRun"
Took 8 milliseconds to find candidates via the filesystem
Candidates: (QFileInfo(/System/Filer.AppDir/AppRun))
Selected candidate: "/System/Filer.AppDir/AppRun"
QProcess: Destroyed while process ("archivemount") is still running.
probonopd commented 3 years ago

The user with the ID 1001 should have write access to /var/run/user/1001/ (at least this was what I was assuming); are you saying this is not the case @linuxkettle?

kettle-7 commented 3 years ago

No, my UID is 1000, so no 1000 directory was created.

Also, I can't mount any ZIP archives even after fixing that problem. Tarballs work fine, but when I run mountarchive on a ZIP folder, it opens Filer but doesn't mount the archive, so I'm left with a Filer window showing a folder in it, but seconds afterwards it says that the folder doesn't exist.

Does this mean the archive is getting unmounted?

probonopd commented 3 years ago

No, my UID is 1000, so no 1000 directory was created.

Interesting! On which system (exact version) does this happen?

Does this mean the archive is getting unmounted?

I don*t know, but mount should tell you.

kettle-7 commented 3 years ago

It's because I created a new user, the live one was 1001.

I installed it differently because I needed to keep some of the files on my HDD, and the installer stalls when I try to install to a USB (because of issue #200). Although the Users app should create a runtime directory for the new user.

probonopd commented 3 years ago

Good point. What piece of software is normally resposible for creating those directories?

kettle-7 commented 3 years ago

I don't know, in Linux systemd does it, but on FreeBSD it seems to be a do-it-yourself-or-else thing. The odd thing is, tar archives sometimes work, and every archive format except zip mounts on /var/run/user/1001 anyway.

Usually though, tar archives just say "Device not configured." and any attempt to do anything in them results in that error message being shown again.

probonopd commented 3 years ago

in Linux systemd does it

Interesting. So is this whole /var/run/user/$UID thing a Fedora-ish thing rather than a Unix-ish thing? Then we may want to use something else if there is a more Unix-native way to have a per-user temporary location.

Possibly this is related toXDG_RUNTIME_DIR? https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html says

There is a single base directory relative to which user-specific runtime files and other file objects should be placed. This directory is defined by the environment variable $XDG_RUNTIME_DIR.

But it does not seem to say what is supposed to create this directory. Maybe on FreeBSD just nothing creates this user-specific directory?

Maybe it would be more robust (and simpler) to just use /tmp/$USER/ instead?

Related: https://github.com/FreeSlave/standardpaths/issues/7