Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Chrome Installer for Mac -- the repository! | 1 # Chrome Installer for Mac -- the repository! |
| 2 | 2 |
| 3 This Mac app installs Chrome on the machine it's run on. It's meant to be the | |
| 4 Mac app the user first downloads when he/she clicks 'Download Chrome' on a Mac | |
|
Elly Fong-Jones
2016/08/30 15:09:45
he/she -> they :) we use singular they chromium-wi
Anna Zeng
2016/08/30 15:16:21
Done.
| |
| 5 machine. After the user runs the app, Chrome would launch directly after | |
| 6 installation completes successfully. | |
| 7 | |
| 3 ## The 10,000 Foot View | 8 ## The 10,000 Foot View |
| 4 | 9 |
| 5 This Mac app installs Chrome on the machine it's run on. To do so, it breaks | 10 The installer breaks down its task into the following steps: |
| 6 down installation into the following basic steps: | |
| 7 | 11 |
| 8 1. __OmahaCommunication__: Ask Omaha for a URL of the most recent compatible | 12 1. __OmahaCommunication__: Ask Omaha for a URL of the most recent compatible |
| 9 copy of the Google Chrome disk image in Google's servers. | 13 copy of the Google Chrome disk image in Google's servers. |
| 10 2. __Downloader__: Download the disk image, via URL from OmahaCommunication. | 14 2. __Downloader__: Download the disk image, via URL from OmahaCommunication. |
| 11 3. __Unpacker__: Mount the disk image and extract the Chrome app bundle. | 15 3. __Unpacker__: Mount the disk image and extract the Chrome app bundle. |
| 12 4. __AuthorizedInstall__: With privilege escalation if able, move the Chrome | 16 4. __AuthorizedInstall__: With privilege escalation if able, move the Chrome |
| 13 app into the Applications folder, set permissions, and hand ownership of | 17 app into the Applications folder, set permissions, and hand ownership of |
| 14 the Chrome app to `root`. | 18 the Chrome app to `root`. |
| 15 5. Launch Chrome & close. | 19 5. Launch Chrome & close. |
| 16 | 20 |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 31 will take care of any tear-down tasks before exiting naturally. | 35 will take care of any tear-down tasks before exiting naturally. |
| 32 | 36 |
| 33 We initialize the AuthorizedInstall class early in the life of the installer so | 37 We initialize the AuthorizedInstall class early in the life of the installer so |
| 34 the user can immediately choose to authorize the installer for root installation . | 38 the user can immediately choose to authorize the installer for root installation . |
| 35 The script consumes the authorization token (which expires in five minutes by | 39 The script consumes the authorization token (which expires in five minutes by |
| 36 default) immediately, then waits until the installer has progressed to step 4 | 40 default) immediately, then waits until the installer has progressed to step 4 |
| 37 (above). | 41 (above). |
| 38 | 42 |
| 39 ## The Class Breakdown | 43 ## The Class Breakdown |
| 40 | 44 |
| 41 AppDelegate | Controls the flow of the program | 45 | Class | Role | |
| 42 AuthorizedInstall | Attempts authorization to add Chrome to | 46 |----------------------------|-------------------------------------------------- --| |
| 43 | Applications folder and adjust permissions as root | 47 | AppDelegate | Controls the flow of the program | |
| 44 Downloader | Downloads GoogleChrome.dmg from Omaha Servers | 48 | AuthorizedInstall | Attempts authorization to add Chrome to the Appli cations folder and adjust permissions as root | |
| 45 InstallerWindowController | Controls the user interface | 49 | Downloader | Downloads GoogleChrome.dmg from Omaha servers | |
| 46 OmahaCommunication | Talks with Omaha Servers to get URL of disk image | 50 | InstallerWindowController | Controls the user interface | |
| 47 OmahaXMLParser | Extracts URLs from Omaha's XML response. | 51 | OmahaCommunication | Talks with Omaha Servers to get URL of disk image | |
| 48 OmahaXMLRequest | Creates an XML request to send to Omaha. | 52 | OmahaXMLParser | Extracts URLs from Omaha's XML response | |
| 49 SystemInfo | Provides system information to help craft the XML | 53 | OmahaXMLRequest | Creates an XML request to send to Omaha | |
| 50 | request for Omaha. | 54 | SystemInfo | Provides system information to help craft the XML request for Omaha | |
| 51 Unpacker | Mounts the disk image and controls the temporary | 55 | Unpacker | Mounts the disk image and controls the temporary directory that abstracts the installer's file-manipulating activity from the use r | |
| 52 | directory that abstracts the installer's | |
| 53 | file-manipulating activity from the user. | |
| 54 | 56 |
| 55 ## The Future | 57 ## The Future |
| 56 | 58 |
| 57 Here lies a list of hopes and dreams: | 59 Here lies a list of hopes and dreams: |
| 58 | 60 |
| 59 * Implement resumable downloads. | 61 * Implement resumable downloads. |
| 60 * Add in adequate testing using a local test server. | 62 * Add in adequate testing using a local test server. |
| 61 * Include basic error recovery attempts -- say, if during a download a URL | 63 * Include basic error recovery attempts -- say, if during a download a URL |
| 62 does not provide a valid disk image, the installer can try re-downloading | 64 does not provide a valid disk image, the installer can try re-downloading |
| 63 the disk image from another URL. | 65 the disk image from another URL. |
| 64 * Manage potential conflicts, in the case that Google Chrome already exists in | 66 * Manage potential conflicts, in the case that Google Chrome already exists in |
| 65 the Applications folder when the installer is run. | 67 the Applications folder when the installer is run. |
| 66 * Trash the installer application after it has completed running. | 68 * Trash the installer application after it has completed running. |
| 69 | |
| 70 ## Contacts | |
| 71 | |
| 72 This was initially an intern project of zengster@ and ivanhernandez@, who worked | |
| 73 under the guidance of hosts ellyjones@ and mark@, with plenty of involvement | |
| 74 with sdy@. Any thoughts should be directed to ellyjones@, mark@, and/or sdy@. | |
|
Elly Fong-Jones
2016/08/30 15:09:45
This doesn't need to / shouldn't go in the README
Anna Zeng
2016/08/30 15:16:21
Done.
| |
| 75 | |
| 76 ## Diagram Appendix | |
| 77 | |
| 78 ### Task Flow | |
| 79 | |
| 80 ``` | |
| 81 Exposed Errors Main Logic | |
| 82 | |
| 83 +--------------------------------------+ | |
| 84 | | | |
| 85 | Request authentication from users | | |
| 86 | | | |
| 87 +------------------+-------------------+ | |
| 88 | | |
| 89 +------------------v-------------------+ | |
| 90 | | | |
| 91 +--------+ Ask Omaha for appropriate Chrome app | | |
| 92 v | | | |
| 93 +------------------+-------------------+ | |
| 94 Network Error | | |
| 95 +------------------v-------------------+ | |
| 96 ^ | | | |
| 97 +--------+ Parse the response from Omaha | | |
| 98 | | | |
| 99 +------------------+-------------------+ | |
| 100 | | |
| 101 +------------------v-------------------+ | |
| 102 | | | |
| 103 Download Error <-+ Download the Chrome disk image | | |
| 104 | | | |
| 105 +------------------+-------------------+ | |
| 106 | | |
| 107 +------------------v-------------------+ | |
| 108 | | | |
| 109 +--------+ Mount the disk image | | |
| 110 v | | | |
| 111 +------------------+-------------------+ | |
| 112 Install Error | | |
| 113 +------------------v-------------------+ | |
| 114 ^ | | | |
| 115 +--------+ Install & Configure Chrome app | | |
| 116 | | | |
| 117 +------------------+-------------------+ | |
| 118 | | |
| 119 +------------------v-------------------+ | |
| 120 | | | |
| 121 | Unmount disk image +-> If unmount fails, sy stem | |
| 122 | | restart can resolve this. | |
| 123 +------------------+-------------------+ | |
| 124 | | |
| 125 +------------------v-------------------+ | |
| 126 | | | |
| 127 Launch Error <-+ Launch Chrome | | |
| 128 | | | |
| 129 +--------------------------------------+ | |
| 130 ``` | |
| 131 | |
| 132 ### Class Heirarchy | |
| 133 | |
| 134 ``` | |
| 135 Users | |
| 136 | |
| 137 ^ + | |
| 138 | | | |
| 139 | | | |
| 140 +-------------------------------+-----v--------------------------------+ | |
| 141 | | | |
| 142 | InstallerWindowController | | |
| 143 | | | |
| 144 +-------+------^------------+---^--------+----^---------+---------^----+ | |
| 145 | | | | | | | | | |
| 146 | | | | | | | | | |
| 147 | | | | | | | | | |
| 148 +-------v------+------------v---+--------v----+---------v---------+----+ | |
| 149 | | | |
| 150 | AppDelegate | | |
| 151 | | | |
| 152 +-------+------^------------+---^--------+----^---------+---------^----+ | |
| 153 | | | | | | | | | |
| 154 | | | | | | | | | |
| 155 | | | | | | | | | |
| 156 +-------v------+-----+ +----v---+---+ +--v----+--+ +----v---------+----+ | |
| 157 | | | | | | | | | |
| 158 | OmahaCommunication | | Downloader | | Unpacker | | AuthorizedInstall | | |
| 159 | | | | | | | | | |
| 160 +-------^------^-----+ +------------+ +----------+ +---------^---------+ | |
| 161 | | | | |
| 162 | +------------+ | | |
| 163 | | | | |
| 164 +-------+---------+ +-------+--------+ +--------+--------+ | |
| 165 | | | | | | | |
| 166 | OmahaXMLRequest | | OmahaXMLParser | | copy_to_disk.sh | | |
| 167 | | | | | | | |
| 168 +-------^---------+ +----------------+ +-----------------+ | |
| 169 | | |
| 170 | | |
| 171 | | |
| 172 +-----+------+ | |
| 173 | | | |
| 174 | SystemInfo | | |
| 175 | | | |
| 176 +------------+ | |
| 177 ``` | |
| OLD | NEW |