(imported comment written by nmelanson91)
Here is the action that is failing with the dmg, there are two .apps in the dmg I am trying to copy to applications. Turn Proxy Off.app and Turn Proxy On.app.
download http://servername:52311/Uploads/8ce2c75aef7d3c223d50567ac03dd36bcb1f138d/ProxySettingsdmg.tmp
continue if {(size of it = 1388167 AND sha1 of it = “8ce2c75aef7d3c223d50567ac03dd36bcb1f138d”) of file “ProxySettingsdmg.tmp” of folder “__Download”}
extract ProxySettingsdmg.tmp
wait sh -c “rm ‘/tmp/ProxySettings.dmg’”
move “{posix path of file “ProxySettings.dmg” of folder “__Download” of client folder of current site}” “/tmp/ProxySettings.dmg”
wait hdiutil attach -quiet -private -mountpoint “/tmp/BESMNTPT16874473828046693” “/tmp/ProxySettings.dmg”
if {not active of action OR (exists file whose (name of it ends with “.mpkg” OR name of it ends with “.pkg”) of it) of folder ("/tmp/" & “BESMNTPT16874473828046693”)}
wait installer -pkg “{(if (exists file whose (name of it ends with “.mpkg”) of it) then (pathname of file whose (name of it ends with “.mpkg”) of it) else (pathname of file whose (name of it ends with “.pkg”) of it)) of folder (”/tmp/" & “BESMNTPT16874473828046693”) }" -target /
elseif {exists folder whose (name of it ends with “.app” AND exists folder “Contents” whose (exist file “PkgInfo” whose (exists line whose (it = “APPLVISX”) of it) of it) of it) of folder ("/tmp/" & “BESMNTPT16874473828046693”)}
appendfile tell application “{name of folder whose (name of it ends with “.app”) of folder (”/tmp/" & “BESMNTPT16874473828046693”)}"
appendfile DoInstall
appendfile quit
appendfile end tell
wait /bin/sh -c "iconv -f UTF-8 -t macintosh {concatenation "\ " of substrings separated by " " of pathname of client folder of current site}/__appendfile > {concatenation “\ " of substrings separated by " " of pathname of client folder of current site}/doinstall.txt”
run “{posix path of framework folder & “/Carbon.framework/Versions/Current/Support/LaunchCFMApp”}” “{(pathname of parent folder of it & “/” & name of it & “/Contents/MacOSClassic/” & preceding text of first “.app” of name of it) of folder whose (name of it ends with “.app”) of folder (”/tmp/" & “BESMNTPT16874473828046693”)}"
wait /bin/sh -c "osascript {concatenation “\ " of substrings separated by " " of pathname of client folder of current site}/doinstall.txt”
elseif {exists folder whose (name of it ends with “.app”) of folder ("/tmp/" & “BESMNTPT16874473828046693”)}
wait sh -c “rm '/Applications/{name whose (it ends with “.app”) of folders of folder (”/tmp/" & “BESMNTPT16874473828046693”)}’"
wait cp -Rfp “{pathname of folder whose (name of it ends with “.app”) of folder (”/tmp/" & “BESMNTPT16874473828046693”)}" “/Applications”
else
wait cp -Rpn /tmp/BESMNTPT16874473828046693/* /Applications
endif
wait /bin/sh -c "hdiutil detach -force mount | grep /tmp/BESMNTPT16874473828046693 | cut -f 1 -d \ | cut -f 3 -d / | head -1
"
wait sh -c “rm ‘/tmp/ProxySettings.dmg’”