Open
Bug 1281854
Opened 9 years ago
Updated 2 years ago
Symlinked app bundle for use as profile launcher causes special paths to use symlink file path rather then actual file pointed to path. This breaks update mechanism of Firefox
Categories
(Core :: Widget: Cocoa, defect)
Tracking
()
UNCONFIRMED
People
(Reporter: noitidart, Unassigned)
Details
(Whiteboard: tpi:-)
Attachments
(1 file)
513.18 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0
Build ID: 20160606200529
Steps to reproduce:
## Goal
Create a desktop icon, that can have its icon customized, that can be pinned to the dock, and on restart of computer if restore apps was checked it will launch the profile back.
I'm going to state the bug first as the reproduction steps are a bit long.
## Bug
Some paths, instead of reading `/Applications/Nightly.app/**` they read `/Users/noit/Desktop/Firefox Nightly - Main Profile.app/**`. Even though the contents with are symlinks to `Nightly.app`. Paths affected to my knowledge - `XREExeF, XREAppDist, DefRt, PrfDef, profDef, ProfDefNoLoc, ARes, AChrom, APlugns, SrchPlugns, XPIClnupD, CurProcD, XCurProcD, XpcomLib, GreD, GreBinD, UpdRootD, ProfLDS, ProfLD`.
##Why a bug?
Because it breaks the update process of Firefox, it causes it download all the files again into these symlinked directories.
## Solution
The paths above should read the path that the symlinks point to (for what I mean please read reproduction steps, especially step 2)
## Reproduction Steps
I accomplished it like this (I used OS.File):
0. Assume "Nightly.app" build located at `/Applications/Nightly.app`
1. Create a a folder on desktop, name it `Firefox Nightly - Main Profile.app` needs OS.File.setPermissions with unixMode:FileUtils.PERMS_DIRECTORY
2. Inside create a "Contents" folder
3. Inside this folder create a symlink to the orginal app for its MacOS, _CodeSignature, PkgInfo, and Resources folders.
4. In the original MacOS folder create a shell script file `blah` and set its contents to launch the app bundle on the desktop with a profile, (need to use FileUtils.PERMS_DIRECTORY here too interestingly):
```
'#!/bin/sh',
'exec "/Users/noit/Desktop/Firefox - Nightly - Main Profile.app" -profile "' + aFullPathToProfileDir + '" -no-remote "$@"'
```
5. Copy the original Plist.info but change it so:
* `CFBundleExecutable` points to a shell script in the the `blah` executable we created in step 5 (path has to be via the path on desktop, it will use symlink, this is important otherwise we get multipe icons in dock if "pinned/keep in dock" and restart browser
* `CFBundleIconFile` points to the icon you want used
* `CFBundleIdentifier` unique hash of the profile path directory (this assumes the directory is never renamed), so its constant for this profile
That's it, now double click the icon on desktop and it will launch your profile:
* icon will be custom icon
* label will be name of profile
* can mark as "keep in dock"
* restart the computer and check "restore apps on startup" and it will launch this profile in paralell with any other Firefox profiles that were running
The icon, label, and build can be changed. Edit the plist.info or the blah exec file. Attached is a screenshot of it succesfully working.
Component: Untriaged → Widget: Cocoa
OS: Unspecified → Mac OS X
Product: Firefox → Core
![]() |
||
Updated•9 years ago
|
Whiteboard: tpi:-
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•