Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Creating an installer for my RCP app
Creating an installer for my RCP app [message #437672] Fri, 30 September 2005 21:19 Go to next message
Duncan Krebs is currently offline Duncan KrebsFriend
Messages: 79
Registered: July 2009
Member
Hi,
A while back I remember reading an article linked off RCP resources that
explained how to create an installer for an RCP app. I can't seem to find
that article but remember that it used an external java based install
program. Does anyone know what the name of the framework/project that does
this?
Re: Creating an installer for my RCP app [message #437674 is a reply to message #437672] Sat, 01 October 2005 08:33 Go to previous messageGo to next message
udayms is currently offline udaymsFriend
Messages: 23
Registered: July 2009
Junior Member
Hi,
Why dont you use Webstart?
-Uday
Re: Creating an installer for my RCP app [message #437675 is a reply to message #437674] Sat, 01 October 2005 09:06 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
Java WebStart disables a number of pieces of functionality from RCP applications, including but not limited to) killing the help server, and not being able to use Eclipse's own update mechanism for managing configurations.

SourceForge hosts a number of them:

http://sourceforge.net/search/?type_of_search=soft&exact =1&forum_id=0&group_id=0&atid=0&words=instal ler+java&Search=Search

There are also some open-source ones for Windows installers only:

http://nsis.sourceforge.net/

Of course, it's difficult to know which article you read but that should be a start to see if anything jogs your memory :-)
Re: Creating an installer for my RCP app [message #437681 is a reply to message #437675] Sat, 01 October 2005 17:53 Go to previous messageGo to next message
Ed Burnette is currently offline Ed BurnetteFriend
Messages: 279
Registered: July 2009
Senior Member
See also http://www.eclipsezone.com/files/presentations/EclipseCon200 5_6.2.zip . This contains slides and examples from an EclipseCon2005 presentation I did on creating an installer for an RCP app.

--Ed
http://www.eclipsezone.com
Re: Creating an installer for my RCP app [message #437688 is a reply to message #437681] Sun, 02 October 2005 06:00 Go to previous messageGo to next message
udayms is currently offline udaymsFriend
Messages: 23
Registered: July 2009
Junior Member
Ed,
What are your views on Alex's comments? I am asking this as my team has decided on webstart as installer for our rcp app. I just want to make sure if thats an OK decision.

Alex,
Is it possible for you to list out other disadvantages of webstart/rcp combination?

-Uday
Re: Creating an installer for my RCP app [message #437692 is a reply to message #437688] Sun, 02 October 2005 15:22 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
Since Java WebStart requires plugins to be shipped as packed Jars, it's only possible to use those that are packed. Not all of them (in the 3.1 distribution) are packed; open up Eclipse\plugins to see which are which. Directories represent unpacked plugins, Jars represent packed plugins. You can only use the packed ones in a Java WebStart app.

The documentation on using Java WebStart covers the information you're looking for:

http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/java_web_start.htm

Specifically, regarding limitations:

Known limitations
---------------
o Eclipse Update and Java Web Start technologies can work together but under the following restrictions: plug-ins installed by Java Web Start can not be updated by Update and vice-versa. Features and plug-ins installed by Java Web Start can't be refered in the prerequisites of features that needs to be installed by Update;
o Help can not be deployed through Java Web Start. However it could be installed using eclipse Update, or the server serving your application could run a help server;
o Request to exit the application with a restart code are ignored;
o On the mac, applications can only be webstarted by clients using java 1.5.

It's up to you whether these are important issues to you. If you're not using Help, nor Mac OS X, nor need to change workspaces, it shouldn't affect you much. OTOH if you want to support Mac OS X, bear in mind that current Macs only have Java 1.4 installed on them by default.
Re: Creating an installer for my RCP app [message #437694 is a reply to message #437688] Sun, 02 October 2005 18:10 Go to previous messageGo to next message
Ed Burnette is currently offline Ed BurnetteFriend
Messages: 279
Registered: July 2009
Senior Member
Alex's comments are valid, but both WebStart and native installers have pros and cons so neither is going to be perfect for all applications.
Re: Creating an installer for my RCP app [message #437704 is a reply to message #437694] Mon, 03 October 2005 08:44 Go to previous messageGo to next message
udayms is currently offline udaymsFriend
Messages: 23
Registered: July 2009
Junior Member
Say if we are trying to install our rcp app using Installshield Universal Installer or InstallAnywhere, I guess its more of a putting the files in the right directory. In that case, we have the Help server working properly also, if there are jdk pre-requisites, then the installer can install those to as part of the installation. If we do it this way, I believe the update functionality also should work without probs. Right?
Re: Creating an installer for my RCP app [message #437708 is a reply to message #437704] Mon, 03 October 2005 12:54 Go to previous messageGo to next message
Ed Burnette is currently offline Ed BurnetteFriend
Messages: 279
Registered: July 2009
Senior Member
Right.

I haven't tried JWS with help though, why doesn't that work? I guess you could always point help at an external web site (but that wouldn't work disconnected).
Re: Creating an installer for my RCP app [message #437715 is a reply to message #437675] Mon, 03 October 2005 17:24 Go to previous messageGo to next message
scb  is currently offline scb Friend
Messages: 43
Registered: July 2009
Member
I created a separate installer for my rcp app that itself is webstarted.
The app is a simple plugin that when launched will prompt the user for an
install location. it'll then unpack a zip which contains my rcp app.

this installer is then webstarted. so the user goes to a link and the
installer is webstarted. the RCP app we want to install is then copied to
the user's machine.

you could do something similar
Re: Creating an installer for my RCP app [message #437755 is a reply to message #437708] Tue, 04 October 2005 11:03 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
JWS expects everything to be run as 'packed' Jars, in Eclipse terminology. However, the InfoCenter is powered by a behind-the-scenes Tomcat webserver that expects to find everything as individual java.io.Files within a directory on the local filing system.

That's one of the reasons why the helpcenter is still shipped as an 'unpacked' Jar, so that when Eclipse starts up the Jar is unpacked into a file repository. Of course, this behaviour doesn't happen in WebStart (which just leaves them as Jars) with the result that then Infocenter server fails to start up since the file doesn't exist.

(Granted, it's possible to change it; for example, instead of having files, use Class.getResource(), but the webserver started life as serving files so it's pretty tied into the way Tomcat works. I also have a sneaky suspicion that other help files are bundled as unpacked Jars, and pseudo-symlinks (probably at a config, rather than filing system level) are used to bring them all under one root. I'm guessing a future version will serve from Class resources rather than files, but it might be a way off)

There are several nifty approaches; another poster on this forum wrote an extractor to a temp directory in their plugin, so if Java WebStart was used, the tomcat engine could be launched from a separate TEMP type directory. Another is the suggestion that the Java WebStart app could be nothing more than installing a basic installer that then installs a pukka version of Eclipse locally.

Using any installer type (other than WebStart) is pretty much the same; it's just a case of figuring out where to put files and what the name of the VM to use is.
Re: Creating an installer for my RCP app [message #437767 is a reply to message #437715] Tue, 04 October 2005 14:17 Go to previous messageGo to next message
Ed Burnette is currently offline Ed BurnetteFriend
Messages: 279
Registered: July 2009
Senior Member
Is the source to your installer available?
Re: Creating an installer for my RCP app [message #437768 is a reply to message #437767] Tue, 04 October 2005 14:25 Go to previous messageGo to next message
udayms is currently offline udaymsFriend
Messages: 23
Registered: July 2009
Junior Member
Hi Ed,
Nope... it was just an r&d activity... I used "Installshield Universal Installer X" to create a multiplatform installer. The installer was supposed to do the following.

1. Check the jdk on the machine
-If jdk version less than 1.4, install jdk v1.4.1
2. Set env variables (classpath, java_home, path)
3. Copy eclipse into a folder selected by the user.
4. Create a shortcut icon in the start menu (if the os is windows) pointing towards the eclipse folder copied installed.
5. Clear temp install folder and Exit the installation.

This worked fine. It was just a prototype. I will be working on the actual installer pretty soon. When I do that I shall surely post the code here.

-Uday
Re: Creating an installer for my RCP app [message #437825 is a reply to message #437767] Wed, 05 October 2005 15:03 Go to previous message
scb  is currently offline scb Friend
Messages: 43
Registered: July 2009
Member
in my Application class for the installer plugin, i never actually open
the workbench. the first thing it does is create a Display, shell, and
Directory Dialog. then i just feed a fileinputstream to the unzip class
and it does the installation work. hope the code comes out formatted ok
in this post

Display display = PlatformUI.createDisplay();
Shell shell = new Shell(display);

DirectoryDialog dlg = new DirectoryDialog(shell);
dlg.setMessage("Choose a location to install. ");
String path = dlg.open();
if (path != null)
{

//call code that unzips the zipped rcp app from the server.
boolean success = UnZip.unZip(YOUR FILEINPUSTREAM TO THE ZIP FILE,
path + "\\");

if (success)
{
MessageBox mesBox = new
MessageBox(Display.getCurrent().getActiveShell(), SWT.ICON_INFORMATION);
mesBox.setMessage("Successful Installation!");
mesBox.open();
}
}


I used the "Files" tools from http://myjavatools.com/ in the unzip class.
note that my class also assumes the zipped rcp app was actually a zipped
directory containnig the app (mainDir)

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.zip.Adler32;
import java.util.zip.CheckedInputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.MessageBox;

import com.myjavatools.lib.Files;

public class UnZip
{

public static boolean unZip(FileInputStream from, String outputPath)
{
try
{
final int BUFFER = 2048;
BufferedOutputStream dest = null;
CheckedInputStream checksum = new CheckedInputStream(from, new
Adler32());
ZipInputStream zis = new ZipInputStream(new
BufferedInputStream(checksum));
ZipEntry entry;

String mainDir = "";
while ((entry = zis.getNextEntry()) != null)
{
if (mainDir.equals("")) // first time
mainDir = entry.getName().substring(0,
entry.getName().indexOf("/") + 1);

//can't extract main Dir since we already created it
if (!entry.getName().equals(mainDir))
{
System.out.println("Extracting: " + entry);
int count;
byte data[] = new byte[BUFFER];
// write the files to the disk
// FileOutputStream fos = new
FileOutputStream(entry.getName());
FileOutputStream fos = Files.makeFile(new
File(outputPath + entry.getName()));

dest = new BufferedOutputStream(fos, BUFFER);
while ((count = zis.read(data, 0, BUFFER)) != -1)
{
dest.write(data, 0, count);
}
dest.flush();
dest.close();
}
}
zis.close();
System.out.println("Checksum: " +
checksum.getChecksum().getValue());
return true;
}
catch (Exception e)
{
MessageBox mesBox = new
MessageBox(Display.getCurrent().getActiveShell(), SWT.ICON_ERROR);

mesBox.setMessage("Error Installing");
mesBox.open();

e.printStackTrace();
return false;
}
}

}
Previous Topic:License for IBM Workplace Client
Next Topic:Thread Problem...
Goto Forum:
  


Current Time: Thu Dec 26 22:20:41 GMT 2024

Powered by FUDForum. Page generated in 0.04614 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top