-
Notifications
You must be signed in to change notification settings - Fork 35
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
App sharing does not work #492
Comments
Does this error also occur when you open the zipfile locally and launch the application? |
@StefanJordan mention in #493 that removing extended attributes can help ( That points to the macOS quarantine system interfering. I hope to have time over the summer to investigate this fully and work on a better solution. |
Is there a way to pack the dmg file in a way that the user is asked to go into the Mac setting in order to allow the app to be launched? I did not find this information anywhere and some free programs to pack the dmg did not work for me. |
Nope, compressing and decompressing immediately works. Downloading the zip from external source causes the issue of "Not being able to open" |
Either remove extended attributes from the app bundle (see my previous comment), or try opening using the context menu (right clicking) instead of double clicking. The latter tends to be more forgiving in what it accepts, especially when app bundles are not signed using a developer ID. |
Despite trying to solve the problems by opening the App with a right-click, I was unsuccessful. However, when I distributed the app as a dmg file and asked to relocated it to a different location, three individuals were able to open it after applying the command "sudo xattr -cr /path/App.app". All of these steps were performed on Ventura 13.4. |
xattr -cr gave me an error "option -r not recognized", so I used xattr -c. Still same error( |
Demsli, did you pack it into a dmg image first? It did not work without doing it because the file got corrupted whenever a zip was involved in the distribution! Maybe tar would work but I am not sure. And do not apply it to the dmg file, of course, but to the app. Maybe it does not always work with this method but I was successful with it. |
I applied it to the file and tried to zip it. Tried the sudo method as well - now after unpacking from download it says "file not found" though the app is there. Weird |
Will dmg make a difference? |
Yes, it made the difference between it works and it does not work. |
"Application diviner can't be opened" :( |
Did you extract the app from the dmg file AND applied "sudo xattr -cr /path/App.app"? |
My bad, thought that I had to apply first, dmg it and then send. Will try this order |
|
create app -> packing app into dmg -> deliver -> unpack app -> move to its destination -> apply "sudo xattr -cr /path/App.app" |
How can I check that xattr applied? |
The Also for anyone not familiar with the command-line, please use a tool like "standstrip" to remove unwanted extended attributes: https://eclecticlight.co/xattred-sandstrip-xattr-tools/. |
I have no idea. Try opening it with the right mouse click. I only can tell what worked for me with my app and three others who are using it. |
do you have the arm based MacBook or intel one? can the architecture be the case? |
Mac Book Pro with M1 in my case. And Ventura 13.4 in my case and in the case of the ones who use the app. I am not sure whether they have Intel or M1/M2. |
checked the file after extraction with xattred. It did have com.apple.quarantine tag with string 0187;6488c803;Telegram; attached. Tried to cut it - it created com.apple.provenance tag, but did not solve the problem, the app still does not open:( |
Tried sandstrip, got a new error - “diviner” can’t be opened because Apple cannot check it for malicious software. Unix file in contents/macOS folder showed a bit more info - diviner” cannot be opened because it is from an unidentified developer. |
Maybe you could follow https://iboysoft.com/news/app-is-damaged-and-cannot-be-opened.html#how-to-fix-fileapp-is-damaged-and-cannot-be-opened-on-macos-venturabig-sur Open the Apple menu > System Settings. Open the Apple menu > System Preferences. Maybe this help. I have no idea... |
Update - right clicking on the app to open after it was stripped allowed to click open. The app now works. Yahoo! |
I will try to use the zip method. I will also see if stripping the archive works |
Congratulations! I am relatively sure that zip does not work because I made several tests but maybe I am wrong. |
Stripping the archive itself and unzipping also works. Will try to upload the stripped archive again. To see if it will have the quarantine tag the second time |
Yes, sending the stripped archive adds the tag again. So, in order to share the program, the steps are:
|
Will probably have to bundle the .zip archive with the Sandstrip and the text readme file with necessary steps. Will also test the original program I needed to freeze. Thank you StefanJordan and ronaldoussoren for the help. Struggled with this thing for a while but glad that a solution was found) |
Yes, the problem is how to distribute it to people who are not very much into these technical steps. It would be good if one could bundle it in a way that the necessary steps are done automatically. Would a tool create a pkg file help in which a user could be just guided through the steps? I do not know such tools. I tried some packers but they did not work on Ventura. |
Sandstrip is really easy to use. you just select file and it automatically deletes all quarantine tags. But yeah, wish these steps were unnecessary. Yesterday I updated to Ventura and downloaded Xcode. I read that it is possible to sign the app with just Apple ID. But not sure if it will work, the quarantine tag had Telegram in it. I bet that if I sent it to google disk the quarantine will remain, it probably gets added to anything that is not supported by Apple. Maybe dropbox will work? But for now the combo of stripper + app + some opening steps works. |
Standstrip is just a workaround. I will be looking into a better solution for this, but that will take time. A future version of py2app will also have direct support for code signing. |
Greetings everyone. I am trying to freeze my program and share it with my colleagues. When I freeze the program on my MacBook Air M2 - the program works. But as soon as I compress it into the zip folder and share it (for example via telegram or google disk) I get a message "The application can't be opened". When going into the contents of the app, into macOS folder and launching the unix file I get an error that the file is damaged and should be deleted. I am doing this testing of download and unpackaging on the same Air, which is even more weird why this occurs, since it is the one that build the app. Can it be the problem of app signing?
Py2app version: 0.28.5
Python version: 3.11.3
macOS version: 12.5
setup code:
from setuptools import setup
APP = ['diviner.py']
DATA_FILES = []
OPTIONS = {'iconfile': '/Users/profix/PS-mac.icns'}
setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)
Program code:
import tkinter as tk
def divide_by_two():
try:
# Get the number from the entry widget
number = float(entry.get())
window = tk.Tk()
window.title("Number Divider")
window.geometry("200x200")
entry = tk.Entry(window)
entry.pack()
button = tk.Button(window, text="Divide by 2", command=divide_by_two)
button.pack()
result_label = tk.Label(window, text="Result: ")
result_label.pack()
window.mainloop()
The program is simple, I am just using it as a test to see how freezing on Mac works. The app freezes, but what's the point if I cannot share it with my friends?)
The text was updated successfully, but these errors were encountered: