Part of the Samples Website. 8/16/97.

samples.basicStuff.installFrontier

«Creates an alias of the Frontier application in a special folder
«call with specialFolderName = "Apple Menu Items" to install in the Apple menu
«call with specialFolderName = "Startup Items" to install in Startup Items folder
«also offers to delete any aliases with UserLand or Frontier in their name
on installFrontier (specialFolderName)
local (folder = file.getSpecialFolderPath ("", specialFolderName, false))
local (sourcefile = Frontier.getProgramPath ())
local (destfile = folder + file.fileFromPath (sourcefile))
if not file.exists (folder)
scriptError ("Can't find " + folder)
local (f)
fileloop (f in folder) «offer user chance to delete old Frontier aliases
on matcher (pattern)
return (string.patternMatch (string.lower (pattern), string.lower (f)) != 0)
if f != destfile «any file at new location is unconditionally deleted
if file.isAlias (f)
if matcher (UserLand) or matcher (Frontier)
speaker.beep ()
case dialog.yesNoCancel ("Delete the "" + file.fileFromPath (f) + "" alias?")
1 «Yes
file.delete (f)
3 «Cancel
return
if file.exists (destfile)
file.delete (destfile)
file.newAlias (sourcefile, destfile)
dialog.notify ("The Frontier application is now installed in the "" + specialFolderName + "" folder.")
installFrontier ("Startup Items")


This page was last built on Sat, Aug 16, 1997 at 6:37:19 PM. You can download the current set of sample scripts from our FTP site. Dave