Skip to content

Commit

Permalink
Make app offer to move itself to Applications
Browse files Browse the repository at this point in the history
Embed the @potionfactory/LetsMove project to enable
the app to automatically offer to move itself to either
the system or user Applications folder if it is launched
from somewhere else.  This is to help mitigate translocation
issues in order to improve the odds of the autoupdate
capability working.
  • Loading branch information
tattwamasi committed Mar 3, 2017
1 parent 630d63d commit 8a21ca2
Show file tree
Hide file tree
Showing 37 changed files with 790 additions and 2 deletions.
12 changes: 10 additions & 2 deletions TeslaTunes.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
/* End PBXAggregateTarget section */

/* Begin PBXBuildFile section */
D47882741E692E4F00AB3980 /* LetsMove.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D47882731E692E4F00AB3980 /* LetsMove.framework */; };
D47882751E692E8F00AB3980 /* LetsMove.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D47882731E692E4F00AB3980 /* LetsMove.framework */; };
D47882761E692E8F00AB3980 /* LetsMove.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = D47882731E692E4F00AB3980 /* LetsMove.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
D4C763B51E627FD600433AD6 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D4C763B41E627FD600433AD6 /* Sparkle.framework */; };
D4C763B61E627FDE00433AD6 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = D4C763B41E627FD600433AD6 /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
D4DB8F9C1CCECB690069CD84 /* tag.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E52E87961ADD9AA900B08A74 /* tag.framework */; };
Expand Down Expand Up @@ -81,12 +84,14 @@
files = (
D4C763B61E627FDE00433AD6 /* Sparkle.framework in CopyFiles */,
E5F876801ADE49D800F9A362 /* tag.framework in CopyFiles */,
D47882761E692E8F00AB3980 /* LetsMove.framework in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
D47882731E692E4F00AB3980 /* LetsMove.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = LetsMove.framework; sourceTree = "<group>"; };
D4C763B41E627FD600433AD6 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Sparkle.framework; sourceTree = "<group>"; };
E502814C1ACBA133006D996C /* TableCellViewCheckmark.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableCellViewCheckmark.h; sourceTree = "<group>"; };
E502814D1ACBA133006D996C /* TableCellViewCheckmark.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TableCellViewCheckmark.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -128,6 +133,8 @@
D4C763B51E627FD600433AD6 /* Sparkle.framework in Frameworks */,
E52E879B1ADD9F8F00B08A74 /* AudioToolbox.framework in Frameworks */,
E52E87991ADD9F2E00B08A74 /* AVFoundation.framework in Frameworks */,
D47882741E692E4F00AB3980 /* LetsMove.framework in Frameworks */,
D47882751E692E8F00AB3980 /* LetsMove.framework in Frameworks */,
E58A24B91AC9282300E8DDE4 /* AppKit.framework in Frameworks */,
E5436D291AC3D44D0068E42E /* iTunesLibrary.framework in Frameworks */,
);
Expand Down Expand Up @@ -189,6 +196,7 @@
E55A71A41AE6415700AB75E2 /* Frameworks */ = {
isa = PBXGroup;
children = (
D47882731E692E4F00AB3980 /* LetsMove.framework */,
D4C763B41E627FD600433AD6 /* Sparkle.framework */,
E52E879A1ADD9F8F00B08A74 /* AudioToolbox.framework */,
E52E87981ADD9F2E00B08A74 /* AVFoundation.framework */,
Expand Down Expand Up @@ -491,7 +499,7 @@
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional";
INFOPLIST_PREFIX_HEADER = InfoPlist.h;
INFOPLIST_PREPROCESS = YES;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = "";
OTHER_LDFLAGS = (
"/usr/local/lib/libFLAC++.a",
Expand Down Expand Up @@ -526,7 +534,7 @@
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional";
INFOPLIST_PREFIX_HEADER = InfoPlist.h;
INFOPLIST_PREPROCESS = YES;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = "";
OTHER_LDFLAGS = (
"/usr/local/lib/libFLAC++.a",
Expand Down
5 changes: 5 additions & 0 deletions TeslaTunes/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

#import "AppDelegate.h"

#import <LetsMove/PFMoveApplication.h>



#import <IOKit/pwr_mgt/IOPMLib.h>

Expand All @@ -29,6 +32,8 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {



PFMoveToApplicationsFolderIfNecessary();

//[[NSUserDefaultsController sharedUserDefaultsController] setInitialValues:defaults];

}
Expand Down
1 change: 1 addition & 0 deletions frameworks/LetsMove.framework/Headers
1 change: 1 addition & 0 deletions frameworks/LetsMove.framework/LetsMove
1 change: 1 addition & 0 deletions frameworks/LetsMove.framework/Modules
1 change: 1 addition & 0 deletions frameworks/LetsMove.framework/Resources
10 changes: 10 additions & 0 deletions frameworks/LetsMove.framework/Versions/A/Headers/LetsMove.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//
// LetsMove.h
// LetsMove
//
// Created by Matt Prowse on 14/05/2016.
//
// The contents of this file are dedicated to the public domain.

#import <Cocoa/Cocoa.h>
#import <LetsMove/PFMoveApplication.h>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// PFMoveApplication.h, version 1.22
// LetsMove
//
// Created by Andy Kim at Potion Factory LLC on 9/17/09
//
// The contents of this file are dedicated to the public domain.

#ifdef __cplusplus
extern "C" {
#endif

void PFMoveToApplicationsFolderIfNecessary(void);

#ifdef __cplusplus
}
#endif
Binary file added frameworks/LetsMove.framework/Versions/A/LetsMove
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
framework module LetsMove {
umbrella header "LetsMove.h"

export *
module * { export * }
}
44 changes: 44 additions & 0 deletions frameworks/LetsMove.framework/Versions/A/Resources/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>16E175b</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>LetsMove</string>
<key>CFBundleIdentifier</key>
<string>com.potionfactory.LetsMove</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>LetsMove</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.22</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>1.22</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>8C1002</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>16C58</string>
<key>DTSDKName</key>
<string>macosx10.12</string>
<key>DTXcode</key>
<string>0821</string>
<key>DTXcodeBuild</key>
<string>8C1002</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2009–2016 Karelia Software LLC</string>
</dict>
</plist>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 8a21ca2

Please sign in to comment.