Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Implement Brackets Portable Build on Mac and Windows #333

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

bchintx
Copy link
Contributor

@bchintx bchintx commented Sep 20, 2013

Allows Brackets to be run (eg. from removable media, such as a thumb drive) on any Mac or Windows computer without having to first be installed on that computer. Implements "Portable build" user story.

To set up a portable build onto a removable media storage device, follow these steps:

  1. first install Brackets onto a Mac or Windows machine
  2. copy the installed binaries to a new folder on your removable media. For Mac, copy "/Applications/Brackets Sprint XX.app". For Windows, copy the folder "\Program Files (x86)\Brackets Sprint XX".
  3. in the removable media folder, next to either the .app or .exe file, create a new, empty file, named 'makePortable'

That's it! You can now run Brackets from that removable media on any other Mac or Windows machine.

Note: you can copy both a Mac and Windows portable build onto the same removable media. However, please be sure to create two different folders into which you copy each platform's build.

When launched, Brackets will check for the existence of the 'makePortable' file, alongside either the .app or .exe. If it exists, then the following will occur during program execution:

  1. preferences will be read from and saved in the 'Brackets' folder on the removable media;
  2. extensions will be installed in and run from the 'Brackets\extensions' folder on the removable media; and
  3. (on Windows) window state and size will be saved in 'Brackets\lastWindowState.dat' on the removable media.

@ghost ghost assigned JeffryBooher Sep 23, 2013
@bchintx
Copy link
Contributor Author

bchintx commented Sep 23, 2013

@JeffryBooher Thanks for your help in getting the Linux-side of this feature implemented. Basically, all that's needed is to implement the code similarly implemented in appshell/client_app_mac.mm in this branch.

Specifically, we need a Linux implementation of ClientApp::IsPortableInstall(), which effectively just checks for the existence of a 'makePortable' trigger file, and updating ClientApp::AppGetSupportDirectory() to point to the application executable folder, rather than a machine-based settings folder, for a portable install.

@ingorichter
Copy link
Contributor

@bchintx @JeffryBooher Any progress on this PR?

@JeffryBooher
Copy link
Contributor

@ingorichter sorry. I haven't had time to look at it. @bchintx the Linux implementation of AppGetSupportDirectory is that thing that neither of us could remember last week :) It should be implemented now on Linux so you should give it a whirl. Let me know if you need help with the Linux implementation -- I'll review it once that is finished.

@le717
Copy link
Contributor

le717 commented Dec 25, 2013

@bchintx @JeffryBooher This a great PR and feature addition to Brackets. What is the current status of this, other than Linux support and file associations? I am a web design student and use Brackets for my work, and as I'm taking web animation using HTML, CSS, and JS starting in January, I'd love to have a portable installation of Brackets on my flash drive for use at school (since I won't have my laptop with me). 😃

@ninjamonkno1
Copy link

I could really do with this also, @bchintx any news on the linux version as that seems to be blocking this from being merged?

@ConnorKrammer
Copy link

@bchintx @JeffryBooher I'd just like to say that this would be a really nice feature. What's left to do on this?

@JeffryBooher
Copy link
Contributor

@bchintx what's the plan for this? It seems that it can not be merged and I haven't heard any details about what we want to do with this.

@bchintx
Copy link
Contributor Author

bchintx commented Jul 7, 2014

@JeffryBooher I've updated my branch with the latest changes from master, so it's mergeable again. This change is ready for review and testing on Mac and Windows. If we're ok with splitting off the Linux implementation separately, then this pull request could be merged sooner rather than later.

Besides this code change, we'd probably also want to update the build machines to produce a portable .zip archive on Mac and Win and then update brackets.io to allow users to download the resulting archive.

@le717
Copy link
Contributor

le717 commented Jul 8, 2014

@bchintx You have no idea how glad I am to hear this news. :D

}

// Initialization helper --
// Loads the Restores data and positions the window in its previously saved state
void cef_main_window::RestoreWindowPlacement(int showCmd)
void cef_main_window::RestoreWindowPlacement(const int showCmd)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason to make this param const? ints are passed by value so even if the function modified it -- it would have no impact on the rest of the app.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Practically speaking, yeah, it really doesn't make much difference -- mostly just one of those "Poh-TAY-toe", "Poh-TAH-toe" things. From the perspective of an API consumer, the const modifier helps define the contract of how the parm is used. I'll remove it if it helps though -- ie. didn't really need to change it.

@JeffryBooher
Copy link
Contributor

@bchintx done with first pass. let me know what your thoughts are on the comments and I'll start testing.

@bchintx
Copy link
Contributor Author

bchintx commented Jul 17, 2014

@JeffryBooher thanks for the review. I'll make the requested changes when I return to my office next week and push a new commit for review.

@bchintx
Copy link
Contributor Author

bchintx commented Aug 13, 2014

@JeffryBooher Done w/ code review changes. Should be working on both Mac and Windows again. The "trigger" file is now called portable, which you'll need to create next to your .exe or .app.

std::wstring& filename
#else
std::string& filename
#endif //OS_WIN
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment here is probably a tad redundant, as each clause only contains a single statement and the condition for the clause is a mere four lines above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will remove.

@le717
Copy link
Contributor

le717 commented Oct 14, 2014

I am really looking forward to this landing soon after 1.0 for multiple reasons, but also because this could help out with the auto-update user story. :D

@bchintx
Copy link
Contributor Author

bchintx commented Dec 19, 2014

Updated branch with requested changes and with latest master. Ready for review, testing, and merge. @JeffryBooher

@bchintx
Copy link
Contributor Author

bchintx commented Dec 19, 2014

FYI- I think we could go ahead and merge this now. That would allow users to create their own portable build installations. Ideally, we'd distribute the portable build as an archive available off of http://brackets.io. However, at this point, we probably shouldn't hold up this PR for any upcoming build machine or website changes.

@James-Parsons
Copy link

Is anyone working on this??

@le717
Copy link
Contributor

le717 commented Feb 3, 2015

FYI- I think we could go ahead and merge this now. That would allow users to create their own portable build installations. Ideally, we'd distribute the portable build as an archive available off of http://brackets.io. However, at this point, we probably shouldn't hold up this PR for any upcoming build machine or website changes.

I agree. The schematics can be worked out after it is merged, it's not like the code here depends on how it is packaged and released.

@bchintx Quick thought, is there a reason Linux is not supported in this PR, or is the Linux version already "portable" in the sense it requires no installation?

@bchintx
Copy link
Contributor Author

bchintx commented Feb 3, 2015

@le717 Good point. These changes would need to be made in the Linux shell as well. However, I don't have a Linux dev environment in which I could easily port these changes. Without these changes, then, yes, the Linux build is just "portable" as the app is already today. However, these changes allow the preference settings to be transportable with the install onto different machines.

@avindra
Copy link

avindra commented Mar 2, 2015

+1. FYI, per the trello card,

this workaround does the trick until an official solution is implemented (replace with your own values):

msiexec /a Brackets.Release.1.2.msi /qb TARGETDIR=C:\App\Brackets

@digideth
Copy link

I guess we are still waiting on a official solution?

Is @avindra solution the best way?

@le717
Copy link
Contributor

le717 commented Sep 29, 2015

Soooo... what is happening here? Obviously Linux support has never been added, but then again Linux is historically behind Windows and Mac (see: CEF 2127). I do not think Linux-only code is imperative to finally land this code, and as @bchintx said, the exact release schematics are not required before this is eventually landed. An official portable Brackets build would still be a very nice thing to have.

@rockyallen
Copy link

Will this change allow installation without admin rights?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants