0

I have a Silverlight application ("file1.xap" - not ".app" it is ".xap"). How do I install and run it using AppleScript on MAC OS X?

tshepang
  • 12,111
  • 21
  • 91
  • 136
Codename K
  • 890
  • 4
  • 23
  • 52

2 Answers2

1

Besides the fact that your applet probably won't have permissions to install anything on Mac OS X 10.7 and later, you should be able to just copy the application package from any location to the applications folder:

tell application "Finder"
    copy file "Your Application Name.app" of disk "Your Application Name" to the application folder of the startup disk
    open file "TextEdit.app" of the application folder of the startup disk
end tell

If this doesn't work for you, then you need to explain more.

Mark
  • 2,380
  • 11
  • 29
  • 49
  • Thanks for your information. However, it is "file1.xap", not ".app" it is ".xap". This is not a normal applications file. The above works for ".app" files. – Codename K Jul 30 '13 at 23:40
  • That doesn't matter. Just change the file name Your Application Name.app into whatever you need. If my answer is useful to you, don't forget to accept it and vote for it. – Mark Jul 31 '13 at 08:13
  • I tried it and it did not work. It says class missing although Silverlight is installed. Thanks anyway. – Codename K Aug 05 '13 at 00:13
  • Did you make sure that the files that are copied have the right permissions? You might need to do a chmod and maybe even a chown. – Mark Aug 05 '13 at 00:17
  • The file is not an APP file it is XAP file. When I change the XAP extension to APP the MAC OS detect it as a corrupt APP file and do not run, and shows the message class missing when I try to run it. – Codename K Aug 05 '13 at 11:03
  • You still may need to set permissions and owner. That doesn't apply to executables only, especially if somehow the owner got mixed up. Is the XAP really a file, or it is a bundle? Does it work if you copy it manually? – Mark Aug 05 '13 at 12:01
  • XAP is a bundle file. – Codename K Aug 05 '13 at 17:17
  • I thought so. It means you really need to check permissions and answer my other questions to make sure we're on the same pace. – Mark Aug 05 '13 at 17:20
1

You need to make sure that .xap file is Out-Of-Browser enabled (I suspect it is). Then instead of running the .xap file directly, open the .xap in a browser and right click it to "Install" the .xap file. Silverlight will then download a .app file that you can run on OSX.

Paul de Lange
  • 10,613
  • 10
  • 41
  • 56