You are here

Profile management (We can do this)

10 posts / 0 new
Last post
NathanJ79
NathanJ79's picture
Offline
Last seen: 4 years 9 months ago
Joined: 2007-07-31 15:07
Profile management (We can do this)

The profile manager you can use to manage multiple profiles in Firefox is somehow disabled in Portable Firefox, reportedly because it can't be made portable.

So how hard would it be to rig up something that does the same thing?

First of all, it's trivial (albeit annoying) to do in Windows Explorer. You simply run Firefox, then rename the Data folder to something else, e.g. Data_Nathan. Then you run Firefox again. Not seeing the Data folder, it makes a new one. Rename that to something else, e.g. Data_Jen (to use my wife's name). Then when you want to run Portable Firefox, you rename the folder you want to use to Data, then rename it back.

Ironically, stuff like this is exactly what the NSIS PortableApps.com Launchers do. They move files, folders, and registry entries around. It seems to me that an advanced Firefox launcher could be created that features a built-in profile manager that automates the above process, but with a GUI to let you name the profiles. Perhaps it could even look like the Firefox one, but let's not get ahead of ourselves. Furthermore, as an advantage, though PortableApps.com is particularly protective of Portable Firefox, it would be perfectly legal and possibly trivial to distribute the alternate launcher. This launcher shouldn't need to be updated with Firefox revisions (if the official launcher isn't) and all the end user would have to do is replace the official launcher with it.

I tried to make copies of FirefoxPortable.exe, FirefoxPortable.ini, and the Data folder (I just appended a '2' to each) and redirect the .ini to Data2\whatever for the custom paths... it did not work. FirefoxPortable2.exe just went to the Data folder, despite FirefoxPortable2.ini telling it to go to Data2. That would have been a great solution if the launcher could be directed to a custom folder. Then you just have a launcher for each user, which eliminates the need for a GUI chooser at the 'cost' of one more entry in your menu. (Maybe I did something wrong?)

I'll get the latest NSIS and poke around in the Firefox Portable launcher, see if this is something I can do on my own. (I'd love to learn how to do what y'all do, I just can never find the time.)

If you mean to reply to ask why -- I think the profile manager is the best thing about Firefox that isn't an extension. I'd love to have only one Firefox to update every couple weeks when new versions come out and to be able to make a second profile for myself, call it Lite and only have the bare necessities, e.g. to just look something up on IMDb or Wikipedia.

MaienM
Offline
Last seen: 2 years 8 months ago
Developer
Joined: 2007-12-18 04:35
Quite simple.

Quite simple. FirefoxPortable.exe always looks for FirefoxPortable.ini. Even if you rename it to Somethingelse.exe it will still look for FirefoxPortable.ini, not Somethingelse.ini. You would have to recompile the launcher to change that.

Behold, the DutchLander has arrived.
Grammatical errors are copyrighted.

NathanJ79
NathanJ79's picture
Offline
Last seen: 4 years 9 months ago
Joined: 2007-07-31 15:07
Thanks!

Thank you. If that's true, my trivial albeit annoying solution has just become a trivial solution that's not annoying at all. You're saying I can still have two Data folders, and I just change FirefoxPortable.ini?

Or I can open the source code for the launcher in NSIS and change a digit or two (what file the launcher looks for) and recompile? I could make four of these in no time at all to crudely allow someone to have up to four alternate profiles.

Crude, but effective; still, if I could build a simple profile manager that renames folders, that would be easier. I'll have to get into NSIS to see what my options are.

MaienM
Offline
Last seen: 2 years 8 months ago
Developer
Joined: 2007-12-18 04:35
Yes, in theory that should be

Yes, in theory that should be possible. Just recompile the Launcher into (for example) FirefoxPortableLite.exe and make it look for FirefoxPortableLite.ini, create a DataLite folder and setup the FirefoxPortableLite.ini to look in the DataLite folder.

If you wanted to go for something that gave the user the option to choose which profile to use at launch, I wouldn't go for renaming folders if I were you. Just have the profile-choose script generate the FirefoxPortable.ini file with the appropriate path. Renaming folders might work but it would require you to either store the original name of the Data folder somewhere, adding needless configuration files, or it would require you to make the profile-choose script wait till ffp exits to rename the folder back. Which would get messy in case of a crash. You know, the whole classic renaming folders vs. redirecting paths story.

One last note: If I were you, I would place all data folders INSIDE the actual data folder. So you would have Data/Lite and Data/Normal instead of DataLite and DataNormal. You know, to make sure that it gets preserved during updates, and that it gets backed-up correctly.

Behold, the DutchLander has arrived.
Grammatical errors are copyrighted.

TaffinFoxcroft
TaffinFoxcroft's picture
Offline
Last seen: 10 years 11 months ago
Developer
Joined: 2006-12-14 17:24
AHK

If you just want a simple GUI to list the profiles and launch Firefox Portable with one of them, you could probably do that in AHK pretty easily. All you would need to do is:

  1. List all of the folders in Data\ (minus settings and the current profile).
  2. Let the user choose a new profile (profile_Home, profile_Lite etc.).
  3. Write the string to FirefoxPortable.ini.
  4. Launch FirefoxPortable.exe

It wouldn't be too hard to write this thing, but I'm busy for the next couple of days so I probably won't get a chance to do it.
Edit: Read MaienM's post above and modified respectively.

But there’s no sense crying over every mistake,
You just keep on trying till you run out of cake.

John T. Haller
John T. Haller's picture
Offline
Last seen: 2 hours 23 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Multiple Profiles

Multiple profiles was a key feature a while back on Firefox and Thunderbird because most people only had one Windows login. These days, everyone has their own login, so profile management is pretty useless for most users. Thus, it's basically back-burnered and will probably have no further work done on it.

The profile manager only works with local profiles, that's established.

So for the few folks that WANT to be able to multiple profiles portably, I already have a fix, I just haven't had time to finish testing it and post it. It's basically a second app for secondary profiles for FF, TB and SB. You'll only have to worry about updating the main app for the most part. There won't be any GUI or creation of new profiles or anything like that (since 2 is plenty for nearly anyone... and if you want 3, just install the helper a 2nd time, costing you all of like 200k).

Sometimes, the impossible can become possible, if you're awesome!

NathanJ79
NathanJ79's picture
Offline
Last seen: 4 years 9 months ago
Joined: 2007-07-31 15:07
...

Well... I didn't get any time last week to do what I said, but someone linked NSIS Portable in another topic, so I thought why not... I basically opened FirefoxPortable.nsi and changed all instances of Data to Data2 (not APPDATA etc. just references to the Data folder). Then I made a new folder called Data2. The problem was, it opened my Data folder because I have a FirefoxPortable.ini telling it to disable the splash screen. So if I get rid of FirefoxPortable.ini my solution works perfectly. If I can figure out how to make it make its own .ini file, I'll be in the clear.

Oh, I see... !define stuff right at the top. It's using variables to come up with FirefoxPortable as the variable APPNAME I see all over the code. I'm using FirefoxPF2 as my APPNAME (PF2=Profile2). Trying to make it work with the new .ini (FirefoxPortablePF2.ini). OK, so I'll set NAME as FirefoxPortablePF2, since it seems to use NAME to make/seek the .ini... and that won't compile with an error on line 277, which seems to have to do with $PLUGINSDIR and also making the splash screen...?

I guess you did the same thing, only a lot more thoroughly (not to mention correctly)?

Anyway, I'd be interested in seeing what you're working with and testing it. Worst thing that can happen is I'm left where I'm at now. Because where I'm at now is, I can do it but disabling the splash screen (using a .ini) becomes impossible. Or I can make an AHK script (though I've never used AHK) to swap folders. Or just go on installing Portable Firefox twice, once for my wife and once for me.

