Firefox on a USB memory stick!

Discussion of general topics about Mozilla Firefox
Post Reply
jedbro
Posts: 1899
Joined: November 10th, 2002, 12:35 pm
Location: Mexico / Boulder Co.
Contact:

Firefox on a USB memory stick!

Post by jedbro »

I know there are about 20+ different discussions about this already here.
Unfortunatly none of them contain answeres, only links to more and more discussion.
In one of those avih posted the bug link <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=211628#c3">BUG #211628</a> where he has an answer.

I've done it, and now succesfully have Firebird 0.7 running completely off my 128 PNY USB memory stick :)
I've decided to re-post this here, so others who have been looking for this can easily find it.

1. create your sandbox directory (i.e. d:\sandbox\px-0.6). we'll consider it as
<sandbox>.
2. inside it, create a folder named "Application Data" the name must be exact.
3. in your sandbox directory, put the bin directory of the application
(mozilla/mozillafirebird).
4. put this batch file inside your sandbox dir as well (change myAppName to your
actual executable name, and myRoothPath to your root sandbox dir).
you get this:

<sandbox>\run.bat
<sandbox>\Application Data (should be created empty prior to running the batch file)
<sandbox>\bin (this is the actual directory of the application.

here's my (winXP) batch file. i'm not sure how it will work on other windows
versions.

rem directory 'Application Data' MUST be created prior to running this file.
rem not creating the 'Application Data' will result in c:\windows\phoenix and
c:\windows\mozilla created
rem the name 'Application Data' MUST NOT be changed. it's expected exactly with
this name.

set myAppName=phoenix.exe
set myRootPath=D:\tmp-extract\sandbox\px-04-mar

set USERPROFILE=%myRootPath%
set APPDATA=%USERPROFILE%\Application Data
start %USERPROFILE%\bin\%myAppName% %1 %2 %3


hope it helps.
cheers
avih



Here is my batch file:

Code: Select all

 
run.bat
=========
set myRootPath=E:\MozillaFirebird\Firebird0.7
set USERPROFILE=%myRootPath%
set APPDATA=%USERPROFILE%\Application Data
if exist "bin\mozilla.exe" start %USERPROFILE%\bin\mozilla.exe %1 %2 %3
if exist "bin\MozillaFirebird.exe" start %USERPROFILE%\bin\mozillafirebird.exe %1 %2 %3


Enjoy!

*NOTE* this only works if you are running FB under an OS with your same languages.
i.e. I tried it on my GF's laptop with WindowsXP in spanish, and it created a new profile due to the different location for
"Aplication Data" --> "Datos de Aplicaciones".
lladnar1
Posts: 35
Joined: October 23rd, 2003, 10:39 pm
Location: Bandung, Indonesia

Post by lladnar1 »

This works great as long as you are using the E: drive. Anyone figured out a way to easily auto-assign the drive letter?
chuonthis
Posts: 519
Joined: July 23rd, 2003, 10:17 am

Post by chuonthis »

I think you might be able to use "set myRootPath=%cd%" or even just use the %cd% variable instead of myRootPath. I tested it in WinXP and the variable returns the current working directory so just put your batch file in the X:\MozillaFirebird\Firebird0.7 or whatever directory and it should work?
chuonthis extensions: [fx] BookKey 0.0.1, OpenBook 2.0.1.1, Update Bookmark 0.0.5.1 [tb] Buttons! 0.5.3.2, DeleteJunk 0.3.2, Flipping the Thunderbird 0.0.0.1, Folderpane 0.0.5, NNWODC 0.2.3
Slimeboy
Posts: 32
Joined: October 1st, 2003, 6:28 pm

Post by Slimeboy »

My school blocks .exe files so i cant run firebird. But i will talk and see if i cant get a special provesion.

I seem to rember a post where a student wrote to the school saying why firebird was better. Anybody got a copy?
http://www.simonsrealm.net

Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040206 Firefox/0.8
gutzalpus
Posts: 15
Joined: January 24th, 2004, 8:10 am

Post by gutzalpus »

Using the above batch file causes all the file dialog boxes not to work (save link target as, save page as, etc).
Azhrabi
Posts: 1
Joined: January 30th, 2004, 8:57 am
Location: Syracuse NY

How to I keep it from lossing my plugins and extensions?

Post by Azhrabi »

I can run it off a CD no problem. But it keeps my bookmarks and losses everything else. Is there a way around this? So that I can run it 'fully featured' on any random english windows XP computer of my CD?
User avatar
alanjstr
Moderator
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here
Contact:

Post by alanjstr »

This sounds like a good FAQ item. Making sticky til djst sees it.
Former UMO Admin, Former MozillaZine General Mod
I am rarely on mozillaZine, so please do not send me a private message.
My Old Firefox config files
jedbro
Posts: 1899
Joined: November 10th, 2002, 12:35 pm
Location: Mexico / Boulder Co.
Contact:

Post by jedbro »

chuonthis wrote:I think you might be able to use "set myRootPath=%cd%" or even just use the %cd% variable instead of myRootPath. I tested it in WinXP and the variable returns the current working directory so just put your batch file in the X:\MozillaFirebird\Firebird0.7 or whatever directory and it should work?
\
Hmm I'll have to try that out.
So instead of the whole:
set myRootPath=E:\MozillaFirebird\Firebird0.7
whould I put
set myRootPath=%cd%\MozillaFirebird\Firebird0.7
??
Thanks for the aclaration.

*EDIT*
Nevermind, you are right!
My new batch file looks like this and works perfectly!
Thank you!

Code: Select all

run.bat
=========
set myRootPath=%cd%
set USERPROFILE=%myRootPath%
set APPDATA=%USERPROFILE%\Application Data
if exist "bin\mozilla.exe" start %USERPROFILE%\bin\mozilla.exe %1 %2 %3
if exist "bin\MozillaFirebird.exe" start %USERPROFILE%\bin\mozillafirebird.exe %1 %2 %3

It no longer depends on what Drive Letter your usb stick has been assigned to.! (thanks chuonthis)

And yes, the run.bat has to be in the directory where your *.exe file is found.
What I do as a work around is have a shortcut to run.bat on the X://run.bat of my memory stick for quicker access.

David, you might want to update the FAQ.
Last edited by jedbro on January 30th, 2004, 2:24 pm, edited 2 times in total.
User avatar
alanjstr
Moderator
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here
Contact:

Post by alanjstr »

Um, why are you hard coding the name "Application Data" there? Does it really need "Application Data" or can it use "myprofiledir"
Former UMO Admin, Former MozillaZine General Mod
I am rarely on mozillaZine, so please do not send me a private message.
My Old Firefox config files
User avatar
djst
Moderator
Posts: 2826
Joined: November 5th, 2002, 1:34 am
Location: Sweden
Contact:

Post by djst »

alanjstr wrote:This sounds like a good FAQ item. Making sticky til djst sees it.

Added. Will not show up on the site until the 0.8 launch though. Thanks for the tip!
jedbro
Posts: 1899
Joined: November 10th, 2002, 12:35 pm
Location: Mexico / Boulder Co.
Contact:

Post by jedbro »

alanjstr wrote:Um, why are you hard coding the name "Application Data" there? Does it really need "Application Data" or can it use "myprofiledir"

I think it really needs "Application Data", or whatever your OS's dir is.
I wouldn't know of a way to set "myprofiledir". (?)

djst wrote:
alanjstr wrote:This sounds like a good FAQ item. Making sticky til djst sees it.

Added. Will not show up on the site until the 0.8 launch though. Thanks for the tip!

You might want to update it with my latest run.bat example, thanks to chuonthis.

Also, just to note.
The original information is by avih, i've just modifed it a bit to work better for myself.
User avatar
opaiev
Posts: 142
Joined: August 18th, 2003, 6:04 pm

Post by opaiev »

that 0.8 shit out yet? damn holmes :)
"Go ahead - make my day."
User avatar
alanjstr
Moderator
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here
Contact:

Post by alanjstr »

jed-
Is it looking for the string literal "application data" or the environment variable? Or both?
Former UMO Admin, Former MozillaZine General Mod
I am rarely on mozillaZine, so please do not send me a private message.
My Old Firefox config files
Will Rickards WT
Posts: 288
Joined: October 9th, 2003, 1:21 pm

Post by Will Rickards WT »

It is looking for the string literal.

APPDATA and USERPROFILE are environment variables in windows 2K.
APPDATA just happens to usually be "%USERPROFILE%\Application Data"
By setting them in the batch script I believe you are changing them for firebird.
from the command line type
echo %APPDATA%
echo %USERPROFILE%
to see what they are normally set to.
you can also run
set | more
to see the list of variables
Unfortunately APPDATA seems to use a localized version of the string "Application Data" as the last folder in the path.

I think the batch file can be condensed to:

Code: Select all

run.bat
=========
set USERPROFILE=%cd%
set APPDATA=%cd%\Application Data
if exist "bin\mozilla.exe" start %USERPROFILE%\bin\mozilla.exe %1 %2 %3
if exist "bin\MozillaFirebird.exe" start %USERPROFILE%\bin\mozillafirebird.exe %1 %2 %3
User avatar
alanjstr
Moderator
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here
Contact:

Post by alanjstr »

Yes, I know what the variables are in W2k. But since you're setting the variables USERPROFILE and APPDATA in the script, that implies that it is looking at the environmental variables, and should not care that it says "Application Data"
Former UMO Admin, Former MozillaZine General Mod
I am rarely on mozillaZine, so please do not send me a private message.
My Old Firefox config files
Post Reply