diff --git a/Darwin/KVASD-installer/KVASD-installer/WSJTAppDelegate.applescript b/Darwin/KVASD-installer/KVASD-installer/WSJTAppDelegate.applescript index 8a024a4d7..009e00b26 100644 --- a/Darwin/KVASD-installer/KVASD-installer/WSJTAppDelegate.applescript +++ b/Darwin/KVASD-installer/KVASD-installer/WSJTAppDelegate.applescript @@ -50,7 +50,7 @@ end script -- kvasd looks after fetching kvasd files from the web source script kvasd property serverPath : "https://svn.code.sf.net/p/wsjt/wsjt/trunk/kvasd-binary/" - property destination : "/tmp/" + property destination : system attribute "TMPDIR" property targetName : "kvasd" on fetchEULA() @@ -82,6 +82,13 @@ script kvasd tell application "Finder" to ¬ print (destination & targetName & "_eula.txt") as POSIX file end printLicense + + on cleanUp() + tell application "Finder" + delete (destination & targetName & "_eula.txt") as POSIX file + delete (destination & targetName) as POSIX file + end tell + end cleanUp end script script WSJTAppDelegate @@ -126,11 +133,11 @@ script WSJTAppDelegate if button returned of result = "Ok" then try set target to installRoot & "/Contents/MacOS/" & kvasd's targetName - log do shell script "mv " & kvasd's destination & kvasd's targetName & space & target + do shell script "cp " & kvasd's destination & kvasd's targetName & space & target repeat with theLine in paragraphs of (do shell script "otool -L " & target) if theLine contains ".dylib" and not theLine contains "libSystem" then set theDylib to 2nd item of split(theLine,{tab,space}) - log do shell script "install_name_tool -change " & theDylib & " @executable_path/" & last item of split(theDylib,{"/"}) & space & target + do shell script "install_name_tool -change " & theDylib & " @executable_path/" & last item of split(theDylib,{"/"}) & space & target end if end repeat log do shell script "chmod +x " & target @@ -186,10 +193,10 @@ script WSJTAppDelegate return true end applicationShouldTerminateAfterLastWindowClosed_ - on applicationShouldTerminate_(sender) + on applicationWillTerminate_(sender) defaultNotificationCentre's removeObserver_(me) - return current application's NSTerminateNow - end applicationShouldTerminate_ + kvasd's cleanUp() + end applicationWillTerminate_ -- -- NSDraggingDestination (NSWindow Delgate) Protocol (Not working on 10.7) diff --git a/contrib/Darwin/KVASD-installer.app/Contents/MacOS/KVASD-installer b/contrib/Darwin/KVASD-installer.app/Contents/MacOS/KVASD-installer index 248a9b3f7..a41411acb 100755 Binary files a/contrib/Darwin/KVASD-installer.app/Contents/MacOS/KVASD-installer and b/contrib/Darwin/KVASD-installer.app/Contents/MacOS/KVASD-installer differ diff --git a/contrib/Darwin/KVASD-installer.app/Contents/Resources/WSJTAppDelegate.scpt b/contrib/Darwin/KVASD-installer.app/Contents/Resources/WSJTAppDelegate.scpt index a74a4495b..174c3d260 100644 Binary files a/contrib/Darwin/KVASD-installer.app/Contents/Resources/WSJTAppDelegate.scpt and b/contrib/Darwin/KVASD-installer.app/Contents/Resources/WSJTAppDelegate.scpt differ