Page 1 of 1

[HowTo] Make Firefox Or Other Mozilla Based App Portable

Posted: Sun 02 May 2010, 22:00
by abushcrafter
I use this script for making Firefox portable but it should work with any Mozilla base based app.

Update8: Firefox 4 Portable

Update7:Instead of these steps you can use the attached script. Which is based on this one: https://www.privacyfoundation.de/wiki/P ... able-EN.sh
  1. Extract the current version of the Firefox .tar.bz2 where you want it. You can get it from: http://www.mozilla.com/en-US/firefox/all.html (Note: The Linux version is a binary).
  2. You will now have a folder called Firefox which has all the Firefox bits. You might (which I do.) want to rename it to "firefoxportable" (Without the quotes.)

    In that folder:
  3. Create a new folder called "profile" (Without the quotes.)
  4. Create a new file called "firefoxportable" (Without the quotes.).
  5. Give the file "firefoxportable" excutable permissions.
  6. Put this code in that file:

    Code: Select all

    #!/bin/sh
    #Version 0.0.8
    #Put together by Alexander S.T. Ross (abushcrafter)
    #Based on the luncher from: https://www.privacyfoundation.de/wiki/PortableLinuxApps
    #Also based on the luncher from: http://portools.com/apps/iceweasel-portable
    
    #Works with any mozzila base based app like Firefox,ThunderBird,SongBird,SunBird,Fennec (Firefox Mobile),Seamonkey,etc.
    
    #The reason for the bit of code, for disabling error output of the $app. Is because if you are for instants using Firefox, some addons like ReadItLater reviles (In a URL) your password and user-name of your ReadItLater account. This info then ends up in the system log: "/tmp/xerrs.log".
    
    #ChangeLog ----------------------------------------------------------------------
    #   2010/10/31  Alexander .S.T. Ross (abushcrafter) Email: <http://www.google.com/recaptcha/mailhide/d?k=01uNeUuXxeNm9FA3Zciuoqzw==&c=nVfKeb7kjqZVVIQanqJwEC2DP5zrALkSERTopYvj_pU=>
    #      * 0.0.7: Now finds out what the current version of the Mozilla app is. Thanks to my dad.
    #      * 0.0.7: Now gives you a splash screen telling you that Mozilla app is now closed.
    #      * 0.0.7: Added some Debug/Info echos.
    #      * 0.0.7: Removed Dingo's <http://dokupuppylinux.co.cc/> Puppy Linux font fix as it's fixed in newer versions of Puppy Linux (.E.G. Lupu 5.*.* (Might have not been fixed in first few version?)).
    #      * 0.0.7: Removed nooby mistakes of mine. .E.G. variables being exported, "exec" being used to run the Mozilla app.
    
    #   2010/11/01  Alexander .S.T. Ross (abushcrafter) Email: <http://www.google.com/recaptcha/mailhide/d?k=01uNeUuXxeNm9FA3Zciuoqzw==&c=nVfKeb7kjqZVVIQanqJwEC2DP5zrALkSERTopYvj_pU=>
    #      * 0.0.8: Fixed all bugs. Now works.
    #      * 0.0.8: Added more echos.
    
    app="firefox"
    
    echo "${app}portable:Debug/Info: 0="$0""
    dir=${0%/*}
    echo "${app}portable:Debug/Info: dir="$dir""
    if [ "$dir" = "$0" ]; then
      dir="."
    fi
    HOME=${dir}/profile
    cd "$dir"
    echo "${app}portable:Debug/Info: Current Dir="`pwd`
    
    version=`./$app --version |tr , \ | cut --fields=3 --delimiter=\ `
    echo "Welcome to the Linux version of $app $version in portable mode. Feedback is NOT disabled."
    
    #START: Part of Dingo's <http://dokupuppylinux.co.cc/> additions to this script.
    if test -d profile ; then
    printf "${app}portable:Debug/Info: Profile Directory already exists!\n"
    else
    mkdir -p profile
    fi
    #END: Part of Dingo's <http://dokupuppylinux.co.cc/> additions to this script.
    
    #Remove the "#" from the next line to disable error output.
    ./$app -no-remote -profile "./profile" $@ #2>/dev/null
    
    echo "${app}portable:Debug/Info: $app is now closed."
    yaf-splash -text "$app Is Now Closed" -bg green -fg black -timeout 3 -display :0 -margin 2 -bw 0 -font "9x15B" -outline 0
    echo "${app}portable:Debug/Info: ${app}portable is now closed."
    
    
  7. Run "firefoxportable".
  8. Done.
If you want your profile from a existing install of Firefox. Then (Firefox must be not running!) copy your profile folders contents into the profile folder of your portable Firefox.

Profile Info:
http://support.mozilla.com/search.php?w ... &sa=Search

Update2:
To enable Java do the flowing:
For the current stable version of java. See my SFS here:
http://www.murga-linux.com/puppy/viewtopic.php?t=55015
  1. Make syslinks to:
    (Note: Change "/usr/lib/java/jre1.6.0_20/" to the path of your java folder)

    Code: Select all

    /usr/lib/java/jre1.6.0_20/lib/i386/libnpjp2.so
    and

    Code: Select all

    /usr/lib/java/jre1.6.0_20/plugin/i386/ns7/libjavaplugin_oji.so
    into the "plugins" of your Firefox Application Folder.
  2. Restart Firefox Portable if it is already running.
  3. Check that Java works here: http://www.java.com/en/download/help/testvm.xml If it is not loading read this: http://www.murga-linux.com/puppy/viewtopic.php?t=54856
Update3:
Things you can do to improve Firefox's performance: Improving Firefox Portable's Performance.

That's it!

Posted: Thu 06 May 2010, 19:57
by Dingo
modifying executable name, also Thunderbird can become portable with this script

I have only a problem with firefox portable: menu fonts are too small, tried already tricks with userChrome.css, without success

Posted: Thu 06 May 2010, 23:28
by abushcrafter
Dingo wrote:modifying executable name, also Thunderbird can become portable with this script
Thanks for the conformation.
Dingo wrote:I have only a problem with firefox portable: menu fonts are too small, tried already tricks with userChrome.css, without success
This is a problem with puppy. This gets fixed for me by all the packages I install :P! I believe this info from Jemimah is that you what:
In "/etc/fonts/local.conf" add:

Code: Select all

        <alias>
                <family>sans-serif</family>
                <prefer>
                        <family>DejaVu Sans</family>
                </prefer>
        </alias> 

Posted: Fri 07 May 2010, 12:17
by Dingo
yes, it works

meanwhile I discovered that creating a chrome subdir in profile dir, and putting into an userChrome.css file, it solves the small fonts menu, but your trick is also needed for better rendition in form fields and elsewhere in page modules

So I downloaded latest Firefox en_US

uncompressed archive

putted into three files I attach (in one archive)

- portable firefox script
- userChrome.css
- a modified version of local.conf (for font tweaking, I first backup existing)


libdbus-1-3_1.2.1-5
libdbus-glib-1-2_0.76-1


are also required , you can download from here

http://bit.ly/aakcnp

or from debian repositories (lenny)

I modified your script as follows, adding some lines (being not a good scripter any suggestion is welcomed)

EDIT:

improved version of Script, now only portablefirefox script (attached) is needed

Code: Select all

#!/bin/sh
#Version 0.0.5
#Put together by Alexander S.T. Ross (abushcrafter)
#Based on the luncher from: https://www.privacyfoundation.de/wiki/PortableLinuxApps
#Also based on the luncher from: http://portools.com/apps/iceweasel-portable
#

######### Dingo's addition to script - http://dokupuppylinux.co.cc/
if test -d profile ; then
printf "directory already exists\n"
else
mkdir -p profile/chrome
cat << EOF > profile/chrome/userChrome.css
/*
 * Do not remove the @namespace line -- it's required for correct functioning
 */
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */


/*
 * Some possible accessibility enhancements:
 */
/*
 * Make all the default font sizes 20 pt:
 *
 * * {
 *   font-size: 20pt !important
 * }
 */

 * {
   font-size: 9pt !important;
   font-family: DejaVu Sans !important;
 }
/*   font-family: nimbus !important;*/

/*
 * Make menu items in particular 15 pt instead of the default size:
 *
 * menupopup > * {
 *   font-size: 15pt !important
 * }
 */

/*BK experimenting...
menupopup > * {
  font-size: 12pt !important
}
menu > * {
  font-size: 12pt !important
}
*/

/*
 * Give the Location (URL) Bar a fixed-width font
 *
 * #urlbar {
 *    font-family: monospace !important;
 * }
 */

/*
 * Eliminate the throbber and its annoying movement:
 *
 * #throbber-box {
 *   display: none !important;
 * }
 */

/*
 * For more examples see http://www.mozilla.org/unix/customizing.html
 */
EOF
fi
if test -f /etc/fonts/local.conf.zip ; then
printf "backup  file already exists\n"
else
zip /etc/fonts/local.conf.zip /etc/fonts/local.conf
cat << EOF > /etc/fonts/local.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file for local customizations -->
<fontconfig>
<!--
  Enable sub-pixel rendering
	<match target="font">
		<test qual="all" name="rgba">
			<const>unknown</const>
		</test>
		<edit name="rgba" mode="assign"><const>rgb</const></edit>
	</match>
-->
        <alias>
                <family>sans-serif</family>
                <prefer>
                        <family>DejaVu Sans</family>
                </prefer>
        </alias>
</fontconfig>
EOF
fi
######## end of additions

export app="firefox"
export version="3.6.*"

echo "Welcome to the Linux version of $app $version in portable mode. Feedback is NOT disabled."
dir=${0%/*}
if [ "$dir" = "$0" ]; then
  dir="."
fi
HOME=${dir}/profile
cd "$dir"
#Remove the "#" from the next line to disable error output.
exec ./$app -no-remote -profile "./profile" $@ #2>/dev/null

Posted: Fri 07 May 2010, 12:32
by abushcrafter
@Dingo Thanks for adding that feature. Hope you when not asking for suggestions from me! I don't know much at all. I still need to read some bash manuals! I have been living of dad telling me how to do little things like setting a viable! BTW could you increase the version number in you post's code to 0.0.4 please.

Posted: Fri 07 May 2010, 20:51
by Dingo
I Improved script in order to redirect directly text output from script instead of copying from files see here

another question:

it seems to me firefox I have downloaded from mozilla, has some problems in showing transparent png

are you able to view png image here?
http://www.clker.com/clipart-2760.html

it should look like this:

Image

I suspect this can be related with libpng version in Puppy, I have yyet tried with a firefox version compiled in Puppy

Posted: Fri 07 May 2010, 21:10
by abushcrafter
Dingo wrote:another question:

it seems to me firefox I have downloaded from mozilla, has some problems in showing transparent png

are you able to view png image here?
http://www.clker.com/clipart-2760.html

it should look like this:

Image

I suspect this can be related with libpng version in Puppy, I have yet tried with a firefox version compiled in Puppy
I have no problems on my heavy customised system.

Posted: Mon 10 May 2010, 12:46
by abushcrafter
Updated first post on how to get Java working.

Posted: Tue 11 May 2010, 20:38
by dejan555
Hey guys I was just investigating fonts problem in firefox today (not portable one, will get to that :D so yeah firefox is there in dpup by default and has nice fonts but when I renamed .mozilla dir they've apeared bad by default so I looked into original dir that was there, I found out these lines in prefs.js in profile dir:

Code: Select all

user_pref("browser.display.use_document_fonts", 0);
user_pref("font.default.x-western", "sans-serif");
user_pref("font.minimum-size.x-western", 12);
user_pref("font.name.sans-serif.x-western", "DejaVu Sans");
It can be probably tweaked manually thru about:config when filtering search with "fonts" but if it's new profile which doesn't have prefs.js created yet you can just make new file with those lines only inside and fonts should be ok.

Posted: Sun 01 Aug 2010, 22:38
by abushcrafter
Update 3: Improving Firefox's performance.

Update! See First Post!

Posted: Mon 01 Nov 2010, 17:10
by abushcrafter
New version of script!
Version=0.0.8

Update! See First Post!

Posted: Mon 01 Nov 2010, 17:17
by abushcrafter
Fixed two little mistakes.

Posted: Mon 01 Nov 2010, 17:29
by magerlab
hey!!!
i can say again that this forum is GREAT!!!! :lol:
I was looking for a solution to run both FF3.6 and beta 4
and it seems, i can do it with this script

Update! See First Post!

Posted: Mon 01 Nov 2010, 17:56
by abushcrafter
magerlab wrote:hey!!!
i can say again that this forum is GREAT!!!! :lol:
I was looking for a solution to run both FF3.6 and beta 4
and it seems, i can do it with this script
Oh yes :D and Thanks.

Fixed some spelling and other errors in the change-log.

Update! See First Post!

Posted: Mon 01 Nov 2010, 18:23
by abushcrafter
Update7: New script to do it all for you.

Posted: Wed 09 Feb 2011, 00:37
by AF Branden
Wow the latest version of FF has so many dependencies its ridiculous. Is there a way to make FF run them from within its portable directory so I can actually make it portable?

In its current state it is not portable because of these dependencies.

Posted: Wed 16 Feb 2011, 16:56
by abushcrafter
AF Branden wrote:Wow the latest version of FF has so many dependencies its ridiculous. Is there a way to make FF run them from within its portable directory so I can actually make it portable?

In its current state it is not portable because of these dependencies.
Narr. You just need to:
  • Search in PPM in your puppies repo for "dbus". This I think must be installed.
  • Some gconf libs. I got mine from some package. Again this I think must be installed.
Or you could disable the need for those libs by doing your own portable compile. Which I do not know how to do. I guess there is a article on how to do it, in the Mozilla documentation. There is some info on Barry's blog on compiling Firefox with things like dbus disabled. That might be useful to you.

Posted: Wed 16 Feb 2011, 17:47
by Jasper
Hi,

Linux portable versions of Firefox and SeaMonkey are available from http://portablelinuxapps.org/ They are recent, but not the latest, though they can probably be successfully updated.

If Wine is in use then the latest versions of most, or all, Windows portable versions of Mozilla programs are available from http://portableapps.com/ and they can be updated from within each program (or by using the PortableApps menu and updater).

My regards

PS I tried the Linux version of SeaMonkey (out of curiosity as I don't use it), but I did not have the permissions to update to a later version and upon reflection updating a Linux portable now seems improbable.