1. Trang chủ
  2. » Công Nghệ Thông Tin

Hacking Firefox - part 27 pot

10 159 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 10
Dung lượng 1,34 MB

Nội dung

262 Part V — Installation, Automation, Tools, and Tricks Hacking with MaSaI One great tool that you can use to create or update MSIs is MaSaI Solutions’ MaSaI Installer. While Microsoft has the Orca MSI editor as part of its Installer SDK, MaSaI offers some interesting options and an enhanced interface, as shown in Figure 13-7. While the full version of this tool is not free, if you want to get serious about creating, extracting, or updating MSIs, this is a viable option. The MaSaI tools offer the ability to extract MSI contents to a source path for easy updating and rebuilding without having to do this on the system that originally created the MSI. Additional features include MCE and ICE validation and verification, as well as a host of other advanced tools. F IGURE 13-7: MaSaI Editor viewing the official Firefox MSI You can download the MaSaI Installer from http://www.masaieditor.com/. Hacking with Microsoft’s Orca To download and install Microsoft’s Orca tool from the Windows Software Development Kit SDK, just hop over to http://www.microsoft.com/downloads/details.aspx? FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5 or to the older link http:// www.microsoft.com/msdownload/platformsdk/sdkupdate/ , which redirects easily. 20_596500 ch13.qxd 6/30/05 3:06 PM Page 262 263 Chapter 13 — Hacking Installation and Deployment Special attention should be placed on the fact that this site is heavily Internet Explorer-specific and will prompt you to install an ActiveX control to manage the downloading and updates of the Installer SDK. Once you have installed the full Installer SDK, you can dig through the directories to find the Orca.msi installer. The default directory that the installer uses is C:\Program Files\Microsoft SDK\Bin. This is where you can find the Orca.msi file. The Orca installer creates an Orca shortcut in your Start ➪Programs menu and launches a simple interface, as shown in Figure 13-8. F IGURE 13-8: Microsoft’s Orca MSI editor viewing the official Firefox MSI Other Notable MSI Tools Two additional tools that you can use for creating and updating are MAKEMSI and Advanced Installer. Each tool offers different features; MAKEMSI is an XML scripted tool, and Advanced Installer is a fully visual Windows application, as shown in Figure 13-9. 20_596500 ch13.qxd 6/30/05 3:06 PM Page 263 264 Part V — Installation, Automation, Tools, and Tricks F IGURE 13-9: Advanced Installer’s main window Getting MAKEMSI One nice feature of MAKEMSI is its ability to create an installer by just pointing it to a directory or registry file. To download the MAKEMSI installer tool, visit http://www .labyrinth.net.au/~dbareis/MAKEMSI.htm . To make life easier when using MAKEMSI you can also download the MSIDIFF tool ( http://www.labyrinth.net.au/~dbareis/msidiff.htm), which adds right-click context menu options for MSIs to extract MSIs to scripts, as well as to compare different scripts. Getting Advanced Installer While Advanced Installer lacks the import functionality needed to update an existing MSI, it does have a rather simple interface for creating a new installer. Once you have created this new installer you can save the setting as an Advanced Installer Project for future updating and redeploying. To get your free copy of Advanced Installer, visit http://www.advancedinstaller.com/. 20_596500 ch13.qxd 6/30/05 3:06 PM Page 264 265 Chapter 13 — Hacking Installation and Deployment Summary This chapter should help you deploy and manage a core Firefox installation across multiple computers. The chapter started by discussing hacking the installer and extracting the contents, moved on to configuration options, and finished with options and methods for building a deployable Firefox installer. While this chapter is not meant to cover every possible installation or deployment option for Firefox, it does cover many of the more popular options available today. 20_596500 ch13.qxd 6/30/05 3:06 PM Page 265 20_596500 ch13.qxd 6/30/05 3:06 PM Page 266 Backing Up and Managing Your Profile/Settings F irefox uses profiles to keep track of your browser preferences, exten- sions, themes, and cached data. They’re stored apart from the browser’s application files and can be managed separately from the program itself. This chapter looks at different ways you can manipulate your profiles for backup and portability. You’ll find out how to preserve your profiles, move them to other computers, and restore them when the time comes. Before You Begin, Back Up Because you’re a seasoned Firefox user, you’ve personalized the browser to give yourself a familiar environment in which to work. We’re going to hack your existing profiles in this chapter, and there’s a chance that you could accidentally damage or destroy your settings. To prevent that, back up your current profiles now so that if you do mess them up, you can easily restore them and get your old Firefox settings back. In Windows, profiles are stored in the following directory: C:\Documents and Settings\[your username]\Application Data\ Mozilla\Firefox\Profiles In Linux, the profile for each user is stored in the user’s home directory, in the following path: ~/.mozilla/firefox/[Profile name]/ In Mac OS X, profiles are located in either of these directories: ~/Library/Mozilla/Firefox/Profiles/[Profile name]/ or ~/Library/Application Support/Mozilla/Firefox/Profiles/ [Profile name]/ ˛ Use the hidden Profile Manager ˛ Create new profiles for different purposes ˛ Back up and restore your profiles chapter in this chapter by Phil Catelinet 21_596500 ch14.qxd 6/30/05 3:07 PM Page 267 268 Part V — Installation, Automation, Tools, and Tricks Copy the entire Firefox folder to another location on your hard drive. Because the default disk cache location is in the profile, you can save time and space by launching Firefox and clearing the browser cache before copying the folder. If, at any time, you want to restore your profiles, close Firefox and copy the backup folder back to this directory. Finding and Using the Hidden Profile Manager If you used the Mozilla suite or an older browser like Netscape, you might remember the Profile Manager that would launch the first time you ran the browser. The Profile Manager lets you use different settings for different browser users without having to log out of the operating system and back on as another user. Firefox still contains the Profile Manager, but it’s been hidden from view. When you start Firefox for the first time, it builds a profile for you based on its defaults, but you can start Firefox with the Profile Manager to create new profiles or delete existing ones. To launch the Profile Manager in Windows, first make sure that Firefox is closed. Then click on Start ➪ Run and type %ProgramFiles%\Mozilla Firefox\firefox.exe -ProfileManager. (You might need to enclose everything but the -ProfileManager switch in quotes.) In Mac OS X and Linux, open a new Terminal session and type the path and switch at the command prompt. For Mac OS X, the command should be as follows: /Applications/Mozilla.app/Contents/MacOS/mozilla -ProfileManager For Linux, the path depends on where you installed Firefox, but the command line switch is the same: ~\[path to Firefox]\firefox -ProfileManager You can also edit the shortcut for Firefox and add the -ProfileManager switch after the executable command. Note that the Profile Manager now launches every time you use the shortcut, so you might want to copy the original shortcut first, and then add the switch to the copy (and rename the shortcut appropriately). That way, you can launch Firefox with the Profile Manager when you need it, but start Firefox without it the rest of the time. Creating and Deleting Profiles The Profile Manager lets you create, rename, and delete profiles, as shown in Figure 14-1. When you click on the Create Profile . . . button, the Profile Manager starts a new profile wiz- ard that lets you configure two options: the profile name and its location (see Figure 14-2). The name of a new profile will always be “Default User” at first, and the location will be the Profiles folder we located earlier. You can choose a different name for your new profile and Firefox adjusts the profile path accordingly. If you prefer, you can create the new profile in a completely different location from your existing profiles by using the Choose Folder . . . button. 21_596500 ch14.qxd 6/30/05 3:07 PM Page 268 269 Chapter 14 — Backing Up and Managing Your Profile/Settings F IGURE 14-1: Firefox’s Profile Manager. F IGURE 14-2: The Create Profile wizard. From the Profile Manager screen, you can also rename an existing profile or delete it entirely. If you delete a profile, Firefox asks if you want to delete the files associated with the profile along with the name. Figure 14-3 shows the choices when deleting a profile. You have the opportu- nity to save any of the data stored in the profile — the bookmarks, cookies, saved passwords, and more — before deleting the profile for good. If you delete the files through the Profile Manager, they are gone forever, so know what you want before you click. 21_596500 ch14.qxd 6/30/05 3:07 PM Page 269 270 Part V — Installation, Automation, Tools, and Tricks F IGURE 14-3: The Profile Manager gives you the chance to save the data before you delete a profile. One more thing to remember: Firefox always starts with the last profile used, unless you use the Profile Manager or a command line switch to select a different profile. What’s in a Profile? Let’s take a closer look at the files in a typical profile. We’ll explore a new profile, then compare it with your working profile. Launch Firefox with the Profile Manager and create a new profile. Start Firefox with this pro- file. Using your computer’s file system, browse to the new profile’s folder. Because this is a new profile, any files in the folder were automatically created by Firefox. You should find these files, among others, in the profile: Ⅲ bookmarks.html: Contains the default Firefox bookmarks. Ⅲ compatibility.ini: Checks for extension compatibility with currently installed version of Firefox. Ⅲ components.ini: Contains components listing for extensions. Ⅲ compreg.dat: Contains Firefox component Registry listing. Ⅲ cookies.txt: Contains cookies set while browsing. Ⅲ defaults.ini: Lists locations for some extensions in your profile. Ⅲ history.dat: Contains Firefox’s browser history. Ⅲ localstore.rdf: Defines default window settings and toolbar sizes and positions. Ⅲ mimetypes.rdf: Lists default file MIME types for helper applications. Ⅲ prefs.js: This is Firefox’s preferences file. Ⅲ search.rdf: Contains information on Firefox’s search plugins. Ⅲ xpti.dat: This is a catalog for Component Object Model type library. Ⅲ XUL.mfl: This is a cache file of the Firefox user interface for quick load of browser. 21_596500 ch14.qxd 6/30/05 3:07 PM Page 270 271 Chapter 14 — Backing Up and Managing Your Profile/Settings A brand new profile will also have three directories: Ⅲ cache: Stores the Firefox browser disk cache. Ⅲ chrome: Contains userChrome-example.css and userContent-example.css files, which contain sample text for userChrome.css and userContent.css. If you create customized versions of userChrome.css and userContent.css, they will be kept in this folder. Ⅲ extensions: Where your extensions are kept. Some extensions may store their data out- side of the extensions folder. Your active profile may have many other files in it, but the additional files you should be most concerned with are as follows: Ⅲ downloads.rdf: Keeps track of your Download Manager data. Ⅲ formhistory.dat: Stores your autocomplete data for web forms. Ⅲ signons.txt: Holds any web page usernames and passwords you’ve saved while browsing. The usernames and passwords are encrypted for added security. Ⅲ key3.db: Works with the signons.txt file to save usernames and passwords. Ⅲ parent.lock: This file only appears when Firefox is using this profile. It indicates that the profile is in use. Ⅲ user.js: Contains user-added preferences (if you created this file yourself). There are two other files located above the Profiles folder: Ⅲ pluginreg.dat: Registers installed plugins, and is created each time Firefox launches. Ⅲ profiles.ini: Tells Firefox where to find your profiles. We’ll take a closer look at profiles.ini in the next section. You can learn more about the files in a typical profile at http://gemal.dk/mozilla/ files.html. Move Your Profiles Around The default location for profiles works for most people, but you’re not most people. Maybe you have a network file share that you’d like to use for your profile, so that the profile gets backed up automatically each night by the file server. Or perhaps you want to take your profile with you and use it on another computer. Knowing how to move your profile can come in handy. 21_596500 ch14.qxd 6/30/05 3:07 PM Page 271 . make sure that Firefox is closed. Then click on Start ➪ Run and type %ProgramFiles%Mozilla Firefox firefox.exe -ProfileManager. (You might need to enclose everything but the -ProfileManager. follows: /Applications/Mozilla.app/Contents/MacOS/mozilla -ProfileManager For Linux, the path depends on where you installed Firefox, but the command line switch is the same: ~[path to Firefox] firefox -ProfileManager You can. Kit SDK, just hop over to http://www.microsoft.com/downloads/details.aspx? FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5 or to the older link http:// www.microsoft.com/msdownload/platformsdk/sdkupdate/ ,

Ngày đăng: 04/07/2014, 17:20