Running Firefox from USB drive (w/ new profiles)

Discussion of general topics about Mozilla Firefox
FlashBanG
Posts: 184
Joined: January 14th, 2003, 7:39 pm

Running Firefox from USB drive (w/ new profiles)

Post by FlashBanG »

I followed the instructions from this post:
http://forums.mozillazine.org/viewtopic ... 4&start=15

I put the command in a batch file, and ran it, but it seems that my profile is not saved in the usb drive this way. My profile is instead saved under Application Data of my computer.

How can I change this to make it save the profile data in the USB drive instead?

Anyone got this working?

Tia,
----------------------------------------------------------

FlashBanG

----------------------------------------------------------
User avatar
BenBasson
Moderator
Posts: 13671
Joined: February 13th, 2004, 5:49 am
Location: London, UK
Contact:

Post by BenBasson »

FlashBanG wrote:My profile is instead saved under Application Data of my computer.

You have to start up Firefox with the command line switch. If you don't, it'll create a profile in Application Data by default anyway, I think. I'll do a step by step:

1) Extract a zip copy of a recent Firefox Branch build (anything around the end of May or the start of June 2004), 0.9's release (when it's out) or later... if someone has the date this was checked in, please post it. I used this one.
2) In the same folder as Firefox.exe, make a subfolder called "profile" and leave it empty.
3) In the same folder as Firefox.exe, create a .bat file and put the following line inside it:
<code>start firefox.exe -Profile "profile/"</code>
4) Save the .bat file and run it. Your profile should automatically be created in the "profile" folder, open it up, you should see a "chrome" subdirectory, prefs.js and the usual files.
5) Now copy the whole Firefox folder to the USB drive. AFAIK, it should work, but I don't have one to test with.
Last edited by BenBasson on June 3rd, 2004, 9:40 am, edited 2 times in total.
FlashBanG
Posts: 184
Joined: January 14th, 2003, 7:39 pm

Post by FlashBanG »

Thanks for your reply, Cusser.

I followed your step by step instructions, but the profile is still being created in application data, rather than in the newly created "profile" subfolder.

Of course, the firefox folder is currently on my desktop, as you told me to upload it in the very last step to the usb drive.

But the profile does not seem to be created in the profile subdirectory no matter what I do. I tried different paths, such as "/profile", "\profile", "profile\" and even an absolute path (and of course the one that you listed in the step-by-step), but to no avail.

Can anyone else running a USB drive confirm this?

Any other suggestions, Cusser?


BTW, I'm using the latest nightly..

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a2) Gecko/20040602 Firefox/0.8.0+
----------------------------------------------------------

FlashBanG

----------------------------------------------------------
User avatar
BenBasson
Moderator
Posts: 13671
Joined: February 13th, 2004, 5:49 am
Location: London, UK
Contact:

Post by BenBasson »

That's a trunk nightly, isn't it? I used the 20040531 Branch, but you could use the 20040602 Branch, probably (if 2 days makes any difference).
FlashBanG
Posts: 184
Joined: January 14th, 2003, 7:39 pm

Post by FlashBanG »

Well, I finally got it working!!

The step by step is an excellent guide. I guess the problem was me not using a branch build..

Anyway, I ran into a slightly different problem.

My USB drive is only 16 mb (cheap one i got for free), but it appears FireFox is slightly bigger than that.. therefore, under the current conditions, I cannot fit firefox onto that small drive.

I tried to go through and delete some stuff I thought was unnecessary, but it did not help much, as I"m still over the size limit..

so my question is this..

Does anyone know of any extra files in the firefox directory that I could delete without much loss? I need to reduce firefox's disk size by around 1 mb

I really dont need the DOM Inspector extension, but have not found a way to delete it.. Any ideas for deleting some cruft?

TiA,


Edit: I would even use some unofficial builds if they are smaller..
----------------------------------------------------------

FlashBanG

----------------------------------------------------------
User avatar
BenBasson
Moderator
Posts: 13671
Joined: February 13th, 2004, 5:49 am
Location: London, UK
Contact:

Post by BenBasson »

You could also pack any .exe or .dll file with UPX.
With Firefox.exe only it saved me about 4mb.
With *.dll it saved a further 1mb or so.

If you know what you're doing, you can extract and repackage browser.jar, classic.jar, toolkit.jar and inspector.jar using Winzip with maximum compression. Doing so, and emptying the cache, got me down to about 9mb. You could do the same with any .jar file present, but those were the biggest four.

If you want to manually remove the DOM inspector, it's a pain, but it's possible. You need to delete inspector.jar, edit out all references to it in chrome.rdf, installed-chrome.txt and delete the "inspector" folder in the "overlay" subfolder of the chrome dir. You could probably do the same with help.jar too, but I didn't try it. After removing the DOM inspector, I was down to 8.5Mb... If you think it's worth it, go for it. Removing help will get you another 250kb or so back as well, compressing it will get you about 180kb.

When 0.9 comes out, I'll prepare a pre-made zip for running on USB Pen Drives and I'll write up a full tutorial on my website (something to supercede this). If anyone has any other suggestions on reducing filesize, please let me know.
User avatar
krazykit
Posts: 177
Joined: January 4th, 2004, 8:22 pm

Post by krazykit »

I've been having problems with this too, and just gave up. Cusser, that would be awesome :)
gdamjan
Posts: 4
Joined: January 28th, 2004, 10:07 pm

Linux

Post by gdamjan »

Pretty interesting,
is it possible to put both a Linux and Windows version on a USB and use the same profile with both?
User avatar
BenBasson
Moderator
Posts: 13671
Joined: February 13th, 2004, 5:49 am
Location: London, UK
Contact:

Re: Linux

Post by BenBasson »

gdamjan wrote:is it possible to put both a Linux and Windows version on a USB and use the same profile with both?

Theoretically, yes. I don't know how USB drives store data, but I'm pretty sure I've heard that you can do things to this end. In any case, to move the directory out of the "Firefox" folder, simply use "../Profile/".
FlashBanG
Posts: 184
Joined: January 14th, 2003, 7:39 pm

Post by FlashBanG »

thanks, for that, Cusser. It works great! I've got it down to around 11mb by compressing the exe file, and the dlls. I didnt mess with the jars and the dom inspector, etc..

I cant wait for your usb friendly firefox build of .9 . I'm sure many other people are looking for a good way to do this as well..

A few suggestions for the version.

-Remove the DOM inspector, as most people will not be doing such web development work on the go.

-Remove the help, as most people that want to install firefox on USB keydrive are past the scope of Firefox help.. It's meant mostly for users unfamiliar with firefox.

-If possible, have a default profile already working in firefox, with the /profile folder created, and populated. If this is not possible, just create the /profile folder, and have the batch file already in the folder.

-Create a shortcut with the command line arguments appended to the target..
ex. G:\firefox\firefox.exe -Profile "profile/"
People may feel more comfortable clicking a shortcut than a batch file, which unnecessarily launches and exits a command prompt window.

-Set the Cache Size in the options to <1mb (dont know if this is possible w/o creating a default profile) as cache seems to occupy a lot of space..


Anyway, I'm sure it will be an excellent build. If you would like to test out some beta builds, I can help.. just post on this thread :)
----------------------------------------------------------

FlashBanG

----------------------------------------------------------
User avatar
BenBasson
Moderator
Posts: 13671
Joined: February 13th, 2004, 5:49 am
Location: London, UK
Contact:

Post by BenBasson »

With a bit of messing around, I got the installation to under 8mb... and could probably go further. I'll certainly produce a "default" profile that can be used, and keeping the cache size down is a good idea that I hadn't done yet. I don't know if shortcuts can be relative, that's why I used the batch file (which I know can be).

I'll wait for 0.9, but I'm hoping that I can get an unofficial build made by one of the regular builders with as much stuff as possible cut out. Meanwhile, if anyone can give me more optimisation tips or fill me in on doing this in a cross-platform way, please do. The more the merrier.
User avatar
mai9
Posts: 1619
Joined: January 15th, 2003, 3:41 pm
Location: Barcelona
Contact:

Post by mai9 »

you could post your results zipped so everyone can take advantage of your work without re-doing it (if you want, of course!)

sharing your work will also lead to clear strategies on how to make that zip smaller
The Q
Posts: 359
Joined: November 14th, 2002, 7:53 am
Location: Sydney, Australia

Post by The Q »

Wow, I'm now looking forward to 0.9!!! Using Firefox and Thunderbird on a USB key entirely has been a dream of mine for quite a while - there's nothing like convincing a client to use Firefox when you can simply demo a running version from a USB key. People love that sort of "new fangled" technology and with USB2.0 now reasonably widespread, it'll be pretty quick too!

The only downside will be a lack of processor specific optimised builds available, since you'll have to potentially cover different processor architectures in your travels.

This will be a huge boon to those who travel often!
Get my current Proxomitron filters and Firefox CSS files here.
FlashBanG
Posts: 184
Joined: January 14th, 2003, 7:39 pm

Post by FlashBanG »

mai9: Cusser mentioned he would write up a tutorial, as well as include a premade zip that users can download for that purpose.

Cusser: The shortcuts wouldnt have to be relative, because once they find firefox.exe, they assume the directory "profile/" is relative to firefox.exe.. I was able to use such a shortcut with the profile argument, and it works fine, as long as it's on the USB drive.. I"m not sure if you mean outside the usb drive.

The reason i suggested a shortcut was so users wouldnt have to go into the firefox directory to launch, and they can keep the shortcut in the root of the Drive folder..


Edit: I think i understand what you mean.. You are right. The shortcut can't be relative. YOu need to define the drive letter for a shortcut.. so if the drive letter changes among computers, the shortcut would be useless :(
----------------------------------------------------------

FlashBanG

----------------------------------------------------------
FlashBanG
Posts: 184
Joined: January 14th, 2003, 7:39 pm

Post by FlashBanG »

After using firefox on the drive for a while (6 hours in a row), i also saw that history, form information, etc take up space if used for a long time, so the profile might also need to have short periods of store time (eg. delete history every 2 days, etc.)

Also, a couple of extensions might be useful if bundled with this, like:
-mouse gestures, (if you're on a laptop, and navigating with the mouse is back, gestures might be handy)

-xkiosk (to keep form data, history, cookies from piling up)

-External Application Buttons.. Since users wont be able to customize the desktop of their computer (if they're on a remote computer using a USB drive) they may have shortcuts to common windows apps (calc, solitare, etc..) --maybe this is too much :P

Anyway, at least the first 2 seem useful.. :)
----------------------------------------------------------

FlashBanG

----------------------------------------------------------
Locked