Regarding user logons, we just use one for both of us. No sense in logging out, logging back in, or switching users when we can both work off of one desktop.

dboki89
Offline
Last seen: 9 years 10 months ago
Joined: 2009-11-30 20:44
1 way is - using a Batch file :)

Hi. Please don't get discouraged by the use of the simple old batch files. It's actually very easy, and since you said you would look at the NSIS launcher source code, this should be a lot easier and less space consuming (you create just 3 very small files, and 2 folders). Note that this doesn't give you a GUI... Sad

Anyway, I recommend using simple batch files (files with extension .bat).

First, create a text file and name it "User1.txt" or "Nathan.txt". It should be written like this:

del .\FirefoxPortable.ini
copy Data\Nathan\FirefoxPortable.ini FirefoxPortable.ini
start FirefoxPortable.exe
exit

Then copy the file and name the copy "Jen.txt". In that copy change the "Nathan" to "Jen". Save files. Now, you can rename the extensions (.txt) into .bat.

Second step is to go to the "Data" folder and move all three folders into a new folder named "Nathan" (also under "Data" folder). Then copy the folder and name it "Jen".

Third step is to edit the FirefoxPortable.ini file. Change the appropriate lines into:

ProfileDirectory=Data\Nathan\profile
SettingsDirectory=Data\Nathan\settings
PluginsDirectory=Data\Nathan\plugins
DisableSplashScreen=true

and copy the file into the "Data\Nathan" folder. Then, change all 3 "Nathan" with "Jen", save and copy to "Data/Jen" folder.

AND THAT'S IT! Smile Smile Enjoy Smile

Now, for step 4, you might want to make a nice shortcuts with icons. Make a shortcut for both "Nathan.bat" and "Jen.bat", then go to Properties > Change Icon > Ok > Browse and navigate to FirefoxPortable.exe. Do that for both of them, and place them where you would like them to be the most (Desktop maybe?) Smile

I really hope this simple way suits your needs, and you can make as many profiles this way as you want to. Cheers Smile

PS: Also note that this way is as "crash proof" as it can be, meaning in case a FirefoxPortable (or Windows) crashes, your data is as safe as it would be with out these settings. I mention this since your initial idea was not as crash proof...

EDIT: I forgot to mention that when using this method, you should be launching FirefoxPortable from these .bat files (meaning you don't double-click the "FirefoxPortable.exe", but the "Users name.bat" instead)... I thought it was obvious from the step 4 about shortcuts, but I wanted to point it out anyway. If you launch using "FirefoxPortable.exe" you will not mess anything up, but it will just open the last profile used. Hope all is clear now Smile

My posts are old and likely no longer relevant.

viscouse
Offline
Last seen: 5 years 9 months ago
Joined: 2010-02-01 09:08
Multiple installs w/Titlebartweaker

I worked on this for awhile, toyed with batch files, and decided it wasn't worth the effort.

For FF Portable, the directory with core files is actually pretty small. The profile directory with plugins, settings & whatnot is larger. So with 2+ installs (directories) you'll only save the amount of the core files per directory. You still need to do the work to update all the separate installs anyway.

So, instead, I use a plugin called titlebar tweaker, which changes the titlebar to something custom. Then I use an autoit script file to automatically decide which FFP to launch based on IP address.

John T. Haller
John T. Haller's picture
Offline
Last seen: 2 hours 23 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Here It Is

Secondary profile support has arrived:
https://portableapps.com/node/22519

Please address all testing and related comments in that thread.

Sometimes, the impossible can become possible, if you're awesome!

Log in or register to post comments