You are here

If FireFox is already installed, can that be launched instead?

4 posts / 0 new
Last post
loyalwhite
Offline
Last seen: 15 years 5 months ago
Joined: 2009-06-16 06:59
If FireFox is already installed, can that be launched instead?

Hi all,

I am distributing a web site on CD for some users who need to use it in environment where they do not have internet access.

The protection mode in Internet Explorer prevents it from accessing local flash files, so I can't allow the user to open the site off the CD in Explorer as it simply won't work.

Thus, I plan to distribute Firefox Portable on the CD. I've been able to configure it such that Firefox Portable starts up and loads the local html file when the CD is inserted, but of course because I am distributing on CD, it is necessary for the user to wait while Firefox portable copies over to the temp directory of their internal hard drive.

For users who already have Firefox installed, this may be frustrating, as it happens even if they already have FireFox open when they insert the CD.

Is there any way of using the .ini config file to get Firefox Portable to check for the availability of an existing Firefox installation, and if it finds one, to use that instead?

Any help appreciated,

loyalwhite

ZachHudock
ZachHudock's picture
Offline
Last seen: 1 year 11 months ago
Developer
Joined: 2006-12-06 18:07
I'm thinking you would have

I'm thinking you would have to write some sort of script to check for the existance of a local firefox, and if it does not exist, launch the portable. Then your autorun.inf file would launch this script, rather than an executable

The developer formerly known as ZGitRDun8705

loyalwhite
Offline
Last seen: 15 years 5 months ago
Joined: 2009-06-16 06:59
I'm thinking you would have

Thanks Zach. If this essentially means writing and compiling an exe file to do this, then I don't have the skills or software required. I think I am correct in saying that it would have to be an exe file in order to be called from the autorun.inf file.

If anyone else has any other suggestions they'd be gratefully received.

ZachHudock
ZachHudock's picture
Offline
Last seen: 1 year 11 months ago
Developer
Joined: 2006-12-06 18:07
AutoHotkey is one of the

AutoHotkey is one of the easiest to learn scripting languages out there, it's free and open source, and comes with a script to exe tool. Their help file is extremely well written, contains at the very least a detailed explanation of each function, and 9 times out of 10 an example too.

EDIT: Here's your script, you'll have to update the PathToYourFirefoxPortable to be a relative path to the location of this script, and add the path to your html file to the end of both Run commands. If you download the autohotkey package, once you edited the script, you can compile it to an exe

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


RegRead, mozillaKey, HKEY_LOCAL_MACHINE, SOFTWARE\Mozilla\Mozilla Firefox, CurrentVersion
RegRead, mozillaInstall, HKEY_LOCAL_MACHINE, SOFTWARE\Mozilla\Mozilla Firefox\%mozillaKey%\Main, PathToExe
IfExist %mozillaInstall%
{
	Run %mozillaInstall%
}Else{
	Run PathToYourFirefoxPortable
}

The developer formerly known as ZGitRDun8705

Log in or register to post comments