[CLOSED THREAD] Portable Firefox

Discussion of third-party/unofficial Firefox/Thunderbird/SeaMonkey builds.
Locked
chris_s
Posts: 28
Joined: February 5th, 2004, 6:04 am

Re: pluginreg.dat

Post by chris_s »

CritterNYC wrote:
chris_s wrote:in order to get it not to use the hard drive at all this works for the firefox.bat file in the root of the usb drive it will create an "application data" folder there.
...
set USERPROFILE=%cd%


Unfortunately, messing with environment variable affects other apps than Mozilla. I'd argue that leaving a plugins file on the host PC is better than possibly messing up other running programs and processes.


after setting those environment variables in the .bat file while mozilla was running I did start a new command prompt and entered
echo %USERPROFILE%
and I did get the normal location not the one that was specified in the .bat file. I figured that this test was enough to see that in windows that setting variables in .bat files are only inhereted by child processes. In the *NIX world the an export statement in a shell script will only change that variable for child processes but making assumptions about windows based on how *NIX works is dangerous but I figured that this test would be enough.

Do you know exactly how this affects other apps so that I can do some tests?

I was also curious about what you said about starting ff with a .js file. Isn't mozilla the interpreter of the js files and therefore at least part of it needs to run first ?

chris
chris_s
Posts: 28
Joined: February 5th, 2004, 6:04 am

Re: pluginreg.dat

Post by chris_s »

This article seems to confirm my assumption about environment variable only being inherited by the children of the process that sets them.

http://www.winnetmag.com/Windows/Article/ArticleID/37950/37950.html wrote:set mynewvariable = newvalue

creates an environment variable named mynewvariable and assigns it the value newvalue. When you use the Set command to create variables, those variables are available only in the current command window. To create global environment variables, open the Control Panel System applet, click Advanced, open the Environment Variables dialog box, then use the dialog box to create the new environment variables.


http://www.winnetmag.com/Windows/Articl ... 37950.html

If anyone knows of anything that contradicts this please post.

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

Re: pluginreg.dat

Post by FlashBanG »

chris_s wrote:I was also curious about what you said about starting ff with a .js file. Isn't mozilla the interpreter of the js files and therefore at least part of it needs to run first ?

chris


IIRC, windows has some built in support for interpreting javascript files.. I dont think mozilla registers itself as the default handler of js files.. In the example i provided of the user in the thunderbird forum using a .js file, he created a windows shell object, and did stuff with it.. i dont believe mozilla is involved in this, as that is not part of the javascript DOM.. seems like windows would be interpreting it.. or atleast IE..

Correct me if i am wrong, this is just a suspicion
----------------------------------------------------------

FlashBanG

----------------------------------------------------------
big_gie
Posts: 153
Joined: August 29th, 2003, 7:00 am
Location: Montréal, Québec, Canada

Re: More on relative paths...

Post by big_gie »

CritterNYC wrote:Ok, it seems that you can get both themes and extensions running with relative paths by editting the appropriate files. As Cusser mentioned, you need to alter any mention of an absolute path like this:

c:baseURL="jar:file:///X:/firefox/profile/extensions/GUID/chrome/package.jar!/content/package/"

And change it to a relative path like this:

c:baseURL="jar:resource:/profile/extensions/GUID/chrome/package.jar!/content/package/"

After you install an extension, exit firefox, open your profile\extensions\extensions.rdf file and make the changes above. After you install a theme, exit firefox and open your profile\chrome\chrome.rdf file and make the changes above. This will render the newly installed theme or extension portable.

Previous relative paths mention:
http://forums.mozillazine.org/viewtopic ... =30#570853


I'm having trouble running this... I'm trying to use TB/FB from usb. TB is ok since I doesnt use theme/extensions. But Firefox doesnt work well.. I edited the chrome.rdf as you said, run FF, and the first time is ok. Then... the second time it doesnt work. FF opens, no bookmarks and the menus doesnt respond.
I don't have any absolute path in the profile dir or the program dir... I've monitored firefox.exe with File Monitor and Registry Monitor and can't find anything...

What could go wrong???
Thank you
big_gie
Posts: 153
Joined: August 29th, 2003, 7:00 am
Location: Montréal, Québec, Canada

Post by big_gie »

Hum, I've made a bit of investigating, and the problem seems to be from if I change "something"...

What I have to do is keep the absolute path from the chrome.rdf, set the browser the way I like, and then change the chrome.rdf with relative path. If I change something, firefox will react strangly: the menu is freeze, no bookmarks, but ff isnt freeze by itself. What I mean with "something" is large: I could change any file in the program's folder. I've testes with the program\greprefs\all.js: I changed the 99th line from "pref("keyword.URL", "http://www.google.com/search?ie=UTF-8&oe=utf-8&q=");" to pref("keyword.URL", "http://www.google.com/search?ie=UTF-8&oe=utf-8&num=100&q=");" and ff freezes like I mantioned. To make it work again, I need to changed back the chrome.rdf file to absolute path, and whenr ff run, it will be ok. After one run, I can set relative path back... weird isnt it?

The same "bug" occurs when I rename the program\profile to program\profile.bak (from the http://johnhaller.com/jh/mozilla/portable_firefox/ package). I need to get back absolute path in chrome.rdf, run ff, close it, change chrome.rdf to relative, to make FF works!

Why the content of chrome.rdf should affect other settings? MAybe when a setting is change, FF look everywhere in all path from all its config files, and when it come to relative, it freezes... This is really weird.

I still love FF, and slowly migrating from opera :) The usb thing is really nice though! Using it with Thunderbird too and it works flawlessly with TB (because of no extensions/theme). Having my TB+FF from my keychain is really nice! From the work to multiple computers at home, to university, having one place only with emails is great!
big_gie
Posts: 153
Joined: August 29th, 2003, 7:00 am
Location: Montréal, Québec, Canada

Post by big_gie »

I found something else.

I've uncompressed Firefox on each computer I'm using my USB keychain so FF won't have to run from it. So I have 3 places where FF is located: in <USB>\Firefox\09\Program (this is normal v0.9), in <USB>\Firefox\09\Program2 (wich is John Haller's Portable Firefox) and in C:\Program Files\Mozilla\Firefox\09 wich is the normal v0.9 build.

If I run FF from a computer for the first time, I need to have absolute path in the chrome.rdf file. So I run FF one time with absolute path in chrome.rdf, close FF, change to relative path, and FF will now work.

I tought that my profile should be "set" for relative. So I ran the C:\Program Files\ FF version to speed a bit things, and FF doesnt work! I need again to change to absolute path, run FF (which then works), close FF, change back to relative path, then reopen FF.

I need to make those step for each "installation set" of FF. That makes me think that the problem seams to be in FF installation directory and not in the profile directory. I'll do more test...


Another thing, could it be possible for you, John Haller, to create a Portable Thunderbird version? Or even better, post how to compress things? I'd like to have it compress to, but would like to have a localized build of TB and FF (not avaible yet...) So a guide on how to do it would be great!! Thank you very much.
FlashBanG
Posts: 184
Joined: January 14th, 2003, 7:39 pm

Post by FlashBanG »

John said he'd work on the portable thunderbird when he had time, and also investigate how to use .js files.

Everyone's anxiously waiting to see what he comes up with :)
----------------------------------------------------------

FlashBanG

----------------------------------------------------------
big_gie
Posts: 153
Joined: August 29th, 2003, 7:00 am
Location: Montréal, Québec, Canada

Post by big_gie »

I use pretty often .js files if someone need help...
FlashBanG
Posts: 184
Joined: January 14th, 2003, 7:39 pm

Post by FlashBanG »

Can you whip one up for firefox?
----------------------------------------------------------

FlashBanG

----------------------------------------------------------
big_gie
Posts: 153
Joined: August 29th, 2003, 7:00 am
Location: Montréal, Québec, Canada

Post by big_gie »

I'm using this one actually. It is working on 2 of my computers and its pretty simple.

Code: Select all

/*
launch_firefox.js
Launch Firefox from a USB drive
Firefox is located in: <USB Drive Letter>:\Firefox\09\Program\firefox.exe
Profile is located  in: <USB Drive Letter>:\Firefox\09\Profile
*/

Shell = WScript.CreateObject("WScript.Shell");

    // Return the USB drive letter followed by ":\"
    // It is "F:\" and "I:\" on two of my systems
USB = Shell.CurrentDirectory;

Version = "09";
PathToFirefox = USB + "Firefox\\" + Version + "\\Program\\";
Firefox = PathToFirefox + "firefox.exe";
Profile = USB + "Firefox\\" + Version + "\\Profile";

Shell.Run("\"" + Firefox + "\" -Profile \"" + Profile + "\"", 1, true);


If you have any questions/suggestion don't hesitate.
FlashBanG
Posts: 184
Joined: January 14th, 2003, 7:39 pm

Post by FlashBanG »

Can we make it so that we dont have the version inbetween? if we want to have the directory structure of:

USB\Porgrams\Firefox\

should we just modify the "Path to firefox" and "Profile" , and delete the version?

That should work?
----------------------------------------------------------

FlashBanG

----------------------------------------------------------
big_gie
Posts: 153
Joined: August 29th, 2003, 7:00 am
Location: Montréal, Québec, Canada

Post by big_gie »

Of course :)
I've made this just to keep traces of my directories, and which profiles is for which version.

If you don't want the version thing, just remove the "Version" variable and its calling, like this:

Code: Select all

/*
launch_firefox.js
Launch Firefox from a USB drive, without the version number
Firefox is located in: <USB Drive Letter>:\Firefox\Program\firefox.exe
Profile is located  in: <USB Drive Letter>:\Firefox\Profile
*/

Shell = WScript.CreateObject("WScript.Shell");

    // Return the USB drive letter followed by ":\"
    // It is "F:\" and "I:\" on two of my systems
USB = Shell.CurrentDirectory;

PathToFirefox = USB + "Firefox\\Program\\";
Firefox = PathToFirefox + "firefox.exe";
Profile = USB + "Firefox\\Profile";

Shell.Run("\"" + Firefox + "\" -Profile \"" + Profile + "\"", 1, true);
User avatar
CritterNYC
Posts: 970
Joined: August 27th, 2003, 12:27 am
Location: New York, NY
Contact:

Post by CritterNYC »

Portable Firefox 0.9.1 is now available:
http://johnhaller.com/jh/mozilla/portable_firefox/

I've been too busy to do any of the modifications we've discussed, but I wanted to be sure I got this out today.

Regards,
John
Take your browser, email, office suite, instant messenger, image editor and more with you...
Get portable versions of Firefox, Thunderbird, OpenOffice.org, Pidgin, GIMP and more at PortableApps.com
User avatar
CritterNYC
Posts: 970
Joined: August 27th, 2003, 12:27 am
Location: New York, NY
Contact:

Post by CritterNYC »

Javascript issue...

I think I'm going to hold off on using the .js file to launch firefox. I'm not sure how reliable it will be. On my system, a fresh install of WinXP Pro with all my development tools loaded, the default behavior with .js files is to open them in Dreamweaver. The only option in the menu to run it is to Open With Command Prompt, which gives us same window we get with a batch file. .bat files, on the other hand, are pretty much universal.

Regards,
John
Take your browser, email, office suite, instant messenger, image editor and more with you...
Get portable versions of Firefox, Thunderbird, OpenOffice.org, Pidgin, GIMP and more at PortableApps.com
FlashBanG
Posts: 184
Joined: January 14th, 2003, 7:39 pm

Post by FlashBanG »

Thanks for the updated version, John. Appreciate it :)

Just to let you guys know.. I've been having a few problems with running it off the USB drive on *some* computers.. Just because it works fine on a certain computer one day doesnt mean it will continue to do so.

Yesterday, i nearly stomped on my usb drive, because the darn thing just wouldnt open up a working copy of firefox.. I tried to redownload portable firefox from john's site (i'm guessing this was before he updated to .91 because i didnt see the winstripe updates), but no luck.

Today, i try it again on a different computer, and it works flawlessly.. Strange as heck.. I thought maybe it had something to do with my USB drive nearing the end of it's lifespan (1 month continuous browser usage), but then i read this:

(1) Is the USB drive rewriteable?

Yes! you can write and rewrite an unlimited amount of times. A floppy disk has an average life span of two to three years, but a USB drive's life span of over 25 years!


Even more surprising, i saw this from one of the MSDN blogs..

Puzzled:

Quick calculation: Assume 128 MB, the flash has ideal wear leveling, 100,000 cycles, 2 MB/sec write rate (greater than USB 1.1 transfer rate)

So, in order to hit the cycle limit, it'll take 128*100,000 MB, which is 6.4 million seconds, or 74 days of continuous writes. Additionally, good flash is good in excess of 1 million cycles, in which case you're talking two years.


From those calculations, my drive should last atleast 3 months, because i certainly dont write on it continuously (because history and cache is disabled). I use it perhaps 6 hours in a day..

Does anyone find anything wrong with those calculations?
----------------------------------------------------------

FlashBanG

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