platform-update-home/doc/eclipse-installer.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (view) (download) (as text)

1 : droberts 1.3 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 : vlad 1.1 <html>
3 :    
4 :     <head>
5 :     <meta http-equiv="Content-Language" content="en-us">
6 :     <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
7 :     <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
8 :     <meta name="ProgId" content="FrontPage.Editor.Document">
9 :     <title>How to write an Eclipse installer</title>
10 :     </head>
11 :    
12 :     <body>
13 :    
14 :     <h1>How to write an Eclipse installer</h1>
15 : jeem 1.2 <p>Last modified 11:15 Monday May 6, 2002</p>
16 : vlad 1.1 <p>Eclipse-based products need to be correctly installed on the end user's
17 :     computer. Special-purpose packaging tools, such as <a href="http://www.installshield.com/">InstallShield</a>
18 :     and <a href="http://www.rpm.org/">RPM</a>, are often used to build executable
19 :     installers that automate installing, updating, and uninstalling. This note
20 :     describes how to write an installer for an Eclipse-based product, and for
21 :     separately-installable extensions to Eclipse-based products.</p>
22 :     <p>We assume that a product development team is responsible for providing the
23 :     raw ingredients that will need to find their way to end users' computers
24 :     packaged as an executable installer. The creation of executable installers is
25 :     scripted, as are the install time actions needed to interact with the end user
26 :     and deposit files on their computer. This note described in detail what these
27 :     installers need to do and how they should work.&nbsp;</p>
28 :     <p>This note should be treated as a recipe for the person responsible for
29 :     writing an installer for an Eclipse-based products. Two good reasons why we
30 :     recommend all installers writers follow our recipe:</p>
31 :     <ul>
32 :     <li><b>Product and extension interoperability.</b> By behaving in standard
33 :     ways, an installer for one Eclipse-based product or extension automatically
34 :     works with products and extensions laid down by other installers. Otherwise
35 :     the idiosyncrasies of one product's installer would require matching quirks
36 :     in all extension installers that expected to work with that product.</li>
37 :     <li><b>Uniformity of install time user interaction.</b> All installers for
38 :     Eclipse-based products and extension should interact with the user in the
39 :     same manner. There is nothing to having gratuitous variety in this matter.</li>
40 :     </ul>
41 :    
42 :     <h2>Product installer creation script</h2>
43 :    
44 :     <p>A product installer should be self-contained - the kind of thing that could
45 :     be distributed on a CD and installed on any machine with a suitable operating
46 :     system.</p>
47 :     <p>Eclipse requires a Java2 Java Runtime Environment (JRE) to run Java code.
48 :     JREs are licensed software, obtained from Java vendors. With a license to
49 :     redistribute a JRE from a JRE vendor, a company can include a JRE with its
50 :     product, and install it on the end user's computer at the same time as the
51 :     product. The alternative is to require that a JRE be pre-installed on the end
52 :     user's computer, and associated with at product install time. One way or the
53 :     other, an Eclipse-based product requires a suitable JRE, and the product
54 :     installer must play a role in either installing a JRE or locating and linking to
55 :     a pre-existing JRE.&nbsp;</p>
56 :     <p>Assume that a JRE is to be installed with the product. A directory containing
57 :     the JRE is one input to the installer creation script. Denote this directory
58 :     &lt;<i>JRE</i>&gt;. This directory must have a standard JRE directory structure,
59 :     with the Java executable is located at <code>jre/bin/java.exe</code> and the class
60 :     library at <code>jre/lib/rt.jar</code> below the &lt;<i>JRE</i>&gt; directory.
61 :     For reference, the skeletal structure of this directory looks like:</p>
62 :     <p><code>&lt;<i>JRE</i>&gt;/<br>
63 :     &nbsp; jre/<br>
64 :     &nbsp;&nbsp;&nbsp; bin/<br>
65 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; java.exe<br>
66 :     &nbsp;&nbsp;&nbsp; lib/<br>
67 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rt.jar
68 :     </code></p>
69 :     <p>There are additional files (and subdirectories) in these directories; we've
70 :     only shown a sample to give the general structure. Italicized names in italics
71 :     are product-specific.</p>
72 :     <p>The second input to the installer creation script is a directory, &lt;<code><i>product
73 :     head</i></code>&gt;,
74 :     containing the product-specific executable launcher and any files unrelated to
75 :     Eclipse. For reference, the skeletal
76 :     structure of this directory would look like (italics indicate file names that
77 :     will vary from product to product):</p>
78 :     <p><code>&lt;<i>product head</i>&gt;/<br>
79 :     <i>&nbsp; acmeproduct.exe<br>
80 :     </i>
81 :     <br>
82 :     </code>The third input to the installer creation script is a directory, &lt;<code><i>product
83 :     body</i></code>&gt;,
84 :     containing the features and plug-ins developed for the product. For reference, the skeletal
85 :     structure of this directory would look like:</p>
86 :     <p><code>&lt;<i>product body</i>&gt;/<br>
87 :     &nbsp; eclipse/<br>
88 :     &nbsp;&nbsp;&nbsp; features/<br>
89 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <i>com.example.acme.acmefeature</i>_<i>1.0.0</i>/<br>
90 :     &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; feature.xml<br>
91 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <i>com.example.acme.otherfeature</i>_<i>1.0.0</i>/<br>
92 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; feature.xml<br>
93 :     &nbsp;&nbsp;&nbsp; plugins/<br>
94 :     </code>&nbsp; <code>&nbsp;&nbsp;&nbsp;&nbsp; <i>com.example.acme.acmefeature</i>_<i>1.0.0</i>/<br>
95 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; plugin.xml<br>
96 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; about.ini<br>
97 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; about.properties<br>
98 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; about.mappings<br>
99 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; plugin_customization.ini<br>
100 : jeem 1.2 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; splash.bmp<br>
101 : vlad 1.1 </code>&nbsp; <code>&nbsp;&nbsp;&nbsp;&nbsp; <i>com.example.acme.otherfeature</i>_<i>1.0.0</i>/<br>
102 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; plugin.xml<br>
103 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; about.ini<br>
104 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; about.properties<br>
105 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; about.mappings<br>
106 :     </code>&nbsp; <code>&nbsp;&nbsp;&nbsp;&nbsp; <i>com.example.acme.myplugin</i>_<i>1.0.0</i>/<br>
107 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; plugin.xml<br>
108 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <i>myplugin</i>.jar<br>
109 :     </code>&nbsp; <code>&nbsp;&nbsp;&nbsp;&nbsp; <i>com.example.acme.otherplugin</i>_<i>1.0.0</i>/<br>
110 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; plugin.xml<br>
111 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <i>otherplugin</i>.jar
112 :     </code></p>
113 :     <p>The fourth input to the installer creation script is a directory, &lt;<code><i>platform</i></code>&gt;,
114 :     containing the features and plug-ins for the Eclipse platform itself and any third-party tools being included.
115 :     This directory also includes the standard Eclipse executable launcher, <code>eclipse.exe</code>,
116 :     (named <code>eclipse</code> on Unix operating environment), its companion <code>startup.jar</code>, and any other Eclipse platform files
117 :     required to be at the root of the install. For reference, the skeletal
118 :     structure of this directory would look like:</p>
119 :     <p><code>
120 :     &lt;<i>platform</i>&gt;<br>
121 :     &nbsp; eclipse/<br>
122 :     &nbsp; &nbsp; eclipse.exe<br>
123 :     &nbsp;&nbsp;&nbsp; startup.jar<br>
124 :     &nbsp;&nbsp;&nbsp; features/<br>
125 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; org.eclipse.platform_2.0.0/<br>
126 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; org.eclipse.platform.win32_2.0.0/<br>
127 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; org.eclipse.jdt_2.0.0/<br>
128 :     &nbsp; &nbsp;&nbsp;&nbsp; org.eclipse.pde_2.0.0/<br>
129 :     &nbsp;&nbsp;&nbsp; plugins/<br>
130 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; org.eclipse.platform_2.0.0/<br>
131 :     &nbsp; &nbsp;&nbsp;&nbsp; org.eclipse.core.runtime_2.0.0/<br>
132 :     &nbsp;&nbsp;&nbsp; &nbsp; org.eclipse.core.boot_2.0.0/<br>
133 :     &nbsp; &nbsp;&nbsp;&nbsp; org.eclipse.core.resources_2.0.0/<br>
134 :     &nbsp;&nbsp;&nbsp; &nbsp; org.eclipse.ui_2.0.0/<br>
135 :     &nbsp; &nbsp;&nbsp;&nbsp; org.eclipse.jdt_2.0.0/<br>
136 :     &nbsp;&nbsp;&nbsp; &nbsp; org.eclipse.jdt.core_2.0.0/<br>
137 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; org.eclipse.jdt.ui_2.0.0/<br>
138 :     &nbsp; &nbsp;&nbsp;&nbsp; org.eclipse.pde_2.0.0/<br>
139 :     &nbsp;&nbsp;&nbsp; &nbsp; org.eclipse.pde.core_2.0.0/<br>
140 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; org.eclipse.pde.ui_2.0.0/<br>
141 :     &nbsp; &nbsp;&nbsp;&nbsp; (more org.eclipse.* plug-in directories)<br>
142 :     <br>
143 :     </code>The exact contents of the &lt;<i><code>JRE</code></i>&gt;, &lt;<i><code>product
144 :     head</code></i>&gt;, &lt;<i><code>product body</code></i>&gt;,
145 :     and &lt;<code><i>platform</i></code>&gt; input directories determine what files
146 :     will eventually be installed on the end user's computer.</p>
147 :     <p>The final inputs to the installer creation script are the id and version
148 :     strings for the product's primary feature; e.g., &quot;<code><i>com.example.acme.acmefeature&quot;</i></code>,
149 :     and &quot;<code><i>1.0.0</i></code>&quot;;
150 :     and the name of the product executable; e.g., &quot;<code><i>acmeproduct</i></code><code>.exe</code>&quot;.
151 :     For products that do not require their own product executable, this would be the
152 :     path of the standard Eclipse executable launcher &quot;<code>eclipse/eclipse.exe</code>&quot;.
153 :     These strings have special significance to the installer, appearing in file and
154 :     directory names, and in the contents of marker files created at install time.</p>
155 :     <p>At install time, the installer should behave in the standard manner (further
156 :     details follow the list of steps):</p>
157 :     <ol>
158 :     <li>warn user to exit all programs</li>
159 :     <li>introduce the product to be installed</li>
160 :     <li>if appropriate, ask the user for the name of the registered owner and for
161 :     the license key</li>
162 :     <li>display the product's licensing agreement and ask the user to accept</li>
163 :     <li>recommend a location on the disk to install the product (but allow user to
164 :     override this default)</li>
165 :     <li>check that a product or extension is not already stored at the specified
166 :     location</li>
167 :     <li>ask user to confirm all details of the install</li>
168 :     <li>create marker file to mark root of product install</li>
169 :     <li>copy files to disk&nbsp; (see below)</li>
170 :     <li>if appropriate, insert name of registered owner and license key into the &quot;about
171 :     &quot; description</li>
172 :     <li>create a desktop shortcut to run the product executable</li>
173 :     <li>create an appropriate entry to allow the user to uninstall the product</li>
174 :     <li>launch the product executable with -initialize option to perform all
175 :     first-time processing</li>
176 :     <li>offer to show the product release notes (&quot;readme&quot; file)</li>
177 :     </ol>
178 :     <p>If the location specified in step 5 is &lt;<code><i>install</i></code>&gt;,
179 :     the installer copies all the files in the &lt;<i><code>JRE</code></i>&gt;, <code>&lt;<i>platform</i>&gt;, </code> &lt;<i><code>product</code></i>&gt;,&nbsp;
180 :     and <code>&lt;<i>product plug-ins</i>&gt;</code> directories into &lt;<code><i>install</i></code>&gt;.</p>
181 :     <table border="1" width="50%">
182 :     <tr>
183 :     <td width="50%">Input file</td>
184 :     <td width="50%">Installed file</td>
185 :     </tr>
186 :     <tr>
187 :     <td width="50%"><code>&lt;<i>JRE</i>&gt;/*</code></td>
188 :     <td width="50%"><code>&lt;<i>install</i>&gt;/eclipse/*</code></td>
189 :     </tr>
190 :     <tr>
191 :     <td width="50%"><code>&lt;<i>product head</i>&gt;/*</code></td>
192 :     <td width="50%"><code>&lt;<i>install</i>&gt;/*</code></td>
193 :     </tr>
194 :     <tr>
195 :     <td width="50%"><code>&lt;<i>product body</i>&gt;/*</code></td>
196 :     <td width="50%"><code>&lt;<i>install</i>&gt;/*</code></td>
197 :     </tr>
198 :     <tr>
199 :     <td width="50%"><code>&lt;<i>platform</i>&gt;/*</code></td>
200 :     <td width="50%"><code>&lt;<i>install</i>&gt;/*</code></td>
201 :     </tr>
202 :     </table>
203 :     <p>The marker file created in step 8 is <code>&lt;<i>install</i>&gt;/</code><code>.eclipseproduct</code>
204 :     is used to mark a directory into which an Eclipse-based product has been
205 :     installed, primarily for extension installers to locate. This marker file is a <a href="http://java.sun.com/j2se/1.3/docs/api/java/util/Properties.html">java.io.Properties</a>
206 :     format file (ISO 8859-1 character encoding with &quot;\&quot; escaping) and
207 :     contains the following information that identifies the product to the user and distinguishes
208 :     one Eclipse-based product from one another:</p>
209 :     <blockquote>
210 :     <p><code>name=<i>Acme Visual Tools Pro</i><br>
211 :     id=<i>com.example.acme.acmefeature<br>
212 :     </i>version=<i>1.0.0</i></code></p>
213 :     </blockquote>
214 :     <p>The values of the &quot;id&quot; and &quot;version&quot; property are inputs
215 :     to the installer creation script; the name of the product is presumably known
216 :     and hard-wired. (Products would not ordinarily access this marker file; only
217 :     product and extension installers write or read it.)</p>
218 :     <p>Step 6 requires checking for an existing <code>&lt;<i>install</i>&gt;/eclipse/.eclipseproduct</code>
219 :     or <code>&lt;<i>install</i>&gt;/eclipse/.eclipseextension</code> file. A
220 :     product cannot be installed in exactly the same place as another product or extension.</p>
221 :     <p>After installing all files, the top-level structure of the install directory
222 :     would contain the following files and subdirectories (and perhaps others):</p>
223 :     <p><code>&lt;<i>install</i>&gt;/<br>
224 :     &nbsp; <i>acmeproduct</i>.exe<br>
225 :     &nbsp; eclipse/<br>
226 :     &nbsp;&nbsp;&nbsp; .eclipseproduct<br>
227 :     &nbsp; &nbsp; eclipse.exe<br>
228 :     &nbsp; &nbsp; startup.jar<br>
229 :     &nbsp;&nbsp;&nbsp; features/<br>
230 :     &nbsp;&nbsp;&nbsp; plugins/<br>
231 :     &nbsp;&nbsp;&nbsp; jre/<br>
232 :     <br>
233 :     </code>If a product installer solicits license information from the user, such as
234 :     the name of the registered owner and the license key, this information should
235 :     make it into the product &quot;about&quot; dialog (step 10).</p>
236 :     <p>This is done by recording the user responses in the &quot;<code>about.mapping</code>&quot;
237 :     file in the primary feature's plug-in. For example, at <code>&lt;<i>install</i>&gt;/plugins/<i>com.example.acme.acmefeature</i>_<i>1.0.0</i>/about.mapping</code>.
238 :     The &quot;<code>about.mapping</code>&quot; file may be pre-existing in the &lt;<i><code>product
239 :     head</code></i>&gt;
240 :     input, or may need to be created by the installer at install time.
241 :     The keys are numbers; the value of the &quot;<i>n</i>&quot; key is substituted
242 :     for the substring &quot;<code>{<i>n</i>}</code>&quot; in the &quot;<code>aboutText</code>&quot; property.
243 :     For example, if a license key was field number 0, an &quot;<code>about.mapping</code>&quot;
244 :     file containing a line like &quot;<code>0=T42-24T-ME4U-U4ME</code>&quot; should
245 :     be created.</p>
246 :     <p>N.B.
247 :     The &quot;<code>about.mapping</code>&quot; file is a&nbsp; <a href="http://java.sun.com/j2se/1.3/docs/api/java/util/Properties.html">java.io.Properties</a>
248 :     format file (ISO 8859-1 character encoding with "\" escaping).
249 :     When the native character encoding at install time is different from ISO 8859-1,
250 :     the installer is responsible for converting the native character encoding to
251 :     Unicode and for adding &quot;\&quot; escapes where required. Escaping is required
252 :     when the strings contain special characters (such as &quot;\&quot;) or non-Latin characters. For example, field number 1 containing the first 3 letters of the Greek
253 :     alphabet would be written &quot;<code>1=\u03B1\u03B2\u03B3</code>&quot;.</p>
254 :     <p>At step 12, the product installer launches the product executable,<code>&nbsp;&lt;<i>install</i>&gt;/<i>acmeproduct</i>.exe</code>,
255 :     with the special -initialize option [exact details TBD]. This causes the Eclipse platform to quietly
256 :     perform all time-consuming first-time processing and cache the results, so that
257 :     when the user starts the product it comes up promptly in an open-for-business
258 :     state.</p>
259 :     <h3>Uninstaller behavior</h3>
260 :     <p>At uninstall time, the uninstaller should behave in the standard manner:</p>
261 :     <ol>
262 :     <li>warn user to exit all programs, especially the product being uninstalled</li>
263 :     <li>ask user to confirm that the product is to be uninstalled</li>
264 :     <li>remove all installed files from the &lt;<i><code>install</code></i>&gt;
265 :     directory, and <b>all</b> files in &lt;<i><code>install</code></i>&gt;<code>/eclipse/features</code>
266 :     and &lt;<i><code>install</code></i>&gt;<code>/eclipse/plugins</code> including ones put there by parties other than
267 :     this installer (e.g., by the Eclipse update manager)</li>
268 :     <li>remove desktop shortcut for the product executable</li>
269 :     <li>remove entry for product uninstaller</li>
270 :     <li>inform user of any files that were not removed</li>
271 :     </ol>
272 :     <p>When the product is uninstalled, files deposited at
273 :     install time should be deleted, along with updated features and plug-ins created
274 :     by the Eclipse update manager. <b>Important:</b> At uninstall time, there may be
275 :     other directories and files in the <code>&lt;<i>install</i>&gt;</code>
276 :     directory, notably <code>&lt;<i>install</i>&gt;/eclipse/workspace/</code>,
277 :     <code>&lt;<i>install</i>&gt;/eclipse/links/</code>, and <code>&lt;<i>install</i>&gt;/eclipse/platform.cfg</code>,
278 :     that contain important data
279 :     which must be retained when the product is uninstalled. The user must be able to
280 :     uninstall and reinstall a product at the same location without losing important
281 :     data.</p>
282 :     <h3>Installer behavior when product already installed</h3>
283 :     <p>When the product is already installed on the user's computer, the installer
284 :     should allow a service update or version upgrade to be applied to the installed
285 :     product.</p>
286 :     <p>At install time, the installer should behave in the standard manner:</p>
287 :     <ol>
288 :     <li>warn user to exit all programs, especially the product being updated</li>
289 :     <li>locate the installed product to be updated, if necessary by searching the
290 :     disk for an existing product install or by allowing the user to locate it</li>
291 :     <li> determine where this installer is a compatible update</li>
292 :     <li>if appropriate, ask the user for the name of the registered owner and for
293 :     the license key</li>
294 :     <li>display the product's updated licensing agreement and ask the user to accept</li>
295 :     <li>ask user to confirm all details of the update</li>
296 :     <li>update files to disk&nbsp; (see below)</li>
297 :     <li>if required, alter the desktop shortcut to run the product executable</li>
298 :     <li>should add modified or newly added files to the list of ones to be removed at uninstall
299 :     time (where feasible)</li>
300 :     <li>offer to show the product release notes (&quot;readme&quot; file)</li>
301 :     </ol>
302 :     <p>In step 2, an installed product can be recognized by the presence of an &quot;<code>eclipse</code>&quot;
303 :     directory immediately containing a file named &quot;<code>.eclipseproduct</code>&quot;.
304 :     The parent of the &quot;<code>eclipse</code>&quot; directory is a product's install
305 :     directory; i.e., <code>&lt;<i>install</i>&gt;/eclipse/.eclipseproduct</code>.
306 :     The information contained within this marker file should be shown to the user for
307 :     confirmation that the correct product is being updated (there may be several
308 :     Eclipse-based product on the user's computer).</p>
309 :     <p>The installer should perform compatibility checks in step 3 by simple pattern
310 :     matching against subdirectories in the <code>&lt;<i>install</i>&gt;/eclipse/features</code>
311 :     directory. For example, the presence of a folder matching &quot;<code><i>com.example.acme.otherfeature</i>_<i>1.0.1</i></code>&quot;
312 :     would ensure that a certain service update had been applied to the installed
313 :     product.</p>
314 :     <p>For step 7, the installer may delete or replace any of the files that it
315 :     originally installed, and add more files. <b>Important:</b> Several files and directories,
316 :     including <code>&lt;<i>install</i>&gt;/eclipse/workspace/</code>, <code>&lt;<i>install</i>&gt;/eclipse/platform.cfg</code>,
317 :     may be co-located with the install and contain important data files
318 :     which need to be retained
319 :     when the product is upgraded.&nbsp;</p>
320 :     <p>In upgrade situations, there is a good chance that most of the files below <code>&lt;<i>install</i>&gt;/eclipse/plugins/</code>
321 :     are the same (likewise for <code>&lt;<i>install</i>&gt;/eclipse/features/</code>).
322 :     There is significant opportunity for optimization in <code>&lt;<i>install</i>&gt;/eclipse/plugins/</code>
323 :     since the subdirectory name, which embeds the plug-in (or fragment) version
324 :     number, changes if and only iff any of the files below it change. In other
325 :     words, there is no need to touch any files in <code>&lt;<i>install</i>&gt;/eclipse/plugins/org.eclipse.ui_2.0.0</code>/
326 :     if this subdirectory should also exist after the upgrade; if any of the plug-in's
327 :     files were to change, the plug-in's version number is revised, causing the files
328 :     for the upgraded plug-in to be installed in a parallel directory <code>&lt;<i>install</i>&gt;/eclipse/plugins/org.eclipse.ui_2.0.1</code>/.&nbsp;</p>
329 :     <p>Note also that the product executable must not be launched with -initialize
330 :     in the reinstall case, as this would lose important user configuration data.</p>
331 :     <h3>Associating a JRE installed elsewhere</h3>
332 :     <p>The JRE is expected to be located at <code>&lt;<i>install</i>&gt;/eclipse/jre/bin/javaw.exe</code>.
333 :     If it is located elsewhere, the absolute path should be specified using the <code>-vm</code>
334 :     option on the command line; e.g.,<code> -vm <a href="file:///c:/j2jre1.3.0/jre/bin/javaw.exe">C:\j2jre1.3.0\jre\bin\javaw.exe</a></code>.
335 :     In which case, the installer should add this option to the command line of the desktop shortcut
336 :     it creates.</p>
337 :     <h2>Extension installer creation script</h2>
338 :    
339 :     <p>By extension we mean a separately installable set of features and their plug-ins that
340 :     can be associated with, and used from, one ore more Eclipse-based products installed on the
341 :     same computer. In contrast to a product, an extension is not self-contained; an extension does not include
342 :     a product executable, the Eclipse platform, a JRE.</p>
343 :     <p>Without loss of generality, assume that an extension consists of a single
344 :     feature. The first input to the installer creation script is a directory, &lt;<code><i>extension</i></code>&gt;,
345 :     containing its feature and plug-ins. We are assuming that an extension has no
346 :     files that are related to Eclipse; if it did, they would go in <code>&lt;<i>extension</i>&gt;/</code>,
347 :     and not in <code>&lt;<i>extension</i>&gt;/eclipse/</code>. For reference, the skeletal
348 :     structure of this directory would look like:</p>
349 :     <p><code>&lt;<i>extension</i>&gt;/<br>
350 :     &nbsp; eclipse/<br>
351 :     &nbsp; &nbsp; features/<br>
352 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <i>com.example.wiley.anvilfeature</i>_<i>1.0.0</i>/<br>
353 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; feature.xml<br>
354 :     &nbsp; &nbsp; plugins/<br>
355 :     </code>&nbsp; <code>&nbsp;&nbsp;&nbsp;&nbsp; <i>com.example.wiley.anvilfeature</i>_<i>1.0.0</i>/<br>
356 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; plugin.xml<br>
357 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; about.ini<br>
358 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; about.properties<br>
359 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; about.mappings<br>
360 :     </code>&nbsp; <code>&nbsp;&nbsp;&nbsp;&nbsp; <i>com.example.wiley.mainplugin</i>_<i>1.0.0</i>/<br>
361 :     </code>&nbsp; <code>&nbsp;&nbsp;&nbsp;&nbsp; <i>com.example.wiley.otherplugin</i>_<i>1.0.0</i>/
362 :     </code></p>
363 :     <p>The exact contents of the &lt;<i><code>extension</code></i>&gt; input
364 :     directory determines what files
365 :     will eventually be installed on the end user's computer.</p>
366 :     <p>The final inputs to the installer creation script are the id and version
367 :     strings for the extension's feature; e.g., &quot;<i><code>com.example.wiley.anvil</code></i>&quot;
368 :     and &quot;<code><i>1.0.0</i></code>&quot;. These strings have special
369 :     significance to the installer, appearing in file and directory names, and in the
370 :     contents of marker files created at install time.</p>
371 :     <p>An extension installer is similar to a product installer in most respects.
372 :     The areas where it differs are highlighted below:</p>
373 :     <p>At install time, the installer behaves in the standard manner:</p>
374 :     <ol>
375 :     <li>warn user to exit all programs</li>
376 :     <li>introduce the extension to be installed</li>
377 :     <li>if appropriate, ask the user for the name of the registered owner and for
378 :     the license key</li>
379 :     <li>display the extension's licensing agreement and ask the user to accept</li>
380 :     <li>recommend a location on the disk to install the extension (but allow user to
381 :     override this default)</li>
382 :     <li>check that a product or a different extension is not already stored at the specified
383 :     location</li>
384 :     <li> ask user which product(s) to are to use this extension (search disk;
385 :     browse; or skip)
386 :     </li>
387 :     <li>optionally, determine if extension is compatible with selected products</li>
388 :     <li>ask user to confirm all details of the install</li>
389 :     <li>create marker file to mark root of extension install</li>
390 :     <li>copy files to disk&nbsp; (see below)</li>
391 :     <li>insert name of registered owner and license key into the &quot;about
392 :     &quot; description</li>
393 :     <li>create an appropriate entry to allow the user to uninstall the extension</li>
394 :     <li>write link file in each of the selected products to associate extension
395 :     with product</li>
396 :     <li>offer to show the extension release notes (&quot;readme&quot; file)</li>
397 :     </ol>
398 :     <p>If the location specified in step 5 is &lt;<code><i>install</i></code>&gt;,
399 :     the installer copies all the files in the <code>&lt;<i>extension</i>&gt; </code>directory
400 :     into &lt;<code><i>install</i></code>&gt; in step 11.</p>
401 :     <table border="1" width="50%">
402 :     <tr>
403 :     <td width="50%">Input file</td>
404 :     <td width="50%">Installed file</td>
405 :     </tr>
406 :     <tr>
407 :     <td width="50%"><code>&lt;<i>extension</i>&gt;/*</code></td>
408 :     <td width="50%"><code>&lt;<i>install</i>&gt;/*</code></td>
409 :     </tr>
410 :     </table>
411 :     <p>For step 7, any Eclipse product might be a candidate. Eclipse-based product
412 :     can be recognized by the presence of a <code>&lt;<i>product install</i>&gt;/eclipse/.eclipseproduct</code>
413 :     file; the user should be able to request a limited disk search for installed
414 :     products (a &quot;search for installed products&quot; button), or would navigate
415 :     to a directory containing a product (i.e., a &quot;browse&quot; button).</p>
416 :     <p>The installer should perform compatibility checks in step 8 by simple pattern
417 :     matching against subdirectories in the <code>&lt;<i>product install</i>&gt;/eclipse/features</code>
418 :     directory. For example, the presence of a folder matching &quot;<code>org.eclipse.jdt_2.*</code>&quot;
419 :     means that JDT is included in the installed product.&nbsp;</p>
420 :     <p>The marker file created in step 10 is <code>&lt;<i>install</i>&gt;/eclipse/.eclipseextension</code>
421 :     is used to mark a directory into which an Eclipse-based extension has been
422 :     installed, primarily for extension installers to locate
423 :     (analogous to a product's <code>.eclipseproduct</code> marker file). This
424 :     marker file is a <a href="http://java.sun.com/j2se/1.3/docs/api/java/util/Properties.html">java.io.Properties</a>
425 :     format file (ISO 8859-1 character encoding with &quot;\&quot; escaping) and
426 :     contains the following information that identifies the extension to the user and distinguishes
427 :     one Eclipse-based extension from one another:</p>
428 :     <blockquote>
429 :     <p><code>name=<i>Wiley Anvil Enterprise Edition</i><br>
430 :     id=<i>com.example.wiley.anvilfeature<br>
431 :     </i>version=<i>1.0.0</i></code></p>
432 :     </blockquote>
433 :     <p>The values of the &quot;id&quot; and &quot;version&quot; property are inputs
434 :     to the installer creation script; the name of the extension is presumably known
435 :     and hard-wired. (Products would not ordinarily access this marker file; only
436 :     product and extension installers write or read it.)</p>
437 :     <p>After installing all files, the top-level structure of the install directory
438 :     would contain the following files and subdirectories:</p>
439 :     <p><code>&lt;<i>install</i>&gt;/<br>
440 :     &nbsp; eclipse/<br>
441 :     &nbsp; &nbsp; .eclipseextension<br>
442 :     &nbsp;&nbsp;&nbsp; features/<br>
443 :     &nbsp;&nbsp;&nbsp; plugins/</code></p>
444 :     <p>The only significant difference from a product installer is that an extension
445 :     installer also creates link files in other Eclipse-based products already
446 :     installed on the user's computer. (This saves the user from having to manually
447 :     associate the new extension from within each product using the Eclipse update
448 :     manager.)&nbsp;</p>
449 :     <p>The link file created in step 14 is <code>&lt;<i>product install</i>&gt;/eclipse/links/<i>com.example.wiley.anvilfeature.</i>link</code>;
450 :     that is, the file has the same name of as the extension's feature directory less
451 :     the version number suffix. A link file is a <a href="http://java.sun.com/j2se/1.3/docs/api/java/util/Properties.html">java.io.Properties</a>
452 :     format file (ISO 8859-1 character encoding with "\" escaping).
453 :     The key is &quot;path&quot; and the value is the absolute path of the installed
454 :     extension, <code>&lt;<i>install</i>&gt;</code>; e.g., an entry might looks like &quot;<code>path=<a href="file:///c:/Program">C:\\Program</a>
455 :     Files\\Wiley\\Anvil</code>&quot;<code>.</code> The installer is responsible for converting
456 :     from native character
457 :     encoding to Unicode and adding &quot;\&quot; escapes where required. Escaping is
458 :     usually required since <code>&lt;<i>install</i>&gt;</code>
459 :     typically contains special characters (such as &quot;\&quot;)
460 :     and may mention directories with non-Latin characters in their names. The product reads
461 :     link files when it starts up. The installer keeps a record of any link
462 :     files it creates so that they can be located when the extension is updated or
463 :     uninstalled.</p>
464 :     <h3>Uninstaller behavior</h3>
465 :     <p>At un install time, the un installer should behave in the standard manner:</p>
466 :     <ol>
467 :     <li>warn user to exit all programs, especially products using the extension
468 :     being uninstalled</li>
469 :     <li>ask user to confirm that the extension is to be un installed</li>
470 :     <li>remove all installed files from the &lt;<i><code>install</code></i>&gt;
471 :     directory, and <b>all</b> files in &lt;<i><code>install</code></i>&gt;<code>/eclipse/features</code>
472 :     and &lt;<i><code>install</code></i>&gt;<code>/eclipse/plugins</code> including ones put there by parties other than
473 :     this installer (e.g., by the Eclipse update manager)</li>
474 :     <li>if feasible, remove the link file from any products to which it had been
475 :     added&nbsp;</li>
476 :     <li>remove entry for extension uninstaller</li>
477 :     <li>inform user of any files that were not removed</li>
478 :     </ol>
479 :     <p>When an extension is uninstalled, all plug-in and feature files should be deleted; there are no
480 :     important data files to be kept in these subdirectories. This allows the user to uninstall an extension
481 :     completely, including any updates applied by the Eclipse update manager.</p>
482 :     <h3>Installer behavior when extension already installed</h3>
483 :     <p>When the extension is already installed on the user's computer, the installer
484 :     should allow a service update or version upgrade to be applied to the installed
485 :     extension.</p>
486 :     <p>At install time, the installer should behave in the standard manner:</p>
487 :     <ol>
488 :     <li>warn user to exit all programs, especially products using the extension
489 :     being updated</li>
490 :     <li>locate the installed extension to be updated, if necessary by searching
491 :     the disk for an existing extension install or by allowing the user to locate
492 :     it</li>
493 :     <li> determine where this installer is a compatible update</li>
494 :     <li>if appropriate, ask the user for the name of the registered owner and for
495 :     the license key</li>
496 :     <li>display the product's updated licensing agreement and ask the user to accept</li>
497 :     <li>ask user to confirm all details of the update</li>
498 :     <li>update files on disk&nbsp; (see below)</li>
499 :     <li>should add modified or newly added files to the list of ones to be removed at uninstall
500 :     time (where feasible)</li>
501 :     <li>offer to show the extension release notes (&quot;readme&quot; file)</li>
502 :     </ol>
503 :     <p>In step 2, an installed extension can be recognized by the presence of an &quot;<code>eclipse</code>&quot;
504 :     directory immediately containing a file named &quot;<code>.eclipseextension</code>&quot;.
505 :     The parent of the &quot;<code>eclipse</code>&quot; directory is an extension's install
506 :     directory; i.e., <code>&lt;<i>install</i>&gt;/eclipse/.eclipseextension</code>.
507 :     The information contained within this marker file should be shown to the user for
508 :     confirmation that the correct extension is being updated (there may be several
509 :     Eclipse-based extension on the user's computer).</p>
510 :     <p>For step 7, the installer should not delete or overwrite any of the files
511 :     that it originally installed; rather, it should only add the files for new
512 :     versions of features and plug-in, and possibly rewrite the marker file <code>&lt;<i>install</i>&gt;/eclipse/.eclipseextension</code>. Leaving the old versions around gives the user
513 :     the option to back out of the update. As with upgrading a product install, there
514 :     is no need to touch any files in <code>&lt;<i>install</i>&gt;/eclipse/plugins/<i>com.example.wiley.otherplugin</i>_<i>1.0.0</i></code>/
515 :     if this subdirectory should also exist after the upgrade; if any of the plug-in's
516 :     files were to change, the plug-in's version number is revised, causing the files
517 :     for the upgraded plug-in to be installed in a parallel directory <code>&lt;<i>install</i>&gt;/eclipse/plugins/<i>com.example.wiley.otherplugin</i>_<i>1.0.1</i></code>/.&nbsp;</p>
518 :    
519 :     </body>
520 :    
521 :     </html>