Statistics
| Revision:

svn-gvsig-desktop / tags / v2_0_Build_1217 / install / IzPack / src / tutorial / izpack-tutorial.tex @ 44029

History | View | Annotate | Download (16.9 KB)

1
% ............................................................................ %
2

    
3
\documentclass[compress,10pt]{beamer}
4

    
5
\mode<presentation>
6
{
7
  \usetheme{Darmstadt}
8
  \usefonttheme{professionalfonts}
9
  \setbeamercovered{transparent}
10
}
11

    
12
\usepackage[english]{babel}
13
\usepackage[latin1]{inputenc}
14

    
15
\usepackage{graphicx}
16
\usepackage{url}
17
\usepackage{pgf}
18

    
19
% ............................................................................ %
20

    
21
\title{The IzPack tutorial}
22

    
23
\subtitle{Getting started with a basic installer for your software.}
24

    
25
\author{Julien~Ponge\inst{1}}
26

    
27
\institute
28
{
29
  \inst{1}%
30
  \texttt{<julien@izforge.com>}\\
31
  \url{http://www.izforge.com/}\\
32
  IzPack project founder and current maintainer.
33
}
34

    
35
\date{\today}
36

    
37
\pgfdeclareimage[height=0.5cm]{logo}{logo}
38
\logo{\pgfuseimage{logo}}
39

    
40
\setbeamertemplate{footline}[frame number]
41
\setbeamertemplate{navigation symbols}{}
42
\setbeamertemplate{background canvas}[vertical shading][top=blue!10,bottom=white]
43

    
44
\pgfdeclareimage[width=1.5cm,interploate=true]{cc}{cc}
45
\pgfdeclareimage[width=3cm,interpolate=true]{tree-view}{tree-view}
46

    
47
\pgfdeclareimage[width=9cm,interpolate=true]{panel-hello}{panel-hello}
48
\pgfdeclareimage[width=9cm,interpolate=true]{panel-info}{panel-info}
49
\pgfdeclareimage[width=9cm,interpolate=true]{panel-license}{panel-license}
50
\pgfdeclareimage[width=9cm,interpolate=true]{panel-packs}{panel-packs}
51
\pgfdeclareimage[width=9cm,interpolate=true]{panel-target}{panel-target}
52
\pgfdeclareimage[width=9cm,interpolate=true]{panel-install}{panel-install}
53
\pgfdeclareimage[width=9cm,interpolate=true]{panel-finish}{panel-finish}
54

    
55
\AtBeginSubsection[]
56
{
57
  \begin{frame}<beamer>
58
    \frametitle{Outline}
59
    \tableofcontents[currentsection,currentsubsection]
60
  \end{frame}
61
}
62

    
63
% ............................................................................ %
64

    
65
\begin{document}
66

    
67
% ............................................................................ %
68

    
69
\begin{frame}
70
  \titlepage
71
\end{frame}
72

    
73
% ............................................................................ %
74

    
75
\begin{frame}[plain]
76

    
77
\footnotesize
78

    
79
\href{http://www.creativecommons.org/}{\pgfuseimage{cc}}
80

    
81
\vspace{2em}
82

    
83
Copyright \copyright~2004, 2005 Julien \textsc{Ponge} - All Rights Reserved.
84

    
85
\vspace{2em}
86
\sloppy
87
This work is licensed under the \textit{Creative Commons
88
Attribution - NonCommercial - ShareAlike License}. To view a copy of this license,
89
visit
90
\href{http://creativecommons.org/licenses/by-nc-sa/2.0/}{\url{http://creativecommons.org/licenses/by-nc-sa/2.0/}}
91
or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford,
92
California 94305, USA.
93

    
94
\end{frame}
95

    
96
% ............................................................................ %
97

    
98
\begin{frame}
99
  \frametitle{Outline}
100
  \tableofcontents
101
\end{frame}
102

    
103
% ............................................................................ %
104

    
105
\section{Introduction}
106

    
107
% ............................................................................ %
108

    
109
\subsection{The IzPack project}
110

    
111
% ................................... %
112

    
113
\begin{frame}
114

    
115
\frametitle{IzWhat ?}
116

    
117
Fast facts:
118
  \begin{itemize}
119
    \item An open-sourced Java\texttrademark~-based cross-platform installer
120
    generator.
121

    
122
    \item Published under the GNU GPL license.
123

    
124
    \item Project started in 2001 by myself, now developed with the help of
125
    several developers and contributors (\texttt{Thanks.txt} contains about 90
126
    lines).
127

    
128
    \item Used by various companies and projects around the world (see the
129
    \href{http://www.izforge.com/izpack/index.php?page=references}{references
130
    page}.
131

    
132
    \item Available for about 22 languages.
133

    
134
    \item One of the most active projects at
135
    \href{http://www.berlios.de/}{BerliOS}.
136
  \end{itemize}
137

    
138
\end{frame}
139

    
140
% ................................... %
141

    
142
\begin{frame}
143

    
144
\frametitle{Features}
145

    
146
\begin{itemize}
147

    
148
  \item Cross-platform (tested on Win32, Mac OS X, Linux/i386 and FreeBSD/i386).
149

    
150
  \item XML-based, modular and extensible (you choose what your installer will
151
  be made of).
152

    
153
  \item Integrates with Jakarta Ant.
154

    
155
  \item Can create shortcuts for Win32 and X11 (FreeDesktop.org-compliant
156
  environments and window managers).
157

    
158
  \item Not dependent on native code (but can use it in a smart way).
159

    
160
  \item Creates uninstallers.
161

    
162
  \item Can get user input, substitute tokens in files, call scripts and much
163
  more...
164

    
165
\end{itemize}
166

    
167
\end{frame}
168

    
169
% ................................... %
170

    
171
\begin{frame}
172

    
173
\frametitle{Project life}
174

    
175
\begin{itemize}
176

    
177
  \item Online resources:
178
    \begin{itemize}
179
      \item hosted on my website at
180
      \href{http://www.izforge.com/izpack/}{\url{http://www.izforge.com/izpack/}}
181

    
182
      \item \href{http://www.berlios.de/}{BerliOS} hosts the developer tools
183
      (CVS, SVN, bugs tracking, wiki, mailing-lists, file releases, FTP, ...).
184
    \end{itemize}
185

    
186
    \item The development is very open and contributions are always welcome.
187

    
188
    \item Major releases (ex: $3.7.x$) are maintained in branches while the
189
    development occurs in \texttt{CVS HEAD}.
190

    
191
    \item Minor releases occur depending on fixes inclusion.
192

    
193
    \item Major releases happen depending on new features inclusion.
194

    
195
\end{itemize}
196

    
197
\end{frame}
198

    
199
% ............................................................................ %
200

    
201
\subsection{Technical overview}
202

    
203
\begin{frame}
204

    
205
\frametitle{IzPack}
206

    
207
\begin{columns}
208

    
209
  \begin{column}{6.5cm}
210
  \begin{itemize}
211

    
212
    \item An installer is described by an \textsl{XML installation file} that:
213
      \begin{itemize}
214
        \item arranges files into \textsl{packs}
215
        \item can be customized by some resources (depending on what you choose).
216
      \end{itemize}
217

    
218
    \item The compiler takes the XML file as its input to build an installer as
219
    an \textsl{executable Jar} archive.
220

    
221
  \end{itemize}
222
  \end{column}
223

    
224
  \begin{column}{4cm}
225
  \includegraphics[width=4cm,angle=270]{izpack-overview}
226
  \end{column}
227

    
228
\end{columns}
229

    
230
\end{frame}
231

    
232
% ................................... %
233

    
234
\begin{frame}
235

    
236
\frametitle{Installers}
237

    
238
\begin{columns}
239

    
240
  \begin{column}{6.5cm}
241
  \begin{itemize}
242

    
243
    \item An installer contains:
244
      \begin{itemize}
245
        \item the real files in packs
246
        \item the langpacks.
247
      \end{itemize}
248

    
249
    \item An installer offers a set of panels that define the steps to perform
250
    an installation.
251

    
252
    \item Resources can be needed by panels and GUI preferences can change the
253
    look depending on the OS (size, L\&F, ...).
254

    
255
  \end{itemize}
256
  \end{column}
257

    
258
  \begin{column}{4cm}
259
  \includegraphics[width=4cm,angle=270]{installers-overview}
260
  \end{column}
261

    
262
\end{columns}
263

    
264
\end{frame}
265

    
266
% ............................................................................ %
267

    
268
\section{Making an installer}
269

    
270
% ............................................................................ %
271

    
272
\subsection{Preliminary steps}
273

    
274
\begin{frame}
275

    
276
\frametitle{Laying out the files and folders}
277

    
278
\begin{columns}
279

    
280
  \begin{column}{7cm}
281
  \begin{itemize}
282

    
283
    \item Put your files in a folder. Try to make it easy to split the
284
    files tree into packs (for instance put the files of a pack into a small set
285
    of subfolders).
286

    
287
    \item Think about which files and folders your packs will be made of.
288

    
289
    \item Decide which packs will be mandatory and which packs will be optional.
290

    
291
  \end{itemize}
292
  \end{column}
293

    
294
  \begin{column}{3cm}
295
  \pgfuseimage{tree-view}
296
  \end{column}
297

    
298
\end{columns}
299

    
300
\end{frame}
301

    
302
% ................................... %
303

    
304
\begin{frame}
305

    
306
\frametitle{Installation panels flow}
307

    
308
\begin{itemize}
309

    
310
  \item Panels define the installation steps. Several panels are available, some
311
  even do the same functional task.
312
  \alert{You decide which panels you want and in which order.}
313

    
314
  \item For this tutorial, we will use the following panels:
315
    \begin{enumerate}
316

    
317
      \item \textsl{HelloPanel}: welcome our user to the installation process
318

    
319
      \item \textsl{HTMLInfoPanel}: display some informations with a structured
320
      text
321

    
322
      \item \textsl{LicencePanel}: the legal terms that must be agreed to reach
323
      the next installation steps
324

    
325
      \item \textsl{PacksPanel}: allow the user to pick the packs that she/he wants
326
      to install or not
327

    
328
      \item \textsl{TargetPanel}: choose where to install the files
329

    
330
      \item \textsl{InstallPanel}: performs the actual files installation
331

    
332
      \item \textsl{SimpleFinishPanel}: conclude the installation with a success.
333

    
334
    \end{enumerate}
335

    
336
\end{itemize}
337

    
338
\end{frame}
339

    
340
% ................................... %
341

    
342
\begin{frame}
343

    
344
\frametitle{Panels flow illustrated}
345

    
346
\begin{overprint}
347

    
348
  \onslide<1>\textsl{HelloPanel}\\
349
  
350
  \pgfuseimage{panel-hello}
351
  
352
  \onslide<2>\textsl{HTMLInfoPanel}\\
353
  
354
  \pgfuseimage{panel-info}
355
  
356
  \onslide<3>\textsl{LicencePanel}\\
357
  
358
  \pgfuseimage{panel-license}
359
  
360
  \onslide<4>\textsl{PacksPanel} (here \textit{ImgPacksPanel})\\
361
  
362
  \pgfuseimage{panel-packs}
363
  
364
  \onslide<5>\textsl{TargetPanel}\\
365
  
366
  \pgfuseimage{panel-target}
367
  
368
  \onslide<6>\textsl{InstallPanel}\\
369
  
370
  \pgfuseimage{panel-install}
371
  
372
  \onslide<7>\textsl{SimpleFinishPanel}\\
373
  
374
  \pgfuseimage{panel-finish}
375

    
376
\end{overprint}
377

    
378
\end{frame}
379

    
380
% ............................................................................ %
381

    
382
\subsection{Creating the installation files}
383

    
384
\begin{frame}[containsverbatim]
385

    
386
\frametitle{Basic installation XML file canvas}
387

    
388
Here is a global view of what our file will look like:
389

    
390
\begin{block}{\texttt{MyApp-install.xml}}
391
\small
392
\begin{verbatim}
393
<installation version="1.0">
394

    
395
    <info> (...) </info>
396
    <guiprefs (...)> (...) </guiprefs>
397
    <locale> (...) </locale>
398
    <resources> (...) </resources>
399
    <panels> (...) </panels>
400
    <packs> (...) </packs>
401

    
402
</installation>
403
\end{verbatim}
404
\end{block}
405

    
406
\end{frame}
407

    
408
% ................................... %
409

    
410
\begin{frame}[containsverbatim]
411

    
412
\frametitle{Global informations}
413

    
414
We will specify here:
415
  \begin{itemize}
416
      \item the authors of the application to install
417
      \item the application name, version and url
418
      \item the minimum Java\texttrademark~ version required (optional).
419
  \end{itemize}
420

    
421
\begin{block}{The \textsl{info} section}
422
\tiny
423
\begin{verbatim}
424
<info>
425
    <appname>MyApp</appname>
426
    <appversion>1.2.3</appversion>
427
    <authors>
428
        <author name="Snoopy" email="snoopy@myapp.org" />
429
        <author name="Foo Bar" email="foo@bar.org" />
430
    </authors>
431
    <url>http://www.myapp.org/</url>
432
    <javaversion>1.4</javaversion>
433
</info>
434
\end{verbatim}
435
\end{block}
436

    
437
\end{frame}
438

    
439
% ................................... %
440

    
441
\begin{frame}[containsverbatim]
442

    
443
\frametitle{GUI tweakings}
444

    
445
\begin{itemize}
446

    
447
  \item We can customise the default size.
448

    
449
  \item We can specify a Look \& Feel for a given OS, including:
450
    \begin{itemize}
451
      \item Metal (hum hum ...)
452
      \item Kunststoff, Metouia, Liquid
453
      \item JGoodies variants.
454
    \end{itemize}
455

    
456
  \item The default is to pick the native emulation L\&F.
457

    
458
\end{itemize}
459

    
460
\begin{block}{The \textsl{guiprefs} section}
461
\tiny
462
\begin{verbatim}
463
<guiprefs height="600" resizable="yes" width="800">
464
    <laf name="metouia">
465
        <os family="unix" />
466
    </laf>
467
</guiprefs>
468
\end{verbatim}
469
\end{block}
470

    
471
\end{frame}
472

    
473
% ................................... %
474

    
475
\begin{frame}[containsverbatim]
476

    
477
\frametitle{Choosing the available languages}
478

    
479
This step is quite easy. Just pick the ISO3 codes among the available languages,
480
for instance:
481

    
482
\begin{block}{The \textsl{locale} section}
483
\tiny
484
\begin{verbatim}
485
<locale>
486
    <langpack iso3="eng"/>
487
    <langpack iso3="fra"/>
488
    <langpack iso3="deu"/>
489
    <langpack iso3="ita"/>
490
    <langpack iso3="jpn"/>
491
    <langpack iso3="spa"/>
492
</locale>
493
\end{verbatim}
494
\end{block}
495

    
496
\end{frame}
497

    
498
% ................................... %
499

    
500
\begin{frame}[containsverbatim]
501

    
502
\frametitle{Including the needed resources}
503

    
504
\begin{itemize}
505

    
506
  \item Each panel needs resources (see the IzPack documentation). A resource
507
  associates a path to a file and an identifier.
508

    
509
  \item Here, we have the following resources:
510
    \begin{itemize}
511
      \item the text for \textsl{HTMLInfoPanel}
512
      \item the legal terms for \textsl{LicencePanel}
513
      \item an optional picture for the language selection box.
514
    \end{itemize}
515

    
516
\end{itemize}
517

    
518
\begin{block}{The \textsl{resources} section}
519
\tiny
520
\begin{verbatim}
521
<resources>
522
    <res src="install-readme.html" id="HTMLInfoPanel.info"/>
523
    <res src="Licence.txt" id="LicencePanel.licence"/>
524
    <res src="langsel.jpg" id="installer.langsel.img"/>
525
</resources>
526
\end{verbatim}
527
\end{block}
528

    
529
\end{frame}
530

    
531
% ................................... %
532

    
533
\begin{frame}[containsverbatim]
534

    
535
\frametitle{Specifying the panels}
536

    
537
Simply put the panels names in the obvious order:
538

    
539
\begin{block}{The \textsl{panels} section}
540
\tiny
541
\begin{verbatim}
542
<panels>
543
    <panel classname="HelloPanel"/>
544
    <panel classname="HTMLInfoPanel"/>
545
    <panel classname="LicencePanel"/>
546
    <panel classname="PacksPanel"/>
547
    <panel classname="TargetPanel"/>
548
    <panel classname="InstallPanel"/>
549
    <panel classname="SimpleFinishPanel"/>
550
</panels>
551
\end{verbatim}
552
\end{block}
553

    
554
\end{frame}
555

    
556
% ................................... %
557

    
558
\begin{frame}[containsverbatim]
559

    
560
\frametitle{Making the packs}
561

    
562
\begin{itemize}
563

    
564
  \item We use the smart Ant filesets syntax to pick the files contained in 
565
  each pack.
566

    
567
  \item Target directories are specified. \alert{\texttt{\small\$INSTALL\_PATH}
568
  identifies the path chosen from \textsl{TargetPanel}}.
569

    
570
\end{itemize}
571

    
572
\begin{block}{The \textsl{packs} section}
573
\tiny
574
\begin{verbatim}
575
<packs>
576
    <pack name="Core" required="yes">
577
        <description>MyApp core files.</description>
578
        <fileset dir="" targetdir="$INSTALL_PATH">
579
          <include name="*.txt" />
580
          <include name="bin/**/*" />
581
          <include name="lib/**/*" />
582
        </fileset>
583
    </pack>
584
    (...)
585
</packs>
586
\end{verbatim}
587
\end{block}
588

    
589
\end{frame}
590

    
591
% ............................................................................ %
592

    
593
\subsection{Building the installer}
594

    
595
\begin{frame}
596

    
597
\frametitle{Ant integration}
598

    
599
\begin{itemize}
600

    
601
  \item Ant is perfect for software tasks automation.
602

    
603
  \item IzPack can be integrated with Ant in a simple and elegant manner.
604

    
605
  \item IzPack needs the following informations (the same holds true for a
606
  command-line invocation):
607
    \begin{itemize}
608
      \item the input installation XML file
609

    
610
      \item the name of the output installer Jar file
611

    
612
      \item the kind of installer (standard or web-based)
613

    
614
      \item the base directory, to resolve the relative paths specified for the
615
      various files of the XML installation file (files, resources, ...)
616

    
617
      \item the directory where IzPack is installed.
618
    \end{itemize}
619

    
620
\end{itemize}
621

    
622
\end{frame}
623

    
624
% ................................... %
625

    
626
\begin{frame}[containsverbatim]
627

    
628
\frametitle{Calling IzPack from Ant}
629

    
630
\begin{alertblock}{Warning}
631
Make the IzPack compiler jar available in the classpath before you call Ant.
632
\end{alertblock}
633

    
634
\begin{block}{Make the task available}
635
\tiny
636
\begin{verbatim}
637
<taskdef name="izpack" classpath="${izpack.dir}/lib/compiler.jar"
638
         classname="com.izforge.izpack.ant.IzPackTask"/>
639
\end{verbatim}
640
\end{block}
641

    
642
\begin{block}{Call the IzPack task}
643
\tiny
644
\begin{verbatim}
645
<izpack input="MyApp-install.xml"
646
        output="${dist.dir}/MyApp-install-${ver}.${rel}.jar"
647
        installerType="standard" basedir="${dist.dir}"
648
        izPackDir="${izpack.dir}/"/>
649
\end{verbatim}
650
\end{block}
651

    
652
\end{frame}
653

    
654
% ............................................................................ %
655

    
656
\section{Conclusion}
657

    
658
\begin{frame}
659

    
660
\frametitle{Summary}
661

    
662
\begin{itemize}
663

    
664
  \item You have now made a simple installer for your application. You should
665
  now feel more confident with IzPack, however you can get much more from it.
666

    
667
  \item You can now try some more advanced features (such as desktop shortcuts
668
  generation or scripts token replacement) or play with some other panels as
669
  well.
670

    
671
  \item The following resources will be of a great help:
672
  \begin{itemize}
673

    
674
    \item the IzPack documentation
675

    
676
    \item the \href{http://openfacts.berlios.de/index-en.phtml?title=IzPack}{
677
    wiki} at BerliOS
678

    
679
    \item the \href{http://developer.berlios.de/mail/?group_id=1408}{
680
    mailing-lists archives}
681

    
682
    \item real-life examples (such as IzPack itself or open-source projects that
683
    use it).
684

    
685
  \end{itemize}
686

    
687
\end{itemize}
688

    
689
\end{frame}
690

    
691
\begin{frame}
692

    
693
\frametitle{Supporting IzPack}
694

    
695
If IzPack is useful to you and/or your company, please consider supporting it
696
financially. Just think about how expensive are its proprietary competitors...
697

    
698
\begin{itemize}
699

    
700
  \item I accept donations through PayPal with my email address
701
  \small{\url{julien@izforge.com}}.
702

    
703
  \item Missing a feature ? Then you can offer a bounty to an IzPack developer
704
  for implementing it. Ask for the feature and see if a developer wants to make
705
  it for a donation that you can negotiate at your own discretion with her/him.
706

    
707
\end{itemize}
708

    
709
\end{frame}
710

    
711
\begin{frame}
712

    
713
\frametitle{Credits}
714

    
715
\begin{itemize}
716

    
717
  \item The \href{http://latex-beamer.sf.net/}{\LaTeX~Beamer} class.
718

    
719
  \item The \href{http://www.berlios.de/}{BerliOS} crew.
720

    
721
  \item The numerous past and present IzPack developers and contributors.
722

    
723
\end{itemize}
724

    
725
\end{frame}
726

    
727
% ............................................................................ %
728

    
729
\end{document}
730

    
731