Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A sample that shows how to move a running Mac application to the /Applications directory

branch: master
Octocat-spinner-32 Danish.lproj Added Danish localization courtersy of Fredrik Nannestad February 15, 2010
Octocat-spinner-32 Dutch.lproj Forgot to replace old translation December 13, 2009
Octocat-spinner-32 English.lproj Compile without warning on Xcode 4 May 01, 2011
Octocat-spinner-32 French.lproj
Octocat-spinner-32 German.lproj Added German localization January 15, 2010
Octocat-spinner-32 Italian.lproj Italian localization July 13, 2010
Octocat-spinner-32 Japanese.lproj Update Czech and Japanese resources July 15, 2013
Octocat-spinner-32 LetsMove.xcodeproj Fixed deprecation warnings that show up when building against the OS … February 11, 2014
Octocat-spinner-32 Portuguese.lproj Project file clean up: removed unused files and adjusted file permiss… March 20, 2013
Octocat-spinner-32 Russian.lproj Russian localization added November 30, 2009
Octocat-spinner-32 Spanish.lproj Improved Spanish Localization April 04, 2012
Octocat-spinner-32 cs.lproj Convert UTF-8 to UTF-16 July 15, 2013
Octocat-spinner-32 ko.lproj Moved Norwegian to the right directory March 20, 2013
Octocat-spinner-32 nb.lproj Moved Norwegian to the right directory March 20, 2013
Octocat-spinner-32 pt-BR.lproj Project file clean up: removed unused files and adjusted file permiss… March 20, 2013
Octocat-spinner-32 zh-Hans.lproj Add Simplified Chinese Translation. And modified .gitignore to ignore… September 10, 2011
Octocat-spinner-32 .gitignore Project and code cleanup and version change after last commit. January 12, 2012
Octocat-spinner-32 LetsMove-Info.plist First commit September 17, 2009
Octocat-spinner-32 LetsMoveAppDelegate.h Changed formatting for function opening braces January 20, 2011
Octocat-spinner-32 LetsMoveAppDelegate.m Changed formatting for function opening braces January 20, 2011
Octocat-spinner-32 LetsMove_Prefix.pch First commit September 17, 2009
Octocat-spinner-32 PFMoveApplication.h Fixed deprecation warnings that show up when building against the OS … February 11, 2014
Octocat-spinner-32 PFMoveApplication.m Fixed deprecation warnings that show up when building against the OS … February 11, 2014
Octocat-spinner-32 README.md Fixed deprecation warnings that show up when building against the OS … February 11, 2014
Octocat-spinner-32 main.m Changed formatting for function opening braces January 20, 2011
README.md

LetsMove

A sample project that demonstrates how to move a running Mac OS X application to the Applications folder.

Usage

Copy the following files into your project:

  • PFMoveApplication.h
  • PFMoveApplication.m
  • NSString+SymlinksAndAliases.h
  • NSString+SymlinksAndAliases.m

In your app delegate's "-[applicationWillFinishLaunching:]" method, call the PFMoveToApplicationsFolderIfNecessary function at the very top.

If your project has ARC enabled, you'll want to disable ARC on the above files. You can do so by adding -fno-objc-arc compiler flag to your NSString+SymlinksAndAliases.m and PFMoveApplication.m source files. See http://stackoverflow.com/questions/6646052/how-can-i-disable-arc-for-a-single-file-in-a-project/6658549#6658549

License

Public domain

Version History

  • 1.10

    • Fixed deprecation warnings that show up when building against the OS X 10.9 SDK.
  • 1.9

    • Removed OS X 10.4 support
    • Properly detect if the running app is in a disk image
    • Fixed a bug where if the app's name contained a quote, the app could not be moved
    • After a successful move, delete the application instead of moving it to the Trash.
    • Other fixes and improvements
  • 1.8

    • If the app is already there in the Applications folder but not writable, request authentication from user
    • Added Korean localization
  • 1.7.2

    • Fixed an exception that could happen.
  • 1.7.1

    • Refactoring
  • 1.7

    • Only move to ~/Appilcations directory if an app is already in there.
  • 1.6.3

    • Function calls deprecated in 10.7 no longer cause compile time warnings.
    • Added Simplified Chinese and European Portuguese localizations
  • 1.6.2

    • Garbage collection compatibility added
    • Use a new method to check if an application is already running on Mac OS X 10.6 systems or higher
  • 1.6.1

    • Use exit(0) to terminate the app before relaunching instead of [NSApp terminate:]. We don't want applicationShouldTerminate or applicationWillTerminate NSApplication delegate methods to be called, possibly introducing side effects.
  • 1.6

    • Resolve any aliases when finding the Applications directory
  • 1.5.2

    • Cleaned up the code a bit. Almost functionally equivalent to 1.5.1.
  • 1.5.1

    • Fixed a bug with clearing the quarantine file attribute on Mac OS X 10.5
  • 1.5

    • Don't prompt to move the application if it has "Applications" in its path somewhere
  • 1.4

    • Mac OS X 10.5 compatibility fixes
  • 1.3

    • Fixed a rare bug in the shell script that checks to see if the app is already running
    • Clear quarantine flag after copying
    • Compile time option to show normal sized alert supress checkbox button
    • German, Danish, and Norwegian localizations added
  • 1.2

    • Copy application from disk image then unmount disk image
    • Spanish, French, Dutch, and Russian localizations
  • 1.1

    • Prefers ~/Applications over /Applications if it exists
    • Escape key pushes the "Do Not Move" button
  • 1.0

    • First release

Requirements

Builds and runs on Mac OS X 10.5 or higher.

Code Contributors:

  • Andy Kim
  • John Brayton
  • Chad Sellers
  • Kevin LaCoste
  • Rasmus Andersson
  • Timothy J. Wood
  • Matt Gallagher
  • Whitney Young
  • Nick Moore
  • Nicholas Riley

Translators:

  • Eita Hayashi (Japanese)
  • Gleb M. Borisov (Russian)
  • Wouter Broekhof (Dutch)
  • Rasmus Andersson / Spotify (French and Spanish)
  • Markus Kirschner (German)
  • Fredrik Nannestad (Danish)
  • Georg Alexander Bøe (Norwegian)
  • Marco Improda (Italian)
  • Venj Chu (Simplified Chinese)
  • Sérgio Miranda (European Portuguese)
  • Victor Figueiredo (Brazilian Portuguese)
  • AppLingua (Korean)
  • Czech X Team (Czech)
Something went wrong with that request. Please try again.