Web Start Install Wizard SDK Tutorial

Topic: Creating and Using Custom Install Wizards


CONTENTS

  1. Introduction: Custom Install Wizards

  2. The Basics

  3. Putting It All Together

  4. Step-by-Step Install Wizards Example

  5. Conclusion


    1. Introduction: Custom Install Wizards

    This tutorial covers the basic ideas behind custom install wizards, and how to write custom panels that interact with custom ServerObjects and custom Tasks to accomplish things. It is assumed that you have a basic understanding of Web Start Wizards, and their purpose.

    2. The Basics

    In order to create a custom panel, your panel must inherit from WizardLeaf, the common superclass for all wizard panels. Your panel must also override certain methods to draw its GUI, and interact with the rest of the system (much as a java.awt.Panel might override paint() to draw itself).

    The "interaction" metioned above involves your panel interacting with ServerObjects and Tasks to perform their tasks. For example, if your custom panel reads in a file and presents it to the user, you would write a ServerObject to read in the file, and have your panel communicate with the ServerObject to read the file and present it to the user. Why is this necessary? Why not just read the file using java code written in the panel? The answer is that wizards were designed to be client/server. The user interaction takes place on the client, and then the client subsequently interacts with the server to actually perform tasks. The client and server are completely separate entities, even if they are executing on the same computer.

    Currently, when a Web Start Wizard is executed, the client and server exist on the same computer that the wizard is run on. However, in the future, wizards might be "remote-enabled", meaning the client and server might not exist on the same computer. Rather, they will exist separately and communicate via the underlying network. It is strongly recommended that you keep your client code (i.e. the code in your panel class) separate from the server code (i.e. The code that interacts with the underlying system), so that in the future your wizard will run remotely, with no additional work.

    3. Putting it all together

    The builder is a class that you run in order to build a wizard archive. See The Wizard Archive Builder for more information on builders. In your builder, you instantiate and configure the pieces that make up the wizard, and then write them out to a wizard archive. The resulting archive is then runnable and represents your wizard.

    In order for your custom Panels, Tasks, and ServerObjects to be available at runtime, you must write your builder to include them. In addition, your panel class definition must declare certain constructors in order to work with the underlying wizard architecture.

    4. Step-by-Step Install Wizards Example

    This example builds a complete install wizard, inserting our CustomPanel into the wizard sequence just before the WelcomePanel. The Custom Panel asks the user for a filename. It then uses a ServerObject to see if that file exists, and if it does, runs a Sequence which contains a Task which does nothing (remember, this is an example). While the sequence runs, the progress is reported. When the Sequence is done, the next panel is visited automatically.

    5. Conclusion

    This tutorial covered the basic ideas behind custom install wizards, and how to write custom panels that interact with custom ServerObjects and custom Tasks to accomplish things. This idea can be extended to perform any task or other function while interacting with the user.

    This concludes this Custom Wizard Tutorial. For more information on creating wizards for Solaris, please visit our website at www.sun.com/solaris/webstart/wizards/.