Jump to content

Annoying fox...


SwedenXP

Recommended Posts

This is the story;

Trying to do a silent install of Firefox 1.0.6 + extensions + bookmarks/favorites.

The silent install is no problem. The extensions goes just fine. But - to do the silent install of the bookmarks/favorites I have to know the name of the "something.default" directory located in "%userprofile%\Applic~1\Mozilla\Firefox\Profiles\" and this varies from install to install - it´s an "8 charactar (numbers and figures) .default" nasty thing :realmad: It´s into this directory my bookmarks.html should go which is no problem - when I know the correct name of the directory...

The question to You, ladies and gentlemen is;

Is there a way to set the name of the :realmad: directory?

Or

Is there a way to find out the name?

I install Firefox + the rest from within a .cmd file - so thats where the name of the directory eventually will go...

MegaBigThanx in advance!

/ SwedenXP

Edited by SwedenXP
Link to comment
Share on other sites


I am sure there is a way. I've struggled with this same thing. I like to do clean installs as much as possible (i.e. not repackaging it) and this is very interesting. This folder also holds your prefs.js which is also useful. I will definately be following this thread. I've been trying to write an autoit script for this very purpose but I am still a little fuzzy on how the findfile works in autoit.

Link to comment
Share on other sites

First thing's first...

directory located in "%userprofile%\Applic~1\Mozilla\Firefox\Profiles\"
You can use %AppData% instead of "%UserProfile%\Application Data".

Secondly, I don't really see why you need to know the directory name. You can CD to it using

CD "%AppData%\Mozilla\Firefox\Profiles\*.default"

, and once this is your working directory you can copy stuff in like normal, and you can use partial paths for subdirs.

Copy "%CDROM%\Firefox\userContent.css" "chrome\"
Copy "%CDROM%\Firefox\prefs.js" "%CD%"

If for some reason you really needed to remain in the original directory, or have some other reason for needing to know the folder name, try this

@Echo Off
Set ScriptDir=%CD%
CD "%AppData%\Mozilla\Firefox\Profiles\*.default"
Set FFProfile=%CD%
Set FFProfileFolder=%CD:~-16%
Set FFProfileName=%CD:~-16,-8%
CD %ScriptDir%

ECHO Found Firefox profile directory as %FFProfile%
ECHO Found Firefox profile folder as %FFProfileFolder%
ECHO Found Firefox profile name as %FFProfileName%

Pause

Doubtlessly there is a more elegant way to do this, but it works nonetheless (unless I typoed :P). I just use "Silence of the Foxes" to make my installer.

Edited by Achdine
Link to comment
Share on other sites

@Achdine - thanx for Your suggestions - I will look into them - although I don´t understand them fully...

But thats why I like this forum :thumbup When I don´t understand - I just ask - and eventually I will learn something :huh:

From a not so sunny Sweden

/ SwedenXP B)

Edited by SwedenXP
Link to comment
Share on other sites

@Achdine - Big step forward for me :yes:

I would like to ask one more thing (atleast) :rolleyes:

How do I get a .cmd file to wait for example 30 seconds before continuing (still within the same .cmd file).

Why? It takes some time for Firefox to complete it´s installation - and before thats done the extensions and favorietes will not install properly.

Hoping for yet another good answer from You or somebody else :whistle:

/ SwedenXP B)

Edited by SwedenXP
Link to comment
Share on other sites

SplashTextOn('', "Installing Mozilla Firefox 1.0.6, please stand by...", 400, 25, -1, -1, 1, '', 14)
RunWait("Firefox106.exe -MS")
SplashTextOn("", "Installing Macromedia Flash and Shockwave, please stand by...", 600, 25, -1, -1, 1, '', 14)
RunWait("msiexec /i mm_fl_sw_installer.msi /qn")
SplashOff()
SplashTextOn("", "Installing Mozilla Firefox Plug-In's && Extentions, please stand by...", 600, 25, -1, -1, 1, '', 14)

FileChangeDir(@Programfilesdir & "\Mozilla Firefox")
SplashTextOn('', "Installing GMail Notifier", 400, 25, -1, -1, 1, '', 14)
RunWait("firefox.exe -install-global-extension " & """" & @ScriptDir & "\gmail_notifier-0.4.3-fx+mz.xpi""")
SplashTextOn('', "Installing Adblock", 400, 25, -1, -1, 1, '', 14)
RunWait("firefox.exe -install-global-extension " & """" & @ScriptDir & "\adblock-0.5.2.039-fx.xpi""")
SplashTextOn('', "Installing IEView", 400, 25, -1, -1, 1, '', 14)
RunWait("firefox.exe -install-global-extension " & """" & @ScriptDir & "\ie_view-1.2.4-fx+mz.xpi""")
SplashTextOn('', "Installing DownThemAll", 400, 25, -1, -1, 1, '', 14)
RunWait("firefox.exe -install-global-extension " & """" & @ScriptDir & "\downthemall!-0.9.4-fx.xpi""")
SplashTextOn('', "Installing Cute Menus", 400, 25, -1, -1, 1, '', 14)
RunWait("firefox.exe -install-global-extension " & """" & @ScriptDir & "\cutemenus_2-0.6.1-fx+mz.xpi""")
SplashTextOn('', "Installing MediaPlayerConnectivity", 400, 25, -1, -1, 1, '', 14)
RunWait("firefox.exe -install-global-extension " & """" & @ScriptDir & "\mediaplayerconnectivity-0.3.9-fx+ns.xpi""")
SplashTextOn('', "Installed Download Statusbar", 400, 25, -1, -1, 1, '', 14)
RunWait("firefox.exe -install-global-extension " & """" & @ScriptDir & "\download_statusbar-0.9.2-fx.xpi""")
SplashTextOn('', "Installing AIRoboform", 400, 25, -1, -1, 1, '', 14)
RunWait("firefox.exe -install-global-extension " & """" & @ScriptDir & "\roboform_toolbar_extension-6.3.6-fx.xpi""")
SplashTextOn('', "Installing FocusLastSelectedTab", 400, 25, -1, -1, 1, '', 14)
RunWait("firefox.exe -install-global-extension " & """" & @ScriptDir & "\flst.xpi""")
SplashTextOn('', "Installing Disable XPI Install Delay", 400, 25, -1, -1, 1, '', 14)
RunWait("firefox.exe -install-global-extension " & """" & @ScriptDir & "\mr_tech_disable_xpi_install_delay-1.2.2-fx+mz+ns+sb+tb.xpi""")
SplashTextOn('', "Installing Hotmail Tabs", 400, 25, -1, -1, 1, '', 14)
RunWait("firefox.exe -install-global-extension " & """" & @ScriptDir & "\hotmail_tabs-0.9-fx.xpi""")
SplashTextOn('', "Installing Forecast Fox", 400, 25, -1, -1, 1, '', 14)
RunWait("firefox.exe -install-global-extension " & """" & @ScriptDir & "\forecastfox-0.8.1.1-fx+mz+ns.xpi""")
SplashTextOn('', "Installing FlashGot", 400, 25, -1, -1, 1, '', 14)
RunWait("firefox.exe -install-global-extension " & """" & @ScriptDir & "\flashgot-0.5.9.7-fx+mz+tb.xpi""")
SplashTextOn('', "Installing Greasemonkey", 400, 25, -1, -1, 1, '', 14)
RunWait("firefox.exe -install-global-extension " & """" & @ScriptDir & "\greasemonkey-0.3.5-fx.xpi""")
SplashTextOn('', "Installing TabClickingOptions", 400, 25, -1, -1, 1, '', 14)
RunWait("firefox.exe -install-global-extension " & """" & @ScriptDir & "\tab_clicking_options-0.5.2-fx+mz.xpi""")
SplashTextOn('', "Installing Tabbrowser Prefs", 400, 25, -1, -1, 1, '', 14)
RunWait("firefox.exe -install-global-extension " & """" & @ScriptDir & "\tabbrowser_preferences-1.2.7.1-fx.xpi""")
SplashTextOn('', "Installing GMail Delete Button", 400, 25, -1, -1, 1, '', 14)
RunWait("firefox.exe -install-global-extension " & """" & @ScriptDir & "\gmail_delete_button-2.6.1-fx.xpi""")

FileChangeDir(@appdatadir & "\Mozilla\Firefox\Profiles")
$search = FileFindFirstFile("*.default")
$file = FileFindNextFile($search)
FileClose($search)

FileCopy(@scriptdir & "\bookmarks.html", @appdatadir & "\Mozilla\Firefox\Profiles\" & $file & "\bookmarks.html")
FileCopy(@scriptdir & "\prefs.js", @appdatadir & "\Mozilla\Firefox\Profiles\" & $file & "\prefs.js")

FileCopy(@ScriptDir & "\bookmarks.html", @AppDataDir  & "\Mozilla\Firefox\Profiles\")

There's my autoit script. You can subsitute what you need.....works for me!

Link to comment
Share on other sites

There are many ways to get the pause you want. First try starting the Firefox installer with "Start /Wait", which will prevent the next command in the batch file from being run until the program completes. This is by far the best solution, but will not generally work if the installer has a wrapper.

You can also use a seperate .exe file to cause a delay. Search the boards for sleep.exe or wait.exe, for example. My favorite is NirCMD because it does so many other handy batch tricks as well (such as running the file completely silently, changing the volume, hiding windows, killing processes, or changing the resolution). Definitely worth integrating into your project. To create a 30 second pause with NirCMD use

NirCMDc.exe Wait 30000

Lastly you could use an internal Windows function that takes some time to complete, such as ping. Use this as a last resort.

Link to comment
Share on other sites

@Achdine Thanx for the suggestions - but I already use the "start /wait" option - I think it´s the creation of catalogs that takes time - it happens after the installer is done... or at least at the very end...

Have thought of doing the Firefox install in the beginning of my main_batch.cmd and the extensions and favorites/bookmarks at the end. But I will try the NirCMD - because it sounds interesting!

I will be back with comments on the result.

/ SwedenXP

Edited by SwedenXP
Link to comment
Share on other sites

@Achdine - it works really beautifully :thumbup

But it´s a shame that one have to use an external program for a "sleep/wait/pause funtion" - there ought to be some internal (WinXPPro) solution!

But as I warned :rolleyes: You - yet another question... Where´s the best place to put the NirCMDc.exe so I can reach it from wherer I want to? At C:\ or someplace else? Finally I will delete it!

/ SwedenXP B)

Link to comment
Share on other sites

put it in the

$OEM$/$$/System32

folder of your Unattended CD and just call it as Achdine has, because any file in the Windows/System32 folder can be called on its own like that.

Then, you can delete it using your cleanup command file if you have one..

DEL /F "%WINDIR%\System32\Nircmdc.exe"

or without any extra program just use:

PING 127.0.0.1 -n 30>NUL

to wait 30 seconds

Edited by Mekrel
Link to comment
Share on other sites

@Mekrel - Tried Your version with;

PING 127.0.0.1 -n 30>NUL

And it works really well.

@ All of You readers :hello:

Are there any disadvantages in using either of these two methods (Nircmdc.exe or PING)? PING seems easier since it´s already a part of XP...

/ SwedenXP B)

Link to comment
Share on other sites

I just wanted to point out that the profile does not have to be random. One can edit/replace the file %APPDATA%\Mozilla\Firefox\profiles.ini to point to a default profile.

[General]
StartWithLastProfile=1

[Profile0]
Name=ProfileName
IsRelative=1
Path=Profiles/ProfileName
Default=1

Just replace ProfileName with the name of your profile. You can even rename an existing random profilename with one of your choosing by renaming the directory, and editing this file to reflect the change.

Edited by ODC
Link to comment
Share on other sites

@ODC - Yes of course one can do that...

I only take the new version - and put it in the rigtht folder - and them I´m done - a new unattended installation :whistle: -----> less adjusting of files ----> a quicker and cleaner install -----> me :D

/ SwedenXP

Link to comment
Share on other sites

Are there any disadvantages in using either of these two methods (Nircmdc.exe or PING)? PING seems easier since it´s already a part of XP...

No disadvantages of either. However Nircmdc.exe can do some pretty neat things, such as creating custom shortcuts and such which will be usefull in unattended installations.

Also the CDROM open command so you can take out your unattended CD when its finished ;)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...