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

Parent Directory Parent Directory | Revision Log Revision Log


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

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