Skip to content. | Skip to navigation

FreeSMUG

Sections
Personal tools
You are here: Home OS X Portable Apps Technical note (outdate)
Navigation
Log in


Forgot your password?
New user?
active users
Registered: 646
Online: 0

IRC Chat


irc.freenode.net : #freesmug
 
Document Actions

Technical note (outdate)

by Gand last modified 2006-11-12 11:29 PM

How does Portable Apps work

Script functions description


These are the script functions that run when Portable app is open (not all present on each Portable app) :

bsd_command_check        # Check if all bsd commands are present on system
   
command_check_msg        # Alert message

osx_version_check            # Check OS X system requirements
    version_check_msg            # Alert message

quitapp                               # Quit if local app is running

checkapppath                    # Check local application path (Apple only)
    select_app                            # Dialog to select application path

repair                                   # Repair .pabu file still existing
    restore                                    # Restore .pabu
    restorepabu                           # Restore .pabu dialog
    copy                                         # Copy .pabu
    copypabu                                # Copy .pabu dialog

check_p_asf                          # Check portable folder existing

copy_local_pref                    # Allow copy local preferences to portable one
    runcopypref                         # Progress bar while copy preferences
    check_asf                               # Check portable preferences folder
    copy_pf                                  # Copy preferences dialog with size check

open_p_app                # Run portable app
    set_p_app
        copy_scr                     # Copy System Crash Restore app
        add_launchagents     # Add LaunchAgents plist file
        bu_plist                      # Backup of existing preference
        bu_asf                        # Backup existing Application Support folder
        bu_cache                    # Backup exixting Cache folder
        recover_p_plist          # Recover portable preference
        recover_p_asf            # Recover portable Application Support folder
    run_app                 # Run application with external drive prefs
    close_p_app
        bu_p_plist                  # Backup portable preference
        bu_p_asf                    # Backup portable Application Support folder
        remove_p_cache        # Remove portable cache
        recover_plist              # Restore existing preference
        recover_asf                # Restore portable Application Support folder
        recover_cache           # Restore existing cache
        del_launchagents      # Delete LaunchAgents .plist file
        del_scr                       # Delete System Crash Restore app

exit 0



Sorry, notes below are outdate, althougt the concept is still valid, now quite all portable apps are opened by a shell script wrapped as applicaton using Platypus.

Please post questions, tips, suggestions, clues, helps, bugs to our OS X Portable Applications support forum


All <app_name> provided are unmodified binaries downloaded from developer sites.

Folder content

Portable <app_name> the Portable root folder

OPEN <app_name>.app
ithe AppleScript that open original <app_name>.

app folder that contain the original <app_name> and the profile folder.


Folder tree

Don't modify this tree or <app_name> will not start.

Portable Apps (root folder)
  • OPEN <app_mane>.app (AppleScript)
  • app (foleder)
    • <App_name>.app (real application)
    • profile (folder)


Click image to enlarge

Dinamic path


As the Portable <app_name> folder can be everywhere the first part of the script fetch it:
tell application "Finder" to set perc to the container of (path to me) as alias
set perc to quoted form of POSIX path of perc
This means that you can change the name of your portable drive or the Portable <app_name> root folder position and OPEN <apps> will launch it.

Profile folder


Standard profile folder is ~/Library/Application Support/<app_name>
Portable <app_name> use the given profile folder (Portable <app_name>/app/profile/).
Each Portable <app_name> use various way to get this:

Firefox, Thunderbird, Nvu, Sunbird


All Mozilla related applications are launched with "-proflie" flag that set the profile folder path:
do shell script "" & perc & "app/Firefox.app/Contents/MacOS/firefox -profile " & perc & "app/profile"
See How Do I run Firefox off a USB drive?

Adium



Adium need a key <Preference Folder Location> in the Info.plist file with value <profile_path>. This is get with "defaults write" command:
do shell script "defaults write " & perc & "app/Adium.app/Contents/info \"Preference Folder Location\" " & perc & "app/profile"

As "default write" output is a binary file, this is convered to xml using "plutil" command:
plutil -convert xml1 "$here/app/Adium.app/Contents/Info.plist"

Adium binary are launched with the modifed Info.plist file:
do shell script "open " & perc & "app/Adium.app"

See Portable Adium wiki page.

AbiWord


AbiWord should work as Mozilla applications using a -u flag to set profile folder but this is not yet implemented on OS X porting: Bug 9944 - OS X command line -u option fail

Profile folder path is set modifing HOME environment with "export HOME" command:
do shell script "export HOME=" & perc & "app; open " & perc & "app/abiWord.app"



Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: