You are here

Calculator (via Firefox)

2 posts / 0 new
Last post
Rexx72
Offline
Last seen: 14 years 5 months ago
Joined: 2008-07-31 19:58
Calculator (via Firefox)

I really love the open source Idea, but I'm a noob when it comes to scripting and programming. So I'm playing with batch files atm. As per my post here. Also I've been trying to find an open source calculator to replace the MS calc.exe (from XP) that I have been using. Plenty of "freeware" no open source though. SpeedCrunch is too big for my needs.

The only small OS calculator I found was a firefox extension. So I planned to come here and ask you clever bods if someone could make it into a calculator. While checking it out ... I found that it could be run from a cmd prompt so that only the calc showed up ... this led to experimentation and a whole Saturday shot to hell... lol

The following is the results of the experiment. Ta Da ... FoxCalc. It's a batch file converted to an exe (so it shows up in the PAM) that loads the firefox extension Calculator in it's own window looking very much like calc.exe but better.

The following are my notes on how I did it (So I can do it again .. hehe) Thought I'd share and help anyone else who's on a steep learning curve.

Any advice, critisism, etc will be appreciated.

*Admins please delete/move/etc the post as you will. This was my best guess as to which forum to post in.

1) Get the Calculator, install, test it works

### FirefoxCalulator ### from https://addons.mozilla.org/en-US/firefox/addon/1194
calculator-1.1.12-fx+sm.xpi

Install on host + then copy across ... a la https://portableapps.com/support/firefox_portable

Copying Your Local Firefox Settings
If you're using a local copy of Firefox, you may wish to just copy your local Firefox settings right into Firefox Portable. Your local Firefox profile is usually installed in C:\Documents and Settings\[user]\Application Data\Mozilla\Firefox\Profiles\default.???\ Just copy the contents of that folder (except the cache directories) to the FirefoxPortable\Data\profile directory. Then, and this is important, delete the file FirefoxPortableSettings.ini within the FirefoxPortable\Data\settings directory, if there is one. When you start Firefox Portable for the first time, it's recommended that you turn off disk cache, password saving and history if you're using a flash-based portable device. You can set all of these within the Privacy tab of the Firefox Options window. Sometimes, certain profiles will cause the launcher to fail or hang. It's best to give it a few minutes to see if it's just checking compatiblity and adjusting the locations of the extensions before giving up on it. If it fails, it is usually due to an incompatible extension.

In this instance you only need to copy the calculator extension. With a little scratching around in "C:\Documents and Settings\[user]\Application Data\Mozilla\Firefox\Profiles\****.default\extensions" you can find which of the sub-directories is the calc one. You just need to copy this one across to "FirefoxPortable\Data\profile\extensions" and deleted the FirefoxPortableSettings.ini file.

Run Firefox and then the calculator via menu:Tools\Calculator if it works then move on.


2) Make to batch files as per below. Then create the folder and copy the files into *:\PortableApps\FoxCalc
Why 2 batch files: Because the bat to exe converter I used was old and I don't think it understood the %~d0 variable which I was keen to try out. So the .exe simple calls the .bat which has the problem variable in.

#### FoxCalc.exe ### .bat to .exe -> Ghost option + Icon (credit below)
CALL FoxCalc.bat
EXIT

#### FoxCalc.bat ### reference http://code.google.com/p/firefoxcalculator/
"%~d0\PortableApps\FirefoxPortable\App\firefox\firefox.exe" -chrome "chrome://calculator/content/calculator.xul"
EXIT

The FoxCalc worked for me even when the local version of firefox was running! I thought it couldn't do that.

Discovered the above was using the local version of firefox (ie. I removed the extension on the PC and it failed). Left the above in as a reminder. Also the 2 batch files where clunky and unnecessary, and would fail on win98. As I discovered %~d0 wasn't around then. Ah well, it was fun to play with.

Using the command suggested http://code.google.com/p/firefoxcalculator/ and a bit of geusswork I eventually came up with ....

2) Make the following batch file. Use bat2exe to get the all important exe file (my settings = Ghost option + Icon (credit below))

REM #### FoxCalc.exe ### 
cd..
cd \PortableApps\FirefoxPortable\
FirefoxPortable.exe -chrome "chrome://calculator/content/calculator.xul"
EXIT

Then create the folder *:\PortableApps\FoxCalc and copy the file into it.

3) All set ... refresh your app list and run your new FoxCalc Smile

ToDo
Next step is to try to get the extension installed without loading it on the host machine first. Any thoughts? No I haven't looked anywhere yet... I off to bed now. 14 hrs in front of the PC is way to much for one session.
__________________________________________________________________________________

Get the bits to put it together or get my one here:

get this calculator.png and put it through http://converticon.com/ to get an .ico file
_________________________________________
Open Source Icon from:
Silk icon set 1.3 by Mark James
http://www.famfamfam.com/lab/icons/silk/
_________________________________________

bat2exe
Courtesy of BuddhaChu's post on this topic https://portableapps.com/node/9676

digitxp
digitxp's picture
Offline
Last seen: 11 years 4 months ago
Joined: 2007-11-03 18:33
woah,

that is quite a bit of research!
Anyway, I found an exact OSS clone: http://sourceforge.net/projects/reactos-calc/
and where did you get the AWESOME line??? Oh. They're just underscores :P.

Insert original signature here with Greasemonkey Script.

Log in or register to post comments