How to stop users opening applet from within DMG

I distribute my applet in a read-only DMG file via GitHub. Some users developed the habit of running the applet from within the DMG which caused much trouble. So, I’ve looked for a way to prevent the applet running from within the DMG.

I’m using this code at the beginning of main.scpt:

set path_to_applet to path to me as text
set path_to_applet_posix to POSIX path of path_to_applet
if path_to_applet_posix contains "/Volumes/applet" then
	display dialog "Sorry, applet cannot be run from within a DMG file. Copy applet to \"Applications\" and try again" buttons "OK" with icon stop
	error number -128
end if

That code works on a DMG file before I upload it to GitHub. But, it does NOT work on the DMG file which has been downloaded from GitHub. The only difference I can think of is that macOS is seeing that the DMG file has been downloaded in Safari and while showing it on the Desktop, is actually quarantining it and so the path is not “/Volumes/apple/”.

Does any of this make sense ? If so, does anyone know the pa tho DMG files downloaded by Safari ?

Thanks.