[Geoserver-devel] What would you want in a Windows installer?

It's no secret that the current Windows GeoServer installer and executable is a bit rough around the edges. It works, but it isn't as slick as it could be. For one thing, GeoServer isn't installed as a service, and the fact that the command prompt pops up and stays there is definitely sub-optimal. :slight_smile:

GeoServer works with the Java Service Wrapper (albeit with a little bit of tweaking) so it's very possible to use the BIN version of GeoServer, add in some wrapper config, and a perfectly good service we have.

So, with all this in mind, I'd like to solicit opinions about what people like and dislike in the Windows GeoServer experience, both with the installer and with running GeoServer. (Just the EXE I'm curious about here; I know some people use the BIN and WAR in Windows.)

I'm also designing a new flowchart for the installer. Here's what I have so far: (After making this list, I found that this is pretty much screen-by-screen identical to what Tomcat does for its installation process which is auspicious.)

-----

1. Splash screen
2. Welcome screen
3. Find %JAVA_HOME%
   3a. If found, display window
   3b. If not found, prompt for location, set in environment variable, add %JAVA_HOME%\bin to path.
4. License screen
5. Components screen - Two check boxes: [GeoServer (mandatory), data directory (optional)]
6. Program file destination screen
7. Find %GEOSERVER_DATA_DIR%
   7a. If found, display window with dropdown [use this, change this]
      7a1. If [change this] go to Select Data Dir, otherwise skip
   7b. If not found, go to Select Data Dir
8. Select Data Dir - Type in a location (with validation?)
9. Install as service screen [automatic, manual]
10. Start Menu screen
11. Ready to install screen
12. Install stuff
13. Finished screen

-----

Things to note:
  (3b) adds %JAVA_HOME%\bin to the path. This is what we want to do, right?
  (5) makes installing the built-in data dir optional. What do you think of this?
  (9) I would think the default should be automatic, right?
  I'm not 100% sure that everything here is possible, but NSIS seems pretty elastic, so I'm hopeful.

Feedback is practically begged for.

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

Oh one more thing to add: GeoServer should appear as an entry in the Add/Remove Programs listing...

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

Mike Pumphrey wrote:

It's no secret that the current Windows GeoServer installer and executable is a bit rough around the edges. It works, but it isn't as slick as it could be. For one thing, GeoServer isn't installed as a service, and the fact that the command prompt pops up and stays there is definitely sub-optimal. :slight_smile:

GeoServer works with the Java Service Wrapper (albeit with a little bit of tweaking) so it's very possible to use the BIN version of GeoServer, add in some wrapper config, and a perfectly good service we have.

So, with all this in mind, I'd like to solicit opinions about what people like and dislike in the Windows GeoServer experience, both with the installer and with running GeoServer. (Just the EXE I'm curious about here; I know some people use the BIN and WAR in Windows.)

I'm also designing a new flowchart for the installer. Here's what I have so far: (After making this list, I found that this is pretty much screen-by-screen identical to what Tomcat does for its installation process which is auspicious.)

-----

1. Splash screen
2. Welcome screen
3. Find %JAVA_HOME%
  3a. If found, display window
  3b. If not found, prompt for location, set in environment variable, add %JAVA_HOME%\bin to path.
4. License screen
5. Components screen - Two check boxes: [GeoServer (mandatory), data directory (optional)]
6. Program file destination screen
7. Find %GEOSERVER_DATA_DIR%
  7a. If found, display window with dropdown [use this, change this]
     7a1. If [change this] go to Select Data Dir, otherwise skip
  7b. If not found, go to Select Data Dir
8. Select Data Dir - Type in a location (with validation?)
9. Install as service screen [automatic, manual]
10. Start Menu screen
11. Ready to install screen
12. Install stuff
13. Finished screen

-----

Things to note:
(3b) adds %JAVA_HOME%\bin to the path. This is what we want to do, right?
(5) makes installing the built-in data dir optional. What do you think of this?
(9) I would think the default should be automatic, right?
I'm not 100% sure that everything here is possible, but NSIS seems pretty elastic, so I'm hopeful.

Feedback is practically begged for.

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

A couple of things:

* The second screen that tells the user which JDK will be used, or barks when there is no JDK. I have literally seen users cringe in pain when this screen pops up. It is way too much text, the text is poorly laid out, etc...

In my opinion this would much better be replaced with a screen "Choose Java" and basically is a text box and file chooser which allows one to choose the Java install they want. Basically the same way the screen that allows you choose the installation directory works.

* The data directory screen could use some love to. Too much text on it. To me a windows installer should basically do everything for you, and give you the option to do an "Advanced..." install if you really want to. But first time users of GeoServer having to read though the details of how the data directory works (often when they do not even really know what a data directory is) is bad.

-JD

Mike Pumphrey wrote:

It's no secret that the current Windows GeoServer installer and executable is a bit rough around the edges. It works, but it isn't as slick as it could be. For one thing, GeoServer isn't installed as a service, and the fact that the command prompt pops up and stays there is definitely sub-optimal. :slight_smile:

GeoServer works with the Java Service Wrapper (albeit with a little bit of tweaking) so it's very possible to use the BIN version of GeoServer, add in some wrapper config, and a perfectly good service we have.

So, with all this in mind, I'd like to solicit opinions about what people like and dislike in the Windows GeoServer experience, both with the installer and with running GeoServer. (Just the EXE I'm curious about here; I know some people use the BIN and WAR in Windows.)

I'm also designing a new flowchart for the installer. Here's what I have so far: (After making this list, I found that this is pretty much screen-by-screen identical to what Tomcat does for its installation process which is auspicious.)

-----

1. Splash screen
2. Welcome screen
3. Find %JAVA_HOME%
   3a. If found, display window
   3b. If not found, prompt for location, set in environment variable, add %JAVA_HOME%\bin to path.
4. License screen
5. Components screen - Two check boxes: [GeoServer (mandatory), data directory (optional)]
6. Program file destination screen
7. Find %GEOSERVER_DATA_DIR%
   7a. If found, display window with dropdown [use this, change this]
      7a1. If [change this] go to Select Data Dir, otherwise skip
   7b. If not found, go to Select Data Dir
8. Select Data Dir - Type in a location (with validation?)
9. Install as service screen [automatic, manual]
10. Start Menu screen
11. Ready to install screen
12. Install stuff
13. Finished screen

-----

Things to note:
  (3b) adds %JAVA_HOME%\bin to the path. This is what we want to do, right?
  (5) makes installing the built-in data dir optional. What do you think of this?
  (9) I would think the default should be automatic, right?
  I'm not 100% sure that everything here is possible, but NSIS seems pretty elastic, so I'm hopeful.

Feedback is practically begged for.

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

My .02?

Would there be any way to make sure JAI was installed? And maybe some instructions on how to get both the Java SDK( like which one, the Sun site is confusing.) and JAI.

Request: An easier way to install GDAL extensions.

I'll second the service thing. That was a little hard to figure out.

Roger

--------------------------------------------------
From: "Justin Deoliveira" <jdeolive@anonymised.com>
Sent: Tuesday, April 21, 2009 9:41 PM
To: "Mike Pumphrey" <mike@anonymised.com>
Cc: "Geoserver-devel" <geoserver-devel@lists.sourceforge.net>
Subject: Re: [Geoserver-devel] What would you want in a Windows installer?

A couple of things:

* The second screen that tells the user which JDK will be used, or barks
when there is no JDK. I have literally seen users cringe in pain when
this screen pops up. It is way too much text, the text is poorly laid
out, etc...

In my opinion this would much better be replaced with a screen "Choose
Java" and basically is a text box and file chooser which allows one to
choose the Java install they want. Basically the same way the screen
that allows you choose the installation directory works.

* The data directory screen could use some love to. Too much text on it.
To me a windows installer should basically do everything for you, and
give you the option to do an "Advanced..." install if you really want
to. But first time users of GeoServer having to read though the details
of how the data directory works (often when they do not even really know
what a data directory is) is bad.

-JD

Mike Pumphrey wrote:

It's no secret that the current Windows GeoServer installer and executable is a bit rough around the edges. It works, but it isn't as slick as it could be. For one thing, GeoServer isn't installed as a service, and the fact that the command prompt pops up and stays there is definitely sub-optimal. :slight_smile:

GeoServer works with the Java Service Wrapper (albeit with a little bit of tweaking) so it's very possible to use the BIN version of GeoServer, add in some wrapper config, and a perfectly good service we have.

So, with all this in mind, I'd like to solicit opinions about what people like and dislike in the Windows GeoServer experience, both with the installer and with running GeoServer. (Just the EXE I'm curious about here; I know some people use the BIN and WAR in Windows.)

I'm also designing a new flowchart for the installer. Here's what I have so far: (After making this list, I found that this is pretty much screen-by-screen identical to what Tomcat does for its installation process which is auspicious.)

-----

1. Splash screen
2. Welcome screen
3. Find %JAVA_HOME%
   3a. If found, display window
   3b. If not found, prompt for location, set in environment variable, add %JAVA_HOME%\bin to path.
4. License screen
5. Components screen - Two check boxes: [GeoServer (mandatory), data directory (optional)]
6. Program file destination screen
7. Find %GEOSERVER_DATA_DIR%
   7a. If found, display window with dropdown [use this, change this]
      7a1. If [change this] go to Select Data Dir, otherwise skip
   7b. If not found, go to Select Data Dir
8. Select Data Dir - Type in a location (with validation?)
9. Install as service screen [automatic, manual]
10. Start Menu screen
11. Ready to install screen
12. Install stuff
13. Finished screen

-----

Things to note:
  (3b) adds %JAVA_HOME%\bin to the path. This is what we want to do, right?
  (5) makes installing the built-in data dir optional. What do you think of this?
  (9) I would think the default should be automatic, right?

I'm not 100% sure that everything here is possible, but NSIS seems pretty elastic, so I'm hopeful.

Feedback is practically begged for.

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Oooh, good points.

* The second screen that tells the user which JDK will be used, or barks when there is no JDK. I have literally seen users cringe in pain when this screen pops up. It is way too much text, the text is poorly laid out, etc...

Ahh, this corresponds to (3) in my workflow. Are you suggesting that we remove this (3a) pop up entirely (unless a JAVA isn't found?) I could be okay with that.

In my opinion this would much better be replaced with a screen "Choose Java" and basically is a text box and file chooser which allows one to choose the Java install they want. Basically the same way the screen that allows you choose the installation directory works.

This is what I had in mind for (3b).

* The data directory screen could use some love to. Too much text on it. To me a windows installer should basically do everything for you, and give you the option to do an "Advanced..." install if you really want to. But first time users of GeoServer having to read though the details of how the data directory works (often when they do not even really know what a data directory is) is bad.

I hadn't thought of this, but you're right that a "Complete/Custom" radio dialog is a great idea. (I don't know if this is possible with NSIS, but I'll check.) As for text cleanup, I'm on it. :slight_smile:

So the new workflow would be:

1. Splash screen
2. Welcome screen
3. Find %JAVA_HOME%
   3a. If found, SAY NOTHING
   3b. If not found, prompt for location, set in environment variable, add %JAVA_HOME%\bin to path.
4. License screen
5. Program file destination screen
6. Complete/Custom install screen
   6a. If Complete: look for data dir, if not found set to new installed data dir; install service as automatic, set Start Menu group, jump to 11
   6b. If Custom: Continue to 7
7. Components screen - Two check boxes: [GeoServer (mandatory), data directory (optional)]
8. Find %GEOSERVER_DATA_DIR%
   8a. If found, display window with dropdown [use this, change this]
      7a1. If [change this] go to 9, otherwise go to 10
   8b. If not found, go to 9
9. Select Data Dir - Type in a location (with validation?)
10. Install as service screen [automatic, manual]
11. Start Menu screen
12. Ready to install screen
13. Install stuff
14. Finished screen

Better?

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

Justin Deoliveira wrote:

A couple of things:

* The second screen that tells the user which JDK will be used, or barks when there is no JDK. I have literally seen users cringe in pain when this screen pops up. It is way too much text, the text is poorly laid out, etc...

In my opinion this would much better be replaced with a screen "Choose Java" and basically is a text box and file chooser which allows one to choose the Java install they want. Basically the same way the screen that allows you choose the installation directory works.

* The data directory screen could use some love to. Too much text on it. To me a windows installer should basically do everything for you, and give you the option to do an "Advanced..." install if you really want to. But first time users of GeoServer having to read though the details of how the data directory works (often when they do not even really know what a data directory is) is bad.

-JD

Mike Pumphrey wrote:

It's no secret that the current Windows GeoServer installer and executable is a bit rough around the edges. It works, but it isn't as slick as it could be. For one thing, GeoServer isn't installed as a service, and the fact that the command prompt pops up and stays there is definitely sub-optimal. :slight_smile:

GeoServer works with the Java Service Wrapper (albeit with a little bit of tweaking) so it's very possible to use the BIN version of GeoServer, add in some wrapper config, and a perfectly good service we have.

So, with all this in mind, I'd like to solicit opinions about what people like and dislike in the Windows GeoServer experience, both with the installer and with running GeoServer. (Just the EXE I'm curious about here; I know some people use the BIN and WAR in Windows.)

I'm also designing a new flowchart for the installer. Here's what I have so far: (After making this list, I found that this is pretty much screen-by-screen identical to what Tomcat does for its installation process which is auspicious.)

-----

1. Splash screen
2. Welcome screen
3. Find %JAVA_HOME%
   3a. If found, display window
   3b. If not found, prompt for location, set in environment variable, add %JAVA_HOME%\bin to path.
4. License screen
5. Components screen - Two check boxes: [GeoServer (mandatory), data directory (optional)]
6. Program file destination screen
7. Find %GEOSERVER_DATA_DIR%
   7a. If found, display window with dropdown [use this, change this]
      7a1. If [change this] go to Select Data Dir, otherwise skip
   7b. If not found, go to Select Data Dir
8. Select Data Dir - Type in a location (with validation?)
9. Install as service screen [automatic, manual]
10. Start Menu screen
11. Ready to install screen
12. Install stuff
13. Finished screen

-----

Things to note:
  (3b) adds %JAVA_HOME%\bin to the path. This is what we want to do, right?
  (5) makes installing the built-in data dir optional. What do you think of this?
  (9) I would think the default should be automatic, right?
  I'm not 100% sure that everything here is possible, but NSIS seems pretty elastic, so I'm hopeful.

Feedback is practically begged for.

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

------------------------------------------------------------------------------

Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Hi Roger.

Would there be any way to make sure JAI was installed? And maybe some instructions on how to get both the Java SDK( like which one, the Sun site is confusing.) and JAI.

Can you elaborate on this? I don't think you need to download JAI to run GeoServer, right? (I'm no expert on this sort of thing.)

Request: An easier way to install GDAL extensions.

Well, I'd like a better plugin architecture in general. :slight_smile: But I think unfortunately that it may be out of scope for this particular project.

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

Roger Bedell wrote:

My .02?

Would there be any way to make sure JAI was installed? And maybe some instructions on how to get both the Java SDK( like which one, the Sun site is confusing.) and JAI.

Request: An easier way to install GDAL extensions.

I'll second the service thing. That was a little hard to figure out.

Roger

--------------------------------------------------
From: "Justin Deoliveira" <jdeolive@anonymised.com>
Sent: Tuesday, April 21, 2009 9:41 PM
To: "Mike Pumphrey" <mike@anonymised.com>
Cc: "Geoserver-devel" <geoserver-devel@lists.sourceforge.net>
Subject: Re: [Geoserver-devel] What would you want in a Windows installer?

A couple of things:

* The second screen that tells the user which JDK will be used, or barks
when there is no JDK. I have literally seen users cringe in pain when
this screen pops up. It is way too much text, the text is poorly laid
out, etc...

In my opinion this would much better be replaced with a screen "Choose
Java" and basically is a text box and file chooser which allows one to
choose the Java install they want. Basically the same way the screen
that allows you choose the installation directory works.

* The data directory screen could use some love to. Too much text on it.
To me a windows installer should basically do everything for you, and
give you the option to do an "Advanced..." install if you really want
to. But first time users of GeoServer having to read though the details
of how the data directory works (often when they do not even really know
what a data directory is) is bad.

-JD

Mike Pumphrey wrote:

It's no secret that the current Windows GeoServer installer and executable is a bit rough around the edges. It works, but it isn't as slick as it could be. For one thing, GeoServer isn't installed as a service, and the fact that the command prompt pops up and stays there is definitely sub-optimal. :slight_smile:

GeoServer works with the Java Service Wrapper (albeit with a little bit of tweaking) so it's very possible to use the BIN version of GeoServer, add in some wrapper config, and a perfectly good service we have.

So, with all this in mind, I'd like to solicit opinions about what people like and dislike in the Windows GeoServer experience, both with the installer and with running GeoServer. (Just the EXE I'm curious about here; I know some people use the BIN and WAR in Windows.)

I'm also designing a new flowchart for the installer. Here's what I have so far: (After making this list, I found that this is pretty much screen-by-screen identical to what Tomcat does for its installation process which is auspicious.)

-----

1. Splash screen
2. Welcome screen
3. Find %JAVA_HOME%
   3a. If found, display window
   3b. If not found, prompt for location, set in environment variable, add %JAVA_HOME%\bin to path.
4. License screen
5. Components screen - Two check boxes: [GeoServer (mandatory), data directory (optional)]
6. Program file destination screen
7. Find %GEOSERVER_DATA_DIR%
   7a. If found, display window with dropdown [use this, change this]
      7a1. If [change this] go to Select Data Dir, otherwise skip
   7b. If not found, go to Select Data Dir
8. Select Data Dir - Type in a location (with validation?)
9. Install as service screen [automatic, manual]
10. Start Menu screen
11. Ready to install screen
12. Install stuff
13. Finished screen

-----

Things to note:
  (3b) adds %JAVA_HOME%\bin to the path. This is what we want to do, right?
  (5) makes installing the built-in data dir optional. What do you think of this?
  (9) I would think the default should be automatic, right?

I'm not 100% sure that everything here is possible, but NSIS seems pretty elastic, so I'm hopeful.

Feedback is practically begged for.

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

A pure-java implementation of JAI is shipped with GeoServer. There is
also a native implementation that gives better rendering performance,
which we don't include in the GeoServer war to avoid
platform-dependence. However, if the native libraries are installed in
the java system, GeoServer will take advantage of them. Since the
Windows installer is already dependent on the Windows platform, having
the GS installer check for JAI or even include native libraries would be
workable.

--
David Winslow
OpenGeo - http://opengeo.org/

On Tue, 2009-04-21 at 16:23 -0400, Mike Pumphrey wrote:

Hi Roger.

> Would there be any way to make sure JAI was installed? And maybe some
> instructions on how to get both the Java SDK( like which one, the Sun site
> is confusing.) and JAI.

Can you elaborate on this? I don't think you need to download JAI to run GeoServer, right? (I'm no expert on this sort of thing.)

> Request: An easier way to install GDAL extensions.

Well, I'd like a better plugin architecture in general. :slight_smile: But I think unfortunately that it may be out of scope for this particular project.

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

Roger Bedell wrote:
> My .02?
>
> Would there be any way to make sure JAI was installed? And maybe some
> instructions on how to get both the Java SDK( like which one, the Sun site
> is confusing.) and JAI.
>
> Request: An easier way to install GDAL extensions.
>
> I'll second the service thing. That was a little hard to figure out.
>
> Roger
>
> --------------------------------------------------
> From: "Justin Deoliveira" <jdeolive@anonymised.com>
> Sent: Tuesday, April 21, 2009 9:41 PM
> To: "Mike Pumphrey" <mike@anonymised.com>
> Cc: "Geoserver-devel" <geoserver-devel@lists.sourceforge.net>
> Subject: Re: [Geoserver-devel] What would you want in a Windows installer?
>
>> A couple of things:
>>
>> * The second screen that tells the user which JDK will be used, or barks
>> when there is no JDK. I have literally seen users cringe in pain when
>> this screen pops up. It is way too much text, the text is poorly laid
>> out, etc...
>>
>> In my opinion this would much better be replaced with a screen "Choose
>> Java" and basically is a text box and file chooser which allows one to
>> choose the Java install they want. Basically the same way the screen
>> that allows you choose the installation directory works.
>>
>> * The data directory screen could use some love to. Too much text on it.
>> To me a windows installer should basically do everything for you, and
>> give you the option to do an "Advanced..." install if you really want
>> to. But first time users of GeoServer having to read though the details
>> of how the data directory works (often when they do not even really know
>> what a data directory is) is bad.
>>
>> -JD
>>
>>
>> Mike Pumphrey wrote:
>>> It's no secret that the current Windows GeoServer installer and
>>> executable is a bit rough around the edges. It works, but it isn't as
>>> slick as it could be. For one thing, GeoServer isn't installed as a
>>> service, and the fact that the command prompt pops up and stays there is
>>> definitely sub-optimal. :slight_smile:
>>>
>>> GeoServer works with the Java Service Wrapper (albeit with a little bit
>>> of tweaking) so it's very possible to use the BIN version of GeoServer,
>>> add in some wrapper config, and a perfectly good service we have.
>>>
>>> So, with all this in mind, I'd like to solicit opinions about what people
>>> like and dislike in the Windows GeoServer experience, both with the
>>> installer and with running GeoServer. (Just the EXE I'm curious about
>>> here; I know some people use the BIN and WAR in Windows.)
>>>
>>> I'm also designing a new flowchart for the installer. Here's what I have
>>> so far: (After making this list, I found that this is pretty much
>>> screen-by-screen identical to what Tomcat does for its installation
>>> process which is auspicious.)
>>>
>>> -----
>>>
>>> 1. Splash screen
>>> 2. Welcome screen
>>> 3. Find %JAVA_HOME%
>>> 3a. If found, display window
>>> 3b. If not found, prompt for location, set in environment variable,
>>> add %JAVA_HOME%\bin to path.
>>> 4. License screen
>>> 5. Components screen - Two check boxes: [GeoServer (mandatory), data
>>> directory (optional)]
>>> 6. Program file destination screen
>>> 7. Find %GEOSERVER_DATA_DIR%
>>> 7a. If found, display window with dropdown [use this, change this]
>>> 7a1. If [change this] go to Select Data Dir, otherwise skip
>>> 7b. If not found, go to Select Data Dir
>>> 8. Select Data Dir - Type in a location (with validation?)
>>> 9. Install as service screen [automatic, manual]
>>> 10. Start Menu screen
>>> 11. Ready to install screen
>>> 12. Install stuff
>>> 13. Finished screen
>>>
>>> -----
>>>
>>> Things to note:
>>> (3b) adds %JAVA_HOME%\bin to the path. This is what we want to do,
>>> right?
>>> (5) makes installing the built-in data dir optional. What do you think
>>> of this?
>>> (9) I would think the default should be automatic, right?
>>>
>>> I'm not 100% sure that everything here is possible, but NSIS seems pretty
>>> elastic, so I'm hopeful.
>>>
>>> Feedback is practically begged for.
>>>
>>>
>>> Thanks,
>>> Mike Pumphrey
>>> OpenGeo - http://opengeo.org
>>>
>>> ------------------------------------------------------------------------------
>>> Stay on top of everything new and different, both inside and
>>> around Java (TM) technology - register by April 22, and save
>>> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
>>> 300 plus technical and hands-on sessions. Register today.
>>> Use priority code J9JMT32. http://p.sf.net/sfu/p
>>> _______________________________________________
>>> Geoserver-devel mailing list
>>> Geoserver-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>>
>> --
>> Justin Deoliveira
>> OpenGeo - http://opengeo.org
>> Enterprise support for open source geospatial.
>>
>> ------------------------------------------------------------------------------
>> Stay on top of everything new and different, both inside and
>> around Java (TM) technology - register by April 22, and save
>> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
>> 300 plus technical and hands-on sessions. Register today.
>> Use priority code J9JMT32. http://p.sf.net/sfu/p
>> _______________________________________________
>> Geoserver-devel mailing list
>> Geoserver-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>>
>
> ------------------------------------------------------------------------------
> Stay on top of everything new and different, both inside and
> around Java (TM) technology - register by April 22, and save
> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
> 300 plus technical and hands-on sessions. Register today.
> Use priority code J9JMT32. http://p.sf.net/sfu/p
> _______________________________________________
> Geoserver-devel mailing list
> Geoserver-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Okay, sure. So what does the installer need to search for? My preference is for things that we can include without having to add more user interaction though, so if we can include files inside our installer, that seems preferable...

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

David Winslow wrote:

A pure-java implementation of JAI is shipped with GeoServer. There is
also a native implementation that gives better rendering performance,
which we don't include in the GeoServer war to avoid
platform-dependence. However, if the native libraries are installed in
the java system, GeoServer will take advantage of them. Since the
Windows installer is already dependent on the Windows platform, having
the GS installer check for JAI or even include native libraries would be
workable.

--
David Winslow
OpenGeo - http://opengeo.org/

On Tue, 2009-04-21 at 16:23 -0400, Mike Pumphrey wrote:

Hi Roger.

Would there be any way to make sure JAI was installed? And maybe some instructions on how to get both the Java SDK( like which one, the Sun site is confusing.) and JAI.

Can you elaborate on this? I don't think you need to download JAI to run GeoServer, right? (I'm no expert on this sort of thing.)

Request: An easier way to install GDAL extensions.

Well, I'd like a better plugin architecture in general. :slight_smile: But I think unfortunately that it may be out of scope for this particular project.

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

Roger Bedell wrote:

My .02?

Would there be any way to make sure JAI was installed? And maybe some instructions on how to get both the Java SDK( like which one, the Sun site is confusing.) and JAI.

Request: An easier way to install GDAL extensions.

I'll second the service thing. That was a little hard to figure out.

Roger

--------------------------------------------------
From: "Justin Deoliveira" <jdeolive@anonymised.com>
Sent: Tuesday, April 21, 2009 9:41 PM
To: "Mike Pumphrey" <mike@anonymised.com>
Cc: "Geoserver-devel" <geoserver-devel@lists.sourceforge.net>
Subject: Re: [Geoserver-devel] What would you want in a Windows installer?

A couple of things:

* The second screen that tells the user which JDK will be used, or barks
when there is no JDK. I have literally seen users cringe in pain when
this screen pops up. It is way too much text, the text is poorly laid
out, etc...

In my opinion this would much better be replaced with a screen "Choose
Java" and basically is a text box and file chooser which allows one to
choose the Java install they want. Basically the same way the screen
that allows you choose the installation directory works.

* The data directory screen could use some love to. Too much text on it.
To me a windows installer should basically do everything for you, and
give you the option to do an "Advanced..." install if you really want
to. But first time users of GeoServer having to read though the details
of how the data directory works (often when they do not even really know
what a data directory is) is bad.

-JD

Mike Pumphrey wrote:

It's no secret that the current Windows GeoServer installer and executable is a bit rough around the edges. It works, but it isn't as slick as it could be. For one thing, GeoServer isn't installed as a service, and the fact that the command prompt pops up and stays there is definitely sub-optimal. :slight_smile:

GeoServer works with the Java Service Wrapper (albeit with a little bit of tweaking) so it's very possible to use the BIN version of GeoServer, add in some wrapper config, and a perfectly good service we have.

So, with all this in mind, I'd like to solicit opinions about what people like and dislike in the Windows GeoServer experience, both with the installer and with running GeoServer. (Just the EXE I'm curious about here; I know some people use the BIN and WAR in Windows.)

I'm also designing a new flowchart for the installer. Here's what I have so far: (After making this list, I found that this is pretty much screen-by-screen identical to what Tomcat does for its installation process which is auspicious.)

-----

1. Splash screen
2. Welcome screen
3. Find %JAVA_HOME%
   3a. If found, display window
   3b. If not found, prompt for location, set in environment variable, add %JAVA_HOME%\bin to path.
4. License screen
5. Components screen - Two check boxes: [GeoServer (mandatory), data directory (optional)]
6. Program file destination screen
7. Find %GEOSERVER_DATA_DIR%
   7a. If found, display window with dropdown [use this, change this]
      7a1. If [change this] go to Select Data Dir, otherwise skip
   7b. If not found, go to Select Data Dir
8. Select Data Dir - Type in a location (with validation?)
9. Install as service screen [automatic, manual]
10. Start Menu screen
11. Ready to install screen
12. Install stuff
13. Finished screen

-----

Things to note:
  (3b) adds %JAVA_HOME%\bin to the path. This is what we want to do, right?
  (5) makes installing the built-in data dir optional. What do you think of this?
  (9) I would think the default should be automatic, right?

I'm not 100% sure that everything here is possible, but NSIS seems pretty elastic, so I'm hopeful.

Feedback is practically begged for.

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

The GeoServer admin console already contains a check for the native JAI
libraries (doing this from inside Java code is a good way to do this,
since it lets us just ask the Java runtime if it knows about the
library, rather than trying to replicate its lookup algorithm). I or
another of the developers can probably bundle this check into a separate
jar file that could be used by the installer (though I'm a bit weak on
exactly what NSIS installers are able to do easily, I would assume
running .jar files and changing behavior based on the results would be
one of those things.) Let's talk about this off-list sometime soon.

--
David Winslow
OpenGeo - http://opengeo.org/

On Tue, 2009-04-21 at 17:59 -0400, Mike Pumphrey wrote:

Okay, sure. So what does the installer need to search for? My preference is for things that we can include without having to add more user interaction though, so if we can include files inside our installer, that seems preferable...

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

David Winslow wrote:
> A pure-java implementation of JAI is shipped with GeoServer. There is
> also a native implementation that gives better rendering performance,
> which we don't include in the GeoServer war to avoid
> platform-dependence. However, if the native libraries are installed in
> the java system, GeoServer will take advantage of them. Since the
> Windows installer is already dependent on the Windows platform, having
> the GS installer check for JAI or even include native libraries would be
> workable.
>
> --
> David Winslow
> OpenGeo - http://opengeo.org/
>
> On Tue, 2009-04-21 at 16:23 -0400, Mike Pumphrey wrote:
>> Hi Roger.
>>
>>> Would there be any way to make sure JAI was installed? And maybe some
>>> instructions on how to get both the Java SDK( like which one, the Sun site
>>> is confusing.) and JAI.
>> Can you elaborate on this? I don't think you need to download JAI to run GeoServer, right? (I'm no expert on this sort of thing.)
>>
>>> Request: An easier way to install GDAL extensions.
>> Well, I'd like a better plugin architecture in general. :slight_smile: But I think unfortunately that it may be out of scope for this particular project.
>>
>>
>>
>> Thanks,
>> Mike Pumphrey
>> OpenGeo - http://opengeo.org
>>
>>
>> Roger Bedell wrote:
>>> My .02?
>>>
>>> Would there be any way to make sure JAI was installed? And maybe some
>>> instructions on how to get both the Java SDK( like which one, the Sun site
>>> is confusing.) and JAI.
>>>
>>> Request: An easier way to install GDAL extensions.
>>>
>>> I'll second the service thing. That was a little hard to figure out.
>>>
>>> Roger
>>>
>>> --------------------------------------------------
>>> From: "Justin Deoliveira" <jdeolive@anonymised.com>
>>> Sent: Tuesday, April 21, 2009 9:41 PM
>>> To: "Mike Pumphrey" <mike@anonymised.com>
>>> Cc: "Geoserver-devel" <geoserver-devel@lists.sourceforge.net>
>>> Subject: Re: [Geoserver-devel] What would you want in a Windows installer?
>>>
>>>> A couple of things:
>>>>
>>>> * The second screen that tells the user which JDK will be used, or barks
>>>> when there is no JDK. I have literally seen users cringe in pain when
>>>> this screen pops up. It is way too much text, the text is poorly laid
>>>> out, etc...
>>>>
>>>> In my opinion this would much better be replaced with a screen "Choose
>>>> Java" and basically is a text box and file chooser which allows one to
>>>> choose the Java install they want. Basically the same way the screen
>>>> that allows you choose the installation directory works.
>>>>
>>>> * The data directory screen could use some love to. Too much text on it.
>>>> To me a windows installer should basically do everything for you, and
>>>> give you the option to do an "Advanced..." install if you really want
>>>> to. But first time users of GeoServer having to read though the details
>>>> of how the data directory works (often when they do not even really know
>>>> what a data directory is) is bad.
>>>>
>>>> -JD
>>>>
>>>>
>>>> Mike Pumphrey wrote:
>>>>> It's no secret that the current Windows GeoServer installer and
>>>>> executable is a bit rough around the edges. It works, but it isn't as
>>>>> slick as it could be. For one thing, GeoServer isn't installed as a
>>>>> service, and the fact that the command prompt pops up and stays there is
>>>>> definitely sub-optimal. :slight_smile:
>>>>>
>>>>> GeoServer works with the Java Service Wrapper (albeit with a little bit
>>>>> of tweaking) so it's very possible to use the BIN version of GeoServer,
>>>>> add in some wrapper config, and a perfectly good service we have.
>>>>>
>>>>> So, with all this in mind, I'd like to solicit opinions about what people
>>>>> like and dislike in the Windows GeoServer experience, both with the
>>>>> installer and with running GeoServer. (Just the EXE I'm curious about
>>>>> here; I know some people use the BIN and WAR in Windows.)
>>>>>
>>>>> I'm also designing a new flowchart for the installer. Here's what I have
>>>>> so far: (After making this list, I found that this is pretty much
>>>>> screen-by-screen identical to what Tomcat does for its installation
>>>>> process which is auspicious.)
>>>>>
>>>>> -----
>>>>>
>>>>> 1. Splash screen
>>>>> 2. Welcome screen
>>>>> 3. Find %JAVA_HOME%
>>>>> 3a. If found, display window
>>>>> 3b. If not found, prompt for location, set in environment variable,
>>>>> add %JAVA_HOME%\bin to path.
>>>>> 4. License screen
>>>>> 5. Components screen - Two check boxes: [GeoServer (mandatory), data
>>>>> directory (optional)]
>>>>> 6. Program file destination screen
>>>>> 7. Find %GEOSERVER_DATA_DIR%
>>>>> 7a. If found, display window with dropdown [use this, change this]
>>>>> 7a1. If [change this] go to Select Data Dir, otherwise skip
>>>>> 7b. If not found, go to Select Data Dir
>>>>> 8. Select Data Dir - Type in a location (with validation?)
>>>>> 9. Install as service screen [automatic, manual]
>>>>> 10. Start Menu screen
>>>>> 11. Ready to install screen
>>>>> 12. Install stuff
>>>>> 13. Finished screen
>>>>>
>>>>> -----
>>>>>
>>>>> Things to note:
>>>>> (3b) adds %JAVA_HOME%\bin to the path. This is what we want to do,
>>>>> right?
>>>>> (5) makes installing the built-in data dir optional. What do you think
>>>>> of this?
>>>>> (9) I would think the default should be automatic, right?
>>>>>
>>>>> I'm not 100% sure that everything here is possible, but NSIS seems pretty
>>>>> elastic, so I'm hopeful.
>>>>>
>>>>> Feedback is practically begged for.
>>>>>
>>>>>
>>>>> Thanks,
>>>>> Mike Pumphrey
>>>>> OpenGeo - http://opengeo.org
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Stay on top of everything new and different, both inside and
>>>>> around Java (TM) technology - register by April 22, and save
>>>>> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
>>>>> 300 plus technical and hands-on sessions. Register today.
>>>>> Use priority code J9JMT32. http://p.sf.net/sfu/p
>>>>> _______________________________________________
>>>>> Geoserver-devel mailing list
>>>>> Geoserver-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>>>> --
>>>> Justin Deoliveira
>>>> OpenGeo - http://opengeo.org
>>>> Enterprise support for open source geospatial.
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Stay on top of everything new and different, both inside and
>>>> around Java (TM) technology - register by April 22, and save
>>>> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
>>>> 300 plus technical and hands-on sessions. Register today.
>>>> Use priority code J9JMT32. http://p.sf.net/sfu/p
>>>> _______________________________________________
>>>> Geoserver-devel mailing list
>>>> Geoserver-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>>>>
>>> ------------------------------------------------------------------------------
>>> Stay on top of everything new and different, both inside and
>>> around Java (TM) technology - register by April 22, and save
>>> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
>>> 300 plus technical and hands-on sessions. Register today.
>>> Use priority code J9JMT32. http://p.sf.net/sfu/p
>>> _______________________________________________
>>> Geoserver-devel mailing list
>>> Geoserver-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>> ------------------------------------------------------------------------------
>> Stay on top of everything new and different, both inside and
>> around Java (TM) technology - register by April 22, and save
>> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
>> 300 plus technical and hands-on sessions. Register today.
>> Use priority code J9JMT32. http://p.sf.net/sfu/p
>> _______________________________________________
>> Geoserver-devel mailing list
>> Geoserver-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>

My request would be for it to work better when installing on Vista if the user is not running as administrator. I’d prefer it to work but I’d settle for a clean failure - currently you get a broken install that looks like it’s right but with the permissions broken.

Ian

I actually have one sold useful request:
- allow the installer to run with out user interaction; this is
central to letting people deploy the thing in a managed operating
environment

And two things that would just be nice to have:
- have a page that is willing to open the security text file so users
can change the admin/geoserver password; the postgis installer does
this kind of stuff and combined with comments in the config files it
results in a good experience
- have the installer start geoserver; and open up a web page to look
at it (even if the installer has to pass in a command line option to
ask geoserver to open the web page)

You are of course warned about the vista restrictions on where the
data directory can live (ie not in program files or it starts doing
shadow directory stuff); I understand that this is even more trouble
when running as a service - give some thought to what user geoserver
would be running as (the postgis installer still got in trouble with
vista last time I tried to let the installer create a user account).

Jody

I'm not 100% sure that everything here is possible, but NSIS seems pretty elastic, so I'm hopeful.

Feedback is practically begged for.

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

Mike Pumphrey ha scritto:

Hi Roger.

Would there be any way to make sure JAI was installed? And maybe
some instructions on how to get both the Java SDK( like which one,
the Sun site is confusing.) and JAI.

Can you elaborate on this? I don't think you need to download JAI to
run GeoServer, right? (I'm no expert on this sort of thing.)

No, you don't, the pure java version of JAI and JAI Image I/O are
included in the GeoServer install (whether it's installer, bin or
war). But no native JAI and native JAI Image I/O, which are needed
to get good WMS/coverage performance.

Native JAI is kind of a bitch, as you're supposed to install it
inside the JDK, so in a place where it influences every other
application. I know there are some other apps (ESRI I believe)
that stick an older JAI into the JDK, from that point onwards
GeoServer stops working due to the version mismatch (the version
installed in the JDK trumps the one in the application classpath).

Nevertheless, just for Windows, just for the installer, we could
also place JAI native elements in the package, and make sure
they are visible to the Java dll loader. I believe, without being
sure, that all it's needed is placing the natives into a directory
that's pointed both by PATH and LD_LIBRARY_PATH env variables.

This approach could work for the windows installer and for the
.bin package, thought the .bin is platform independent, so
we'd have to include the native versions for multiple platforms...
nah, not worth the extra effort imho.

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Hi everyone. I have created a test run of the new Windows installer, based on 1.7.3. Give it a whirl.

http://atlas.openplans.org/~mike/GeoServer_1.7.3_newinstaller.exe

Since I know that many people here don't have access to a Windows box, I've attached screenshots. Here's the workflow:

First is the splash screen (01), followed the by the welcome (02). If you are not running as an admin, the installer will abort (03), otherwise the license screen will show up (04). Next is the typical "where to install" page (05) and Start Menu location page (06). After that, the installer will ask for the location of the JDK (07), auto-populating the field with the %JAVA_HOME% variable, if it exists. The installer won't continue if it can't find a valid JDK (08). After this check, it asks for the location of the data directory (09), auto-populating this field with the %GEOSERVER_DATA_DIR% variable, if it exists. If it doesn't exist, the field will be populated with $INSTDIR\data_dir (i.e. the location of the built-in data directory after install), so this field is never empty. If you specify another directory, it will checked to see if it is valid and error if not (10), and if good, will say that it is using an existing data directory (11). If using the built-in da
ta directory, this installer will allow you to change the admin username and password (12). (This won't happen if using an existing data directory, so as to prevent clobbering existing security settings.) Finally, one final page allows for reviewing of settings (13), and after install, a final screen shows success (14).

This will install GeoServer as a service. It's not set to automatic startup, although that's easily changed. The Start Menu items are unchanged, although now they start/stop the service. When starting and stopping, a command line window shows up momentarily ("Starting/Stopping GeoServer 1.7.3") but then goes away! Hoorah!

The program now shows up on the Add/Remove Programs list, although the Uninstaller file remains in the Start Menu.

But anyway, assuming the user has a JDK installed and set up, the user only needs to keep clicking Next, and GeoServer will be installed on their system. :slight_smile:

Some of the suggestions made on this thread haven't been implemented yet (JAI checks, silent installer), but I wanted to get some of the basics nailed down first. Please test and let me know if there's anything that should be changed. Thanks to everyone who has helped me get started pushing this rock over the hill.

P.S. For anyone who reads NSIS, also attached is the script used to generate the installer. I wanted to get feedback on workflow before committing anything.

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

Mike Pumphrey wrote:

Oh one more thing to add: GeoServer should appear as an entry in the Add/Remove Programs listing...

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

Mike Pumphrey wrote:

It's no secret that the current Windows GeoServer installer and executable is a bit rough around the edges. It works, but it isn't as slick as it could be. For one thing, GeoServer isn't installed as a service, and the fact that the command prompt pops up and stays there is definitely sub-optimal. :slight_smile:

GeoServer works with the Java Service Wrapper (albeit with a little bit of tweaking) so it's very possible to use the BIN version of GeoServer, add in some wrapper config, and a perfectly good service we have.

So, with all this in mind, I'd like to solicit opinions about what people like and dislike in the Windows GeoServer experience, both with the installer and with running GeoServer. (Just the EXE I'm curious about here; I know some people use the BIN and WAR in Windows.)

I'm also designing a new flowchart for the installer. Here's what I have so far: (After making this list, I found that this is pretty much screen-by-screen identical to what Tomcat does for its installation process which is auspicious.)

-----

1. Splash screen
2. Welcome screen
3. Find %JAVA_HOME%
  3a. If found, display window
  3b. If not found, prompt for location, set in environment variable, add %JAVA_HOME%\bin to path.
4. License screen
5. Components screen - Two check boxes: [GeoServer (mandatory), data directory (optional)]
6. Program file destination screen
7. Find %GEOSERVER_DATA_DIR%
  7a. If found, display window with dropdown [use this, change this]
     7a1. If [change this] go to Select Data Dir, otherwise skip
  7b. If not found, go to Select Data Dir
8. Select Data Dir - Type in a location (with validation?)
9. Install as service screen [automatic, manual]
10. Start Menu screen
11. Ready to install screen
12. Install stuff
13. Finished screen

-----

Things to note:
(3b) adds %JAVA_HOME%\bin to the path. This is what we want to do, right?
(5) makes installing the built-in data dir optional. What do you think of this?
(9) I would think the default should be automatic, right?
I'm not 100% sure that everything here is possible, but NSIS seems pretty elastic, so I'm hopeful.

Feedback is practically begged for.

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

(attachments)

01splash.png
02welcome.png
03noadmin.png
04license.png
05progfiles.png
06startmenu.png
07jdk.png
08badjdk.png
09datadir.png
10baddatadir.png
11datadirused.png
12setcreds.png
13review.png
14finish.png
GeoServerEXE.nsi (15.8 KB)

Hi Mike: I am going to try this one on vista for you (since doing a
sevice on vista is often a pain so I may catch something for you).

1. Initial prompted with the usual access control permission question
2. initial page looks great
3. license page is fine; I am used to a check box to enable the Next
button but whatever
4. directory etc okay
5. non pop up dialog to show the jdk is a great improvement
6. "Please select the path to your GeoServer data diregtory. Most
users should leave this unchanged"
7. Great work with the ability to change geoserver configuration user
name and password :slight_smile:

This is nice and short; but does not define who most users are. Perhaps:

"If you have previously set up a Geoserver configuration please
provide that path to your data directory; if this is your first time
using GeoServer an example configuration is provided below".

The default location of the data_dir causes problems in Vista; as you
are not really allowed to write to the Program Files Directory; there
is an AppData system directory that should be used.

Suggestion:

In anycase accepted all the defaults; and then opening the web ui was
not successful. Running the start geosever short cut did not help;
opening up the services control pannel allowed me to start geoserver
... however
- http://localhost:8080/geoserver produces a 504 SERVICE Unavailable
- http://localhost:8080/ does respond with a javadoc and geoserver link

So Jetty appears to be started (when I do so manually); but the war is
not working....
Jody

On Sat, Apr 25, 2009 at 6:20 AM, Mike Pumphrey <mike@anonymised.com> wrote:

Hi everyone. I have created a test run of the new Windows installer, based
on 1.7.3. Give it a whirl.

http://atlas.openplans.org/~mike/GeoServer_1.7.3_newinstaller.exe

Since I know that many people here don't have access to a Windows box, I've
attached screenshots. Here's the workflow:

First is the splash screen (01), followed the by the welcome (02). If you
are not running as an admin, the installer will abort (03), otherwise the
license screen will show up (04). Next is the typical "where to install"
page (05) and Start Menu location page (06). After that, the installer will
ask for the location of the JDK (07), auto-populating the field with the
%JAVA_HOME% variable, if it exists. The installer won't continue if it
can't find a valid JDK (08). After this check, it asks for the location of
the data directory (09), auto-populating this field with the
%GEOSERVER_DATA_DIR% variable, if it exists. If it doesn't exist, the field
will be populated with $INSTDIR\data_dir (i.e. the location of the built-in
data directory after install), so this field is never empty. If you specify
another directory, it will checked to see if it is valid and error if not
(10), and if good, will say that it is using an existing data directory
(11). If using the built-in da
ta directory, this installer will allow you to change the admin username and
password (12). (This won't happen if using an existing data directory, so
as to prevent clobbering existing security settings.) Finally, one final
page allows for reviewing of settings (13), and after install, a final
screen shows success (14).

This will install GeoServer as a service. It's not set to automatic
startup, although that's easily changed. The Start Menu items are
unchanged, although now they start/stop the service. When starting and
stopping, a command line window shows up momentarily ("Starting/Stopping
GeoServer 1.7.3") but then goes away! Hoorah!
The program now shows up on the Add/Remove Programs list, although the
Uninstaller file remains in the Start Menu.

But anyway, assuming the user has a JDK installed and set up, the user only
needs to keep clicking Next, and GeoServer will be installed on their
system. :slight_smile:

Some of the suggestions made on this thread haven't been implemented yet
(JAI checks, silent installer), but I wanted to get some of the basics
nailed down first. Please test and let me know if there's anything that
should be changed. Thanks to everyone who has helped me get started pushing
this rock over the hill.

P.S. For anyone who reads NSIS, also attached is the script used to generate
the installer. I wanted to get feedback on workflow before committing
anything.

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

Mike Pumphrey wrote:

Oh one more thing to add: GeoServer should appear as an entry in the
Add/Remove Programs listing...

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

Mike Pumphrey wrote:

It's no secret that the current Windows GeoServer installer and
executable is a bit rough around the edges. It works, but it isn't as slick
as it could be. For one thing, GeoServer isn't installed as a service, and
the fact that the command prompt pops up and stays there is definitely
sub-optimal. :slight_smile:

GeoServer works with the Java Service Wrapper (albeit with a little bit
of tweaking) so it's very possible to use the BIN version of GeoServer, add
in some wrapper config, and a perfectly good service we have.

So, with all this in mind, I'd like to solicit opinions about what people
like and dislike in the Windows GeoServer experience, both with the
installer and with running GeoServer. (Just the EXE I'm curious about here;
I know some people use the BIN and WAR in Windows.)

I'm also designing a new flowchart for the installer. Here's what I have
so far: (After making this list, I found that this is pretty much
screen-by-screen identical to what Tomcat does for its installation process
which is auspicious.)

-----

1. Splash screen
2. Welcome screen
3. Find %JAVA_HOME%
3a. If found, display window
3b. If not found, prompt for location, set in environment variable, add
%JAVA_HOME%\bin to path.
4. License screen
5. Components screen - Two check boxes: [GeoServer (mandatory), data
directory (optional)]
6. Program file destination screen
7. Find %GEOSERVER_DATA_DIR%
7a. If found, display window with dropdown [use this, change this]
7a1. If [change this] go to Select Data Dir, otherwise skip
7b. If not found, go to Select Data Dir
8. Select Data Dir - Type in a location (with validation?)
9. Install as service screen [automatic, manual]
10. Start Menu screen
11. Ready to install screen
12. Install stuff
13. Finished screen

-----

Things to note:
(3b) adds %JAVA_HOME%\bin to the path. This is what we want to do,
right?
(5) makes installing the built-in data dir optional. What do you think
of this?
(9) I would think the default should be automatic, right?
I'm not 100% sure that everything here is possible, but NSIS seems
pretty elastic, so I'm hopeful.

Feedback is practically begged for.

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and around Java
(TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. Use priority
code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

; GeoServer Windows installer creation file.

; Define your application name
!define APPNAME "GeoServer"
!define APPNAMEANDVERSION "GeoServer 1.7.3"

; Main Install settings
Name "${APPNAMEANDVERSION}"
InstallDir "$PROGRAMFILES\${APPNAMEANDVERSION}"
InstallDirRegKey HKLM "Software\${APPNAME}" ""
OutFile "${APPNAMEANDVERSION}.exe"

; Modern interface settings
!include "MUI.nsh"

!include "StrFunc.nsh"

; Might be the same as !define
Var "JavaHome"
Var "DataDir"
Var "DataNewOrUsed"
Var STARTMENU_FOLDER

; Install options page headers
LangString TEXT_JDK_TITLE ${LANG_ENGLISH} "Java Development Kit"
LangString TEXT_JDK_SUBTITLE ${LANG_ENGLISH} "Java Development Kit path
selection"
LangString TEXT_DATADIR_TITLE ${LANG_ENGLISH} "GeoServer Data Directory"
LangString TEXT_DATADIR_SUBTITLE ${LANG_ENGLISH} "GeoServer Data Directory
path selection"
LangString TEXT_READY_TITLE ${LANG_ENGLISH} "Ready to Install"
LangString TEXT_READY_SUBTITLE ${LANG_ENGLISH} "GeoServer is ready to be
installed"
LangString TEXT_CREDS_TITLE ${LANG_ENGLISH} "GeoServer Administrator"
LangString TEXT_CREDS_SUBTITLE ${LANG_ENGLISH} "Set administrator
credentials"

;Interface Settings
!define MUI_ICON "webapps\geoserver\images\gs.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\win-uninstall.ico"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_RIGHT
!define MUI_HEADERIMAGE_BITMAP header.bmp
!define MUI_WELCOMEFINISHPAGE_BITMAP side_left.bmp

;Start Menu Folder Page Configuration
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\${APPNAME}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"

; "Are you sure you wish to cancel" popup.
!define MUI_ABORTWARNING

; Optional welcome text here
!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the
installation of GeoServer 1.7.3. \r\n\r\n\
It is recommended that you close all other applications before
starting Setup.\
This will make it possible to update relevant system files without
having to reboot your computer.\r\n\r\n\
Please report any problems or suggestions to the GeoServer Users
mailing list: geoserver-users@anonymised.com \r\n\r\n\
Click Next to continue."

; What to do when done
; !define MUI_FINISHPAGE_RUN "$INSTDIR\wrapper.exe -t
./bin/wrapper/wrapper.conf"

; Install Page order
; This is the main list of installer things to do
!insertmacro MUI_PAGE_WELCOME ; Hello
Page custom CheckUserType ; Die if not
admin
!insertmacro MUI_PAGE_LICENSE "LICENSE.txt" ; Show license
!insertmacro MUI_PAGE_DIRECTORY ; Where to
install
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER ; Start menu
location
Page custom JavaCheck ; Check for
JDK
Page custom DataDirCheck ; Set data
directory
Page custom CredsCheck ; Will set
admin/password (if new install)
Page custom Ready ; Ready to
install page
!insertmacro MUI_PAGE_INSTFILES ; Actually do
the install
!insertmacro MUI_PAGE_FINISH ; Done

; Uninstall Page order
!insertmacro MUI_UNPAGE_CONFIRM ; Are you sure you wish to uninstall?
!insertmacro MUI_UNPAGE_INSTFILES ; Do the uninstall
!insertmacro MUI_UNPAGE_FINISH ; Done

; Set languages (first is default language)
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_RESERVEFILE_LANGDLL

; Startup tasks
Function .onInit

; Splash screen
SetOutPath $TEMP
File /oname=spltmp.bmp "splash.bmp"
advsplash::show 1500 500 0 -1 $TEMP\spltmp
;advsplash::show Delay FadeIn FadeOut KeyColor FileName
Pop $0 ; $0 has '1' if the user closed the splash screen early,
; has '0' if everything closed normally, and '-1' if some error
occurred.
Delete $TEMP\spltmp.bmp

; Extract install options from .ini files
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "jdk.ini"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "datadir.ini"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "creds.ini"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "ready.ini"

FunctionEnd

; Check the user type, and quit if it's not an administrator.
; Taken from Examples/UserInfo that ships with NSIS.
Function CheckUserType
ClearErrors
UserInfo::GetName
IfErrors Win9x
Pop $0
UserInfo::GetAccountType
Pop $1
StrCmp $1 "Admin" Admin NoAdmin

NoAdmin:
MessageBox MB_ICONSTOP "Sorry, you must have administrative rights in
order to install GeoServer"
Quit

Win9x:
MessageBox MB_ICONSTOP "This installer is not supported on Windows
9x/ME."
Quit

Admin:

FunctionEnd

; Find the %JAVA_HOME% used on the system, and put the result on the top of
the stack
; Will return an empty string if the path cannot be determined
Function findJavaPath

ClearErrors

ReadEnvStr $1 JAVA_HOME

IfErrors 0 FoundJDK

ClearErrors
; Commented out becasue it appears to not distinguish between JDKs and
JREs.
; ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment"
"CurrentVersion"
; ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$2"
"JavaHome"
; ReadRegStr $3 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$2"
"RuntimeLib"

FoundJDK:
IfErrors 0 NoErrors
StrCpy $1 ""

NoErrors:
ClearErrors
; Put the result in the stack
Push $1

FunctionEnd

; The page to specify the %JAVA_HOME% path.
Function JavaCheck
!insertmacro MUI_HEADER_TEXT "$(TEXT_JDK_TITLE)" "$(TEXT_JDK_SUBTITLE)"
CheckAgain:
Call findJavaPath
Pop $3
; This puts the JDK, if any, into the field...
!insertmacro MUI_INSTALLOPTIONS_WRITE "jdk.ini" "Field 2" "State" $3
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "jdk.ini"

   ; \.\.\.and reads it back in \(may be redundant\)

!insertmacro MUI_INSTALLOPTIONS_READ $3 "jdk.ini" "Field 2" "State"
IfFileExists "$3\bin\java.exe" NoErrors Errors

   Errors:

MessageBox MB_RETRYCANCEL|MB_ICONSTOP "No Java Development Kit (JDK)
found in folder:$\r$\n$3$\r$\nPress Retry to try again or Cancel to Exit."
IDRETRY CheckAgain IDCANCEL Kill

Kill:
MessageBox MB_OK "Setup will now exit. Please make sure you have a valid
JDK on your system."
Quit

NoErrors:
StrCpy "$JavaHome" $3

FunctionEnd

; Find the %GEOSERVER_DATA_DIR% used on the system, and put the result on
the top of the stack
; Will return an empty string if the path cannot be determined
Function findDataDirPath

ClearErrors
ReadEnvStr $1 GEOSERVER_DATA_DIR
IfErrors 0 NoErrors

StrCpy $1 "$INSTDIR\data_dir"

NoErrors:
ClearErrors
; Put the result in the stack
Push $1

FunctionEnd

Function DataDirCheck

   \!insertmacro MUI\_HEADER\_TEXT &quot;$\(TEXT\_DATADIR\_TITLE\)&quot;

"$(TEXT_DATADIR_SUBTITLE)"

CheckDirAgain:
Call findDataDirPath
Pop $4
; This puts the JDK, if any, into the field.
!insertmacro MUI_INSTALLOPTIONS_WRITE "datadir.ini" "Field 2" "State" $4
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "datadir.ini"

   ;\.\.\.and reads it back in \(may be redundant\)

!insertmacro MUI_INSTALLOPTIONS_READ $4 "datadir.ini" "Field 2" "State"
IfFileExists "$4\catalog.xml" Exist Errors

Errors:
StrCmp "$4" "$INSTDIR\data_dir" ErrorNewDir ErrorBadDir

   ErrorNewDir:
     ; This is the dir that will be created, so it&#39;s okay that it

doesn't exist.
; MessageBox MB_OK "Setup will create a new data directory at the
following path:$\r$\n$4"
StrCpy $DataNewOrUsed "New"
Goto NoErrors

ErrorBadDir:
MessageBox MB_RETRYCANCEL|MB_ICONSTOP "No valid GeoServer data
directory found in folder:$\r$\n$4$\r$\nPress Retry to try again or Cancel
to Exit." IDRETRY CheckDirAgain IDCANCEL Kill

Kill:
MessageBox MB_OK "Setup will now exit."
Quit

Goto CheckDirAgain

   Exist:
     MessageBox MB\_OK &quot;Setup will use the existing data directory

at:$\r$\n$4"
StrCpy $DataNewOrUsed "Used"
Goto NoErrors

NoErrors:
StrCpy "$DataDir" $4

   ; Writes environment variable
   Push GEOSERVER\_DATA\_DIR

Push $DataDir
Call WriteEnvStr

FunctionEnd

; Page for setting admin username/password
; Will be skipped if using a pre-existing data dir
Function CredsCheck

StrCmp $DataNewOrUsed "Used" SkipCreds SetCreds

; New data directory, so can set credentials without harming existing setup
SetCreds:

     \!insertmacro MUI\_HEADER\_TEXT &quot;$\(TEXT\_CREDS\_TITLE\)&quot;

"$(TEXT_CREDS_SUBTITLE)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "creds.ini"

           ; Username \(admin\) to $6
     \!insertmacro MUI\_INSTALLOPTIONS\_READ $6 &quot;creds\.ini&quot; &quot;Field 3&quot;

"State"
; Password (geoserver) to $7
!insertmacro MUI_INSTALLOPTIONS_READ $7 "creds.ini" "Field 5" "State"

SkipCreds:
; Skip this process since existing data dir already has credentials set

FunctionEnd

; One final page to review options
Function Ready

!insertmacro MUI_HEADER_TEXT "$(TEXT_READY_TITLE)" "$(TEXT_READY_SUBTITLE)"

; Big long string with all the settings
StrCpy $9 "Java Development Kit (JDK) directory:\r\n
$JavaHome\r\n\r\nGeoServer install directory:\r\n
$INSTDIR\r\n\r\nGeoServer data directory:\r\n $DataDir"

!insertmacro MUI_INSTALLOPTIONS_WRITE "ready.ini" "Field 2" "Text" $9
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ready.ini"

FunctionEnd

; The main install section
Section "GeoServer" Main_Sec

   ; Makes this install mandatory, although not necessary as it&#39;s the

only section
SectionIn RO

   ; Set Section properties
   SetOverwrite on

   ; Set Section Files and Shortcuts
   SetOutPath &quot;$INSTDIR\\&quot;
   File /a start\.jar
   File /a GPL\.txt
   File /a LICENSE\.txt
   File /a README\.txt
   File /a RUNNING\.txt
   File /a wrapper\.exe
   File /a wrapper\-server\-license\.txt
   File /r data\_dir
   File /r bin
   File /r etc
   File /r lib
   File /r logs
   File /r resources
   File /r webapps

   StrCmp $DataNewOrUsed &quot;New&quot; WriteCreds NoWriteCreds

   ; New users\.properties file is created here
   WriteCreds:
           Delete &quot;$DataDir\\security\\users\.properties&quot;

FileOpen $R9 "$DataDir\security\users.properties" w
FileWrite $R9 "$6=$7,ROLE_ADMINISTRATOR"
FileClose $R9

   NoWriteCreds:

   ; Install the service

nsExec::Exec "$INSTDIR\wrapper.exe -i ./bin/wrapper/wrapper.conf"

!insertmacro MUI_STARTMENU_WRITE_BEGIN Application

;Create shortcuts
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
SetOutPath "$INSTDIR"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GeoServer Homepage.lnk" \
"http://geoserver.org"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GeoServer Web Admin
Page.lnk" \
"http://localhost:8080/geoserver&quot;
CreateShortCut '$SMPROGRAMS\$STARTMENU_FOLDER\Start GeoServer.lnk'
'"$INSTDIR\wrapper.exe"' '"-t" "bin/wrapper/wrapper.conf"'
'$INSTDIR\webapps\geoserver\images\gs.ico' 0
CreateShortCut '$SMPROGRAMS\$STARTMENU_FOLDER\Stop
GeoServer.lnk' '"$INSTDIR\wrapper.exe"' '"-p" "bin/wrapper/wrapper.conf"'
'$INSTDIR\webapps\geoserver\images\gs.ico' 0
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk"
"$INSTDIR\Uninstall.exe"

!insertmacro MUI_STARTMENU_WRITE_END

SectionEnd

; What happens at the end of the install.
Section -FinishSection

   WriteRegStr HKLM &quot;Software\\$\{APPNAME\}&quot; &quot;&quot; &quot;$INSTDIR&quot;
   WriteRegStr HKLM

"Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAMEANDVERSION}"
"DisplayName" "${APPNAMEANDVERSION}"
WriteRegStr HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAMEANDVERSION}"
"UninstallString" "$INSTDIR\uninstall.exe"
WriteUninstaller "$INSTDIR\uninstall.exe"

SectionEnd

; Commented out as there's only one install component
; Modern install component descriptions
; !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
; !insertmacro MUI_DESCRIPTION_TEXT ${Main_Sec} "Installs Geoserver
core components."
; !insertmacro MUI_FUNCTION_DESCRIPTION_END

; ----------------------------------
; Environment Variable stuff (start)

!ifndef _WriteEnvStr_nsh
!define _WriteEnvStr_nsh
!include WinMessages.nsh

!ifndef WriteEnvStr_RegKey
!ifdef ALL_USERS
!define WriteEnvStr_RegKey \
'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
!else
; This is hacked to set a System var, not a user var
!define WriteEnvStr_RegKey 'HKLM
"SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
!endif
!endif

# WriteEnvStr - Writes an environment variable
# Note: Win9x systems requires reboot
#
# Example:
# Push "HOMEDIR" # name
# Push "C:\New Home Dir\" # value
# Call WriteEnvStr
Function WriteEnvStr
Exch $1 ; $1 has environment variable value
Exch
Exch $0 ; $0 has environment variable name
Push $2

Call IsNT
Pop $2
StrCmp $2 1 WriteEnvStr_NT
; Not on NT
StrCpy $2 $WINDIR 2 ; Copy drive of windows (c:)
FileOpen $2 "$2\autoexec.bat" a
FileSeek $2 0 END
FileWrite $2 "$\r$\nSET $0=$1$\r$\n"
FileClose $2
SetRebootFlag true
Goto WriteEnvStr_done

WriteEnvStr_NT:
WriteRegExpandStr ${WriteEnvStr_RegKey} $0 $1
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} \
0 "STR:Environment" /TIMEOUT=5000

WriteEnvStr_done:
Pop $2
Pop $0
Pop $1
FunctionEnd

# un.DeleteEnvStr - Removes an environment variable
# Note: Win9x systems requires reboot
#
# Example:
# Push "HOMEDIR" # name
# Call un.DeleteEnvStr
Function un.DeleteEnvStr
Exch $0 ; $0 now has the name of the variable
Push $1
Push $2
Push $3
Push $4
Push $5

Call un.IsNT
Pop $1
StrCmp $1 1 DeleteEnvStr_NT
; Not on NT
StrCpy $1 $WINDIR 2
FileOpen $1 "$1\autoexec.bat" r
GetTempFileName $4
FileOpen $2 $4 w
StrCpy $0 "SET $0="
SetRebootFlag true

DeleteEnvStr_dosLoop:
FileRead $1 $3
StrLen $5 $0
StrCpy $5 $3 $5
StrCmp $5 $0 DeleteEnvStr_dosLoop
StrCmp $5 "" DeleteEnvStr_dosLoopEnd
FileWrite $2 $3
Goto DeleteEnvStr_dosLoop

DeleteEnvStr_dosLoopEnd:
FileClose $2
FileClose $1
StrCpy $1 $WINDIR 2
Delete "$1\autoexec.bat"
CopyFiles /SILENT $4 "$1\autoexec.bat"
Delete $4
Goto DeleteEnvStr_done

DeleteEnvStr_NT:
DeleteRegValue ${WriteEnvStr_RegKey} $0
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} \
0 "STR:Environment" /TIMEOUT=5000

DeleteEnvStr_done:
Pop $5
Pop $4
Pop $3
Pop $2
Pop $1
Pop $0
FunctionEnd

!ifndef IsNT_KiCHiK
!define IsNT_KiCHiK

;---------------------------------------

# [un.]IsNT - Pushes 1 if running on NT, 0 if not
#
# Example:
# Call IsNT
# Pop $0
# StrCmp $0 1 +3
# MessageBox MB_OK "Not running on NT!"
# Goto +2
# MessageBox MB_OK "Running on NT!"
#
!macro IsNT UN
Function ${UN}IsNT
Push $0
ReadRegStr $0 HKLM \
"SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
StrCmp $0 "" 0 IsNT_yes
; we are not NT.
Pop $0
Push 0
Return

IsNT_yes:
; NT!!!
Pop $0
Push 1
FunctionEnd
!macroend
!insertmacro IsNT ""
!insertmacro IsNT "un."

!endif ; IsNT_KiCHiK

!endif ; _WriteEnvStr_nsh

; Environment Variable stuff (end)
; ----------------------------------

;Uninstall section
Section Uninstall

Push GEOSERVER_DATA_DIR
Call un.DeleteEnvStr

   ;Remove from registry\.\.\.
   DeleteRegKey HKLM

"Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAMEANDVERSION}"
DeleteRegKey HKLM "SOFTWARE\${APPNAME}"

   ; Delete self
   Delete &quot;$INSTDIR\\uninstall\.exe&quot;

   ; Remove service

nsExec::Exec "$INSTDIR\wrapper.exe -r ./bin/wrapper/wrapper.conf"

   ; Delete Shortcuts
   RMDir /r &quot;$SMPROGRAMS\\$\{APPNAMEANDVERSION\}&quot;

   ; Clean up GeoServer
   RMDir /r &quot;$INSTDIR\\&quot;

SectionEnd

; This is the gray text on the bottom left of the installer.
; BrandingText "Where does this text go"

; eof
------------------------------------------------------------------------------
Crystal Reports &#45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty&#45;free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

In anycase accepted all the defaults; and then opening the web ui was
not successful. Running the start geosever short cut did not help;
opening up the services control pannel allowed me to start geoserver
... however
- http://localhost:8080/geoserver produces a 504 SERVICE Unavailable
- http://localhost:8080/ does respond with a javadoc and geoserver link

So Jetty appears to be started (when I do so manually); but the war is not working....

Tried running without vista access control turned on; service still
does not work. The uninstaller does work however :slight_smile:
Starting the install again with access control turned off; to see if
it makes a difference (it often does as it behaves more like windows
XP this way).

Went and had a look at the logs; looks to be endless troubles with the
threaded epsg authority (probably the system account cannot do temp
files or something?)

The last lines look a bit funny to me:
INFO | jvm 1 | 2009/04/25 14:50:01 | 16100 [WrapperSimpleAppMain]
INFO org.mortbay.log - Started SelectChannelConnector@anonymised.com:8080

I am used to 127.0.0.1 or something?
Jody

Jody Garnett wrote:

In anycase accepted all the defaults; and then opening the web ui was
not successful. Running the start geosever short cut did not help;
opening up the services control pannel allowed me to start geoserver
... however
- http://localhost:8080/geoserver produces a 504 SERVICE Unavailable
- http://localhost:8080/ does respond with a javadoc and geoserver link

So Jetty appears to be started (when I do so manually); but the war is not working....
    
Tried running without vista access control turned on; service still
does not work. The uninstaller does work however :slight_smile:
Starting the install again with access control turned off; to see if
it makes a difference (it often does as it behaves more like windows
XP this way).

Went and had a look at the logs; looks to be endless troubles with the
threaded epsg authority (probably the system account cannot do temp
files or something?)

The last lines look a bit funny to me:
INFO | jvm 1 | 2009/04/25 14:50:01 | 16100 [WrapperSimpleAppMain]
INFO org.mortbay.log - Started SelectChannelConnector@anonymised.com:8080

I am used to 127.0.0.1 or something?
Jody
  

0.0.0.0:8080 is normal, it means listen on all interfaces. If it said 127.0.0.1:8080 GeoServer would only be accessible from the machine itself.

You have a point though; do we need to make an exception in the Windows firewall?

-Arne

--
Arne Kepp
OpenGeo - http://opengeo.org
Expert service straight from the developers

Small follow up; "windows defender" had flagged the "java community
wrapper" for permission; so chances are windows was not allowing this
service all the permissions you expect. I am going to try again after
changing this to "permit".

Jody

On Sat, Apr 25, 2009 at 12:57 PM, Jody Garnett <jody.garnett@anonymised.com> wrote:

Hi Mike: I am going to try this one on vista for you (since doing a
sevice on vista is often a pain so I may catch something for you).

1. Initial prompted with the usual access control permission question
2. initial page looks great
3. license page is fine; I am used to a check box to enable the Next
button but whatever
4. directory etc okay
5. non pop up dialog to show the jdk is a great improvement
6. "Please select the path to your GeoServer data diregtory. Most
users should leave this unchanged"
7. Great work with the ability to change geoserver configuration user
name and password :slight_smile:

This is nice and short; but does not define who most users are. Perhaps:

"If you have previously set up a Geoserver configuration please
provide that path to your data directory; if this is your first time
using GeoServer an example configuration is provided below".

The default location of the data_dir causes problems in Vista; as you
are not really allowed to write to the Program Files Directory; there
is an AppData system directory that should be used.

Suggestion:

In anycase accepted all the defaults; and then opening the web ui was
not successful. Running the start geosever short cut did not help;
opening up the services control pannel allowed me to start geoserver
... however
- http://localhost:8080/geoserver produces a 504 SERVICE Unavailable
- http://localhost:8080/ does respond with a javadoc and geoserver link

So Jetty appears to be started (when I do so manually); but the war is
not working....
Jody

On Sat, Apr 25, 2009 at 6:20 AM, Mike Pumphrey <mike@anonymised.com> wrote:

Hi everyone. I have created a test run of the new Windows installer, based
on 1.7.3. Give it a whirl.

http://atlas.openplans.org/~mike/GeoServer_1.7.3_newinstaller.exe

Since I know that many people here don't have access to a Windows box, I've
attached screenshots. Here's the workflow:

First is the splash screen (01), followed the by the welcome (02). If you
are not running as an admin, the installer will abort (03), otherwise the
license screen will show up (04). Next is the typical "where to install"
page (05) and Start Menu location page (06). After that, the installer will
ask for the location of the JDK (07), auto-populating the field with the
%JAVA_HOME% variable, if it exists. The installer won't continue if it
can't find a valid JDK (08). After this check, it asks for the location of
the data directory (09), auto-populating this field with the
%GEOSERVER_DATA_DIR% variable, if it exists. If it doesn't exist, the field
will be populated with $INSTDIR\data_dir (i.e. the location of the built-in
data directory after install), so this field is never empty. If you specify
another directory, it will checked to see if it is valid and error if not
(10), and if good, will say that it is using an existing data directory
(11). If using the built-in da
ta directory, this installer will allow you to change the admin username and
password (12). (This won't happen if using an existing data directory, so
as to prevent clobbering existing security settings.) Finally, one final
page allows for reviewing of settings (13), and after install, a final
screen shows success (14).

This will install GeoServer as a service. It's not set to automatic
startup, although that's easily changed. The Start Menu items are
unchanged, although now they start/stop the service. When starting and
stopping, a command line window shows up momentarily ("Starting/Stopping
GeoServer 1.7.3") but then goes away! Hoorah!
The program now shows up on the Add/Remove Programs list, although the
Uninstaller file remains in the Start Menu.

But anyway, assuming the user has a JDK installed and set up, the user only
needs to keep clicking Next, and GeoServer will be installed on their
system. :slight_smile:

Some of the suggestions made on this thread haven't been implemented yet
(JAI checks, silent installer), but I wanted to get some of the basics
nailed down first. Please test and let me know if there's anything that
should be changed. Thanks to everyone who has helped me get started pushing
this rock over the hill.

P.S. For anyone who reads NSIS, also attached is the script used to generate
the installer. I wanted to get feedback on workflow before committing
anything.

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

Mike Pumphrey wrote:

Oh one more thing to add: GeoServer should appear as an entry in the
Add/Remove Programs listing...

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

Mike Pumphrey wrote:

It's no secret that the current Windows GeoServer installer and
executable is a bit rough around the edges. It works, but it isn't as slick
as it could be. For one thing, GeoServer isn't installed as a service, and
the fact that the command prompt pops up and stays there is definitely
sub-optimal. :slight_smile:

GeoServer works with the Java Service Wrapper (albeit with a little bit
of tweaking) so it's very possible to use the BIN version of GeoServer, add
in some wrapper config, and a perfectly good service we have.

So, with all this in mind, I'd like to solicit opinions about what people
like and dislike in the Windows GeoServer experience, both with the
installer and with running GeoServer. (Just the EXE I'm curious about here;
I know some people use the BIN and WAR in Windows.)

I'm also designing a new flowchart for the installer. Here's what I have
so far: (After making this list, I found that this is pretty much
screen-by-screen identical to what Tomcat does for its installation process
which is auspicious.)

-----

1. Splash screen
2. Welcome screen
3. Find %JAVA_HOME%
3a. If found, display window
3b. If not found, prompt for location, set in environment variable, add
%JAVA_HOME%\bin to path.
4. License screen
5. Components screen - Two check boxes: [GeoServer (mandatory), data
directory (optional)]
6. Program file destination screen
7. Find %GEOSERVER_DATA_DIR%
7a. If found, display window with dropdown [use this, change this]
7a1. If [change this] go to Select Data Dir, otherwise skip
7b. If not found, go to Select Data Dir
8. Select Data Dir - Type in a location (with validation?)
9. Install as service screen [automatic, manual]
10. Start Menu screen
11. Ready to install screen
12. Install stuff
13. Finished screen

-----

Things to note:
(3b) adds %JAVA_HOME%\bin to the path. This is what we want to do,
right?
(5) makes installing the built-in data dir optional. What do you think
of this?
(9) I would think the default should be automatic, right?
I'm not 100% sure that everything here is possible, but NSIS seems
pretty elastic, so I'm hopeful.

Feedback is practically begged for.

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and around Java
(TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. Use priority
code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

; GeoServer Windows installer creation file.

; Define your application name
!define APPNAME "GeoServer"
!define APPNAMEANDVERSION "GeoServer 1.7.3"

; Main Install settings
Name "${APPNAMEANDVERSION}"
InstallDir "$PROGRAMFILES\${APPNAMEANDVERSION}"
InstallDirRegKey HKLM "Software\${APPNAME}" ""
OutFile "${APPNAMEANDVERSION}.exe"

; Modern interface settings
!include "MUI.nsh"

!include "StrFunc.nsh"

; Might be the same as !define
Var "JavaHome"
Var "DataDir"
Var "DataNewOrUsed"
Var STARTMENU_FOLDER

; Install options page headers
LangString TEXT_JDK_TITLE ${LANG_ENGLISH} "Java Development Kit"
LangString TEXT_JDK_SUBTITLE ${LANG_ENGLISH} "Java Development Kit path
selection"
LangString TEXT_DATADIR_TITLE ${LANG_ENGLISH} "GeoServer Data Directory"
LangString TEXT_DATADIR_SUBTITLE ${LANG_ENGLISH} "GeoServer Data Directory
path selection"
LangString TEXT_READY_TITLE ${LANG_ENGLISH} "Ready to Install"
LangString TEXT_READY_SUBTITLE ${LANG_ENGLISH} "GeoServer is ready to be
installed"
LangString TEXT_CREDS_TITLE ${LANG_ENGLISH} "GeoServer Administrator"
LangString TEXT_CREDS_SUBTITLE ${LANG_ENGLISH} "Set administrator
credentials"

;Interface Settings
!define MUI_ICON "webapps\geoserver\images\gs.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\win-uninstall.ico"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_RIGHT
!define MUI_HEADERIMAGE_BITMAP header.bmp
!define MUI_WELCOMEFINISHPAGE_BITMAP side_left.bmp

;Start Menu Folder Page Configuration
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\${APPNAME}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"

; "Are you sure you wish to cancel" popup.
!define MUI_ABORTWARNING

; Optional welcome text here
!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the
installation of GeoServer 1.7.3. \r\n\r\n\
It is recommended that you close all other applications before
starting Setup.\
This will make it possible to update relevant system files without
having to reboot your computer.\r\n\r\n\
Please report any problems or suggestions to the GeoServer Users
mailing list: geoserver-users@anonymised.com \r\n\r\n\
Click Next to continue."

; What to do when done
; !define MUI_FINISHPAGE_RUN "$INSTDIR\wrapper.exe -t
./bin/wrapper/wrapper.conf"

; Install Page order
; This is the main list of installer things to do
!insertmacro MUI_PAGE_WELCOME ; Hello
Page custom CheckUserType ; Die if not
admin
!insertmacro MUI_PAGE_LICENSE "LICENSE.txt" ; Show license
!insertmacro MUI_PAGE_DIRECTORY ; Where to
install
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER ; Start menu
location
Page custom JavaCheck ; Check for
JDK
Page custom DataDirCheck ; Set data
directory
Page custom CredsCheck ; Will set
admin/password (if new install)
Page custom Ready ; Ready to
install page
!insertmacro MUI_PAGE_INSTFILES ; Actually do
the install
!insertmacro MUI_PAGE_FINISH ; Done

; Uninstall Page order
!insertmacro MUI_UNPAGE_CONFIRM ; Are you sure you wish to uninstall?
!insertmacro MUI_UNPAGE_INSTFILES ; Do the uninstall
!insertmacro MUI_UNPAGE_FINISH ; Done

; Set languages (first is default language)
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_RESERVEFILE_LANGDLL

; Startup tasks
Function .onInit

; Splash screen
SetOutPath $TEMP
File /oname=spltmp.bmp "splash.bmp"
advsplash::show 1500 500 0 -1 $TEMP\spltmp
;advsplash::show Delay FadeIn FadeOut KeyColor FileName
Pop $0 ; $0 has '1' if the user closed the splash screen early,
; has '0' if everything closed normally, and '-1' if some error
occurred.
Delete $TEMP\spltmp.bmp

; Extract install options from .ini files
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "jdk.ini"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "datadir.ini"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "creds.ini"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "ready.ini"

FunctionEnd

; Check the user type, and quit if it's not an administrator.
; Taken from Examples/UserInfo that ships with NSIS.
Function CheckUserType
ClearErrors
UserInfo::GetName
IfErrors Win9x
Pop $0
UserInfo::GetAccountType
Pop $1
StrCmp $1 "Admin" Admin NoAdmin

NoAdmin:
MessageBox MB_ICONSTOP "Sorry, you must have administrative rights in
order to install GeoServer"
Quit

Win9x:
MessageBox MB_ICONSTOP "This installer is not supported on Windows
9x/ME."
Quit

Admin:

FunctionEnd

; Find the %JAVA_HOME% used on the system, and put the result on the top of
the stack
; Will return an empty string if the path cannot be determined
Function findJavaPath

ClearErrors

ReadEnvStr $1 JAVA_HOME

IfErrors 0 FoundJDK

ClearErrors
; Commented out becasue it appears to not distinguish between JDKs and
JREs.
; ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment"
"CurrentVersion"
; ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$2"
"JavaHome"
; ReadRegStr $3 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$2"
"RuntimeLib"

FoundJDK:
IfErrors 0 NoErrors
StrCpy $1 ""

NoErrors:
ClearErrors
; Put the result in the stack
Push $1

FunctionEnd

; The page to specify the %JAVA_HOME% path.
Function JavaCheck
!insertmacro MUI_HEADER_TEXT "$(TEXT_JDK_TITLE)" "$(TEXT_JDK_SUBTITLE)"
CheckAgain:
Call findJavaPath
Pop $3
; This puts the JDK, if any, into the field...
!insertmacro MUI_INSTALLOPTIONS_WRITE "jdk.ini" "Field 2" "State" $3
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "jdk.ini"

   ; \.\.\.and reads it back in \(may be redundant\)

!insertmacro MUI_INSTALLOPTIONS_READ $3 "jdk.ini" "Field 2" "State"
IfFileExists "$3\bin\java.exe" NoErrors Errors

   Errors:

MessageBox MB_RETRYCANCEL|MB_ICONSTOP "No Java Development Kit (JDK)
found in folder:$\r$\n$3$\r$\nPress Retry to try again or Cancel to Exit."
IDRETRY CheckAgain IDCANCEL Kill

Kill:
MessageBox MB_OK "Setup will now exit. Please make sure you have a valid
JDK on your system."
Quit

NoErrors:
StrCpy "$JavaHome" $3

FunctionEnd

; Find the %GEOSERVER_DATA_DIR% used on the system, and put the result on
the top of the stack
; Will return an empty string if the path cannot be determined
Function findDataDirPath

ClearErrors
ReadEnvStr $1 GEOSERVER_DATA_DIR
IfErrors 0 NoErrors

StrCpy $1 "$INSTDIR\data_dir"

NoErrors:
ClearErrors
; Put the result in the stack
Push $1

FunctionEnd

Function DataDirCheck

   \!insertmacro MUI\_HEADER\_TEXT &quot;$\(TEXT\_DATADIR\_TITLE\)&quot;

"$(TEXT_DATADIR_SUBTITLE)"

CheckDirAgain:
Call findDataDirPath
Pop $4
; This puts the JDK, if any, into the field.
!insertmacro MUI_INSTALLOPTIONS_WRITE "datadir.ini" "Field 2" "State" $4
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "datadir.ini"

   ;\.\.\.and reads it back in \(may be redundant\)

!insertmacro MUI_INSTALLOPTIONS_READ $4 "datadir.ini" "Field 2" "State"
IfFileExists "$4\catalog.xml" Exist Errors

Errors:
StrCmp "$4" "$INSTDIR\data_dir" ErrorNewDir ErrorBadDir

   ErrorNewDir:
     ; This is the dir that will be created, so it&#39;s okay that it

doesn't exist.
; MessageBox MB_OK "Setup will create a new data directory at the
following path:$\r$\n$4"
StrCpy $DataNewOrUsed "New"
Goto NoErrors

ErrorBadDir:
MessageBox MB_RETRYCANCEL|MB_ICONSTOP "No valid GeoServer data
directory found in folder:$\r$\n$4$\r$\nPress Retry to try again or Cancel
to Exit." IDRETRY CheckDirAgain IDCANCEL Kill

Kill:
MessageBox MB_OK "Setup will now exit."
Quit

Goto CheckDirAgain

   Exist:
     MessageBox MB\_OK &quot;Setup will use the existing data directory

at:$\r$\n$4"
StrCpy $DataNewOrUsed "Used"
Goto NoErrors

NoErrors:
StrCpy "$DataDir" $4

   ; Writes environment variable
   Push GEOSERVER\_DATA\_DIR

Push $DataDir
Call WriteEnvStr

FunctionEnd

; Page for setting admin username/password
; Will be skipped if using a pre-existing data dir
Function CredsCheck

StrCmp $DataNewOrUsed "Used" SkipCreds SetCreds

; New data directory, so can set credentials without harming existing setup
SetCreds:

     \!insertmacro MUI\_HEADER\_TEXT &quot;$\(TEXT\_CREDS\_TITLE\)&quot;

"$(TEXT_CREDS_SUBTITLE)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "creds.ini"

           ; Username \(admin\) to $6
     \!insertmacro MUI\_INSTALLOPTIONS\_READ $6 &quot;creds\.ini&quot; &quot;Field 3&quot;

"State"
; Password (geoserver) to $7
!insertmacro MUI_INSTALLOPTIONS_READ $7 "creds.ini" "Field 5" "State"

SkipCreds:
; Skip this process since existing data dir already has credentials set

FunctionEnd

; One final page to review options
Function Ready

!insertmacro MUI_HEADER_TEXT "$(TEXT_READY_TITLE)" "$(TEXT_READY_SUBTITLE)"

; Big long string with all the settings
StrCpy $9 "Java Development Kit (JDK) directory:\r\n
$JavaHome\r\n\r\nGeoServer install directory:\r\n
$INSTDIR\r\n\r\nGeoServer data directory:\r\n $DataDir"

!insertmacro MUI_INSTALLOPTIONS_WRITE "ready.ini" "Field 2" "Text" $9
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ready.ini"

FunctionEnd

; The main install section
Section "GeoServer" Main_Sec

   ; Makes this install mandatory, although not necessary as it&#39;s the

only section
SectionIn RO

   ; Set Section properties
   SetOverwrite on

   ; Set Section Files and Shortcuts
   SetOutPath &quot;$INSTDIR\\&quot;
   File /a start\.jar
   File /a GPL\.txt
   File /a LICENSE\.txt
   File /a README\.txt
   File /a RUNNING\.txt
   File /a wrapper\.exe
   File /a wrapper\-server\-license\.txt
   File /r data\_dir
   File /r bin
   File /r etc
   File /r lib
   File /r logs
   File /r resources
   File /r webapps

   StrCmp $DataNewOrUsed &quot;New&quot; WriteCreds NoWriteCreds

   ; New users\.properties file is created here
   WriteCreds:
           Delete &quot;$DataDir\\security\\users\.properties&quot;

FileOpen $R9 "$DataDir\security\users.properties" w
FileWrite $R9 "$6=$7,ROLE_ADMINISTRATOR"
FileClose $R9

   NoWriteCreds:

   ; Install the service

nsExec::Exec "$INSTDIR\wrapper.exe -i ./bin/wrapper/wrapper.conf"

!insertmacro MUI_STARTMENU_WRITE_BEGIN Application

;Create shortcuts
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
SetOutPath "$INSTDIR"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GeoServer Homepage.lnk" \
"http://geoserver.org"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GeoServer Web Admin
Page.lnk" \
"http://localhost:8080/geoserver&quot;
CreateShortCut '$SMPROGRAMS\$STARTMENU_FOLDER\Start GeoServer.lnk'
'"$INSTDIR\wrapper.exe"' '"-t" "bin/wrapper/wrapper.conf"'
'$INSTDIR\webapps\geoserver\images\gs.ico' 0
CreateShortCut '$SMPROGRAMS\$STARTMENU_FOLDER\Stop
GeoServer.lnk' '"$INSTDIR\wrapper.exe"' '"-p" "bin/wrapper/wrapper.conf"'
'$INSTDIR\webapps\geoserver\images\gs.ico' 0
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk"
"$INSTDIR\Uninstall.exe"

!insertmacro MUI_STARTMENU_WRITE_END

SectionEnd

; What happens at the end of the install.
Section -FinishSection

   WriteRegStr HKLM &quot;Software\\$\{APPNAME\}&quot; &quot;&quot; &quot;$INSTDIR&quot;
   WriteRegStr HKLM

"Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAMEANDVERSION}"
"DisplayName" "${APPNAMEANDVERSION}"
WriteRegStr HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAMEANDVERSION}"
"UninstallString" "$INSTDIR\uninstall.exe"
WriteUninstaller "$INSTDIR\uninstall.exe"

SectionEnd

; Commented out as there's only one install component
; Modern install component descriptions
; !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
; !insertmacro MUI_DESCRIPTION_TEXT ${Main_Sec} "Installs Geoserver
core components."
; !insertmacro MUI_FUNCTION_DESCRIPTION_END

; ----------------------------------
; Environment Variable stuff (start)

!ifndef _WriteEnvStr_nsh
!define _WriteEnvStr_nsh
!include WinMessages.nsh

!ifndef WriteEnvStr_RegKey
!ifdef ALL_USERS
!define WriteEnvStr_RegKey \
'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
!else
; This is hacked to set a System var, not a user var
!define WriteEnvStr_RegKey 'HKLM
"SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
!endif
!endif

# WriteEnvStr - Writes an environment variable
# Note: Win9x systems requires reboot
#
# Example:
# Push "HOMEDIR" # name
# Push "C:\New Home Dir\" # value
# Call WriteEnvStr
Function WriteEnvStr
Exch $1 ; $1 has environment variable value
Exch
Exch $0 ; $0 has environment variable name
Push $2

Call IsNT
Pop $2
StrCmp $2 1 WriteEnvStr_NT
; Not on NT
StrCpy $2 $WINDIR 2 ; Copy drive of windows (c:)
FileOpen $2 "$2\autoexec.bat" a
FileSeek $2 0 END
FileWrite $2 "$\r$\nSET $0=$1$\r$\n"
FileClose $2
SetRebootFlag true
Goto WriteEnvStr_done

WriteEnvStr_NT:
WriteRegExpandStr ${WriteEnvStr_RegKey} $0 $1
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} \
0 "STR:Environment" /TIMEOUT=5000

WriteEnvStr_done:
Pop $2
Pop $0
Pop $1
FunctionEnd

# un.DeleteEnvStr - Removes an environment variable
# Note: Win9x systems requires reboot
#
# Example:
# Push "HOMEDIR" # name
# Call un.DeleteEnvStr
Function un.DeleteEnvStr
Exch $0 ; $0 now has the name of the variable
Push $1
Push $2
Push $3
Push $4
Push $5

Call un.IsNT
Pop $1
StrCmp $1 1 DeleteEnvStr_NT
; Not on NT
StrCpy $1 $WINDIR 2
FileOpen $1 "$1\autoexec.bat" r
GetTempFileName $4
FileOpen $2 $4 w
StrCpy $0 "SET $0="
SetRebootFlag true

DeleteEnvStr_dosLoop:
FileRead $1 $3
StrLen $5 $0
StrCpy $5 $3 $5
StrCmp $5 $0 DeleteEnvStr_dosLoop
StrCmp $5 "" DeleteEnvStr_dosLoopEnd
FileWrite $2 $3
Goto DeleteEnvStr_dosLoop

DeleteEnvStr_dosLoopEnd:
FileClose $2
FileClose $1
StrCpy $1 $WINDIR 2
Delete "$1\autoexec.bat"
CopyFiles /SILENT $4 "$1\autoexec.bat"
Delete $4
Goto DeleteEnvStr_done

DeleteEnvStr_NT:
DeleteRegValue ${WriteEnvStr_RegKey} $0
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} \
0 "STR:Environment" /TIMEOUT=5000

DeleteEnvStr_done:
Pop $5
Pop $4
Pop $3
Pop $2
Pop $1
Pop $0
FunctionEnd

!ifndef IsNT_KiCHiK
!define IsNT_KiCHiK

;---------------------------------------

# [un.]IsNT - Pushes 1 if running on NT, 0 if not
#
# Example:
# Call IsNT
# Pop $0
# StrCmp $0 1 +3
# MessageBox MB_OK "Not running on NT!"
# Goto +2
# MessageBox MB_OK "Running on NT!"
#
!macro IsNT UN
Function ${UN}IsNT
Push $0
ReadRegStr $0 HKLM \
"SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
StrCmp $0 "" 0 IsNT_yes
; we are not NT.
Pop $0
Push 0
Return

IsNT_yes:
; NT!!!
Pop $0
Push 1
FunctionEnd
!macroend
!insertmacro IsNT ""
!insertmacro IsNT "un."

!endif ; IsNT_KiCHiK

!endif ; _WriteEnvStr_nsh

; Environment Variable stuff (end)
; ----------------------------------

;Uninstall section
Section Uninstall

Push GEOSERVER_DATA_DIR
Call un.DeleteEnvStr

   ;Remove from registry\.\.\.
   DeleteRegKey HKLM

"Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAMEANDVERSION}"
DeleteRegKey HKLM "SOFTWARE\${APPNAME}"

   ; Delete self
   Delete &quot;$INSTDIR\\uninstall\.exe&quot;

   ; Remove service

nsExec::Exec "$INSTDIR\wrapper.exe -r ./bin/wrapper/wrapper.conf"

   ; Delete Shortcuts
   RMDir /r &quot;$SMPROGRAMS\\$\{APPNAMEANDVERSION\}&quot;

   ; Clean up GeoServer
   RMDir /r &quot;$INSTDIR\\&quot;

SectionEnd

; This is the gray text on the bottom left of the installer.
; BrandingText "Where does this text go"

; eof
------------------------------------------------------------------------------
Crystal Reports &#45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty&#45;free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Hi Jody. Thanks so much for the Vista testing.

I think the 504 error may be the result of Java not being listed as an exception in the Firewall. (Now that I recall, I had similar errors until I added it as an exception.) In the next iteration, I'll make sure that the installer checks/sets this. Stay tuned...

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

Jody Garnett wrote:

Hi Mike: I am going to try this one on vista for you (since doing a
sevice on vista is often a pain so I may catch something for you).

1. Initial prompted with the usual access control permission question
2. initial page looks great
3. license page is fine; I am used to a check box to enable the Next
button but whatever
4. directory etc okay
5. non pop up dialog to show the jdk is a great improvement
6. "Please select the path to your GeoServer data diregtory. Most
users should leave this unchanged"
7. Great work with the ability to change geoserver configuration user
name and password :slight_smile:

This is nice and short; but does not define who most users are. Perhaps:

"If you have previously set up a Geoserver configuration please
provide that path to your data directory; if this is your first time
using GeoServer an example configuration is provided below".

The default location of the data_dir causes problems in Vista; as you
are not really allowed to write to the Program Files Directory; there
is an AppData system directory that should be used.

Suggestion:

In anycase accepted all the defaults; and then opening the web ui was
not successful. Running the start geosever short cut did not help;
opening up the services control pannel allowed me to start geoserver
... however
- http://localhost:8080/geoserver produces a 504 SERVICE Unavailable
- http://localhost:8080/ does respond with a javadoc and geoserver link

So Jetty appears to be started (when I do so manually); but the war is
not working....
Jody

On Sat, Apr 25, 2009 at 6:20 AM, Mike Pumphrey <mike@anonymised.com> wrote:

Hi everyone. I have created a test run of the new Windows installer, based
on 1.7.3. Give it a whirl.

http://atlas.openplans.org/~mike/GeoServer_1.7.3_newinstaller.exe

Since I know that many people here don't have access to a Windows box, I've
attached screenshots. Here's the workflow:

First is the splash screen (01), followed the by the welcome (02). If you
are not running as an admin, the installer will abort (03), otherwise the
license screen will show up (04). Next is the typical "where to install"
page (05) and Start Menu location page (06). After that, the installer will
ask for the location of the JDK (07), auto-populating the field with the
%JAVA_HOME% variable, if it exists. The installer won't continue if it
can't find a valid JDK (08). After this check, it asks for the location of
the data directory (09), auto-populating this field with the
%GEOSERVER_DATA_DIR% variable, if it exists. If it doesn't exist, the field
will be populated with $INSTDIR\data_dir (i.e. the location of the built-in
data directory after install), so this field is never empty. If you specify
another directory, it will checked to see if it is valid and error if not
(10), and if good, will say that it is using an existing data directory
(11). If using the built-in da
ta directory, this installer will allow you to change the admin username and
password (12). (This won't happen if using an existing data directory, so
as to prevent clobbering existing security settings.) Finally, one final
page allows for reviewing of settings (13), and after install, a final
screen shows success (14).

This will install GeoServer as a service. It's not set to automatic
startup, although that's easily changed. The Start Menu items are
unchanged, although now they start/stop the service. When starting and
stopping, a command line window shows up momentarily ("Starting/Stopping
GeoServer 1.7.3") but then goes away! Hoorah!
The program now shows up on the Add/Remove Programs list, although the
Uninstaller file remains in the Start Menu.

But anyway, assuming the user has a JDK installed and set up, the user only
needs to keep clicking Next, and GeoServer will be installed on their
system. :slight_smile:

Some of the suggestions made on this thread haven't been implemented yet
(JAI checks, silent installer), but I wanted to get some of the basics
nailed down first. Please test and let me know if there's anything that
should be changed. Thanks to everyone who has helped me get started pushing
this rock over the hill.

P.S. For anyone who reads NSIS, also attached is the script used to generate
the installer. I wanted to get feedback on workflow before committing
anything.

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

Mike Pumphrey wrote:

Oh one more thing to add: GeoServer should appear as an entry in the
Add/Remove Programs listing...

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

Mike Pumphrey wrote:

It's no secret that the current Windows GeoServer installer and
executable is a bit rough around the edges. It works, but it isn't as slick
as it could be. For one thing, GeoServer isn't installed as a service, and
the fact that the command prompt pops up and stays there is definitely
sub-optimal. :slight_smile:

GeoServer works with the Java Service Wrapper (albeit with a little bit
of tweaking) so it's very possible to use the BIN version of GeoServer, add
in some wrapper config, and a perfectly good service we have.

So, with all this in mind, I'd like to solicit opinions about what people
like and dislike in the Windows GeoServer experience, both with the
installer and with running GeoServer. (Just the EXE I'm curious about here;
I know some people use the BIN and WAR in Windows.)

I'm also designing a new flowchart for the installer. Here's what I have
so far: (After making this list, I found that this is pretty much
screen-by-screen identical to what Tomcat does for its installation process
which is auspicious.)

-----

1. Splash screen
2. Welcome screen
3. Find %JAVA_HOME%
3a. If found, display window
3b. If not found, prompt for location, set in environment variable, add
%JAVA_HOME%\bin to path.
4. License screen
5. Components screen - Two check boxes: [GeoServer (mandatory), data
directory (optional)]
6. Program file destination screen
7. Find %GEOSERVER_DATA_DIR%
7a. If found, display window with dropdown [use this, change this]
    7a1. If [change this] go to Select Data Dir, otherwise skip
7b. If not found, go to Select Data Dir
8. Select Data Dir - Type in a location (with validation?)
9. Install as service screen [automatic, manual]
10. Start Menu screen
11. Ready to install screen
12. Install stuff
13. Finished screen

-----

Things to note:
(3b) adds %JAVA_HOME%\bin to the path. This is what we want to do,
right?
(5) makes installing the built-in data dir optional. What do you think
of this?
(9) I would think the default should be automatic, right?
I'm not 100% sure that everything here is possible, but NSIS seems
pretty elastic, so I'm hopeful.

Feedback is practically begged for.

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and around Java
(TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. Use priority
code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

; GeoServer Windows installer creation file.

; Define your application name
!define APPNAME "GeoServer"
!define APPNAMEANDVERSION "GeoServer 1.7.3"

; Main Install settings
Name "${APPNAMEANDVERSION}"
InstallDir "$PROGRAMFILES\${APPNAMEANDVERSION}"
InstallDirRegKey HKLM "Software\${APPNAME}" ""
OutFile "${APPNAMEANDVERSION}.exe"

; Modern interface settings
!include "MUI.nsh"

!include "StrFunc.nsh"

; Might be the same as !define
Var "JavaHome"
Var "DataDir"
Var "DataNewOrUsed"
Var STARTMENU_FOLDER

; Install options page headers
LangString TEXT_JDK_TITLE ${LANG_ENGLISH} "Java Development Kit"
LangString TEXT_JDK_SUBTITLE ${LANG_ENGLISH} "Java Development Kit path
selection"
LangString TEXT_DATADIR_TITLE ${LANG_ENGLISH} "GeoServer Data Directory"
LangString TEXT_DATADIR_SUBTITLE ${LANG_ENGLISH} "GeoServer Data Directory
path selection"
LangString TEXT_READY_TITLE ${LANG_ENGLISH} "Ready to Install"
LangString TEXT_READY_SUBTITLE ${LANG_ENGLISH} "GeoServer is ready to be
installed"
LangString TEXT_CREDS_TITLE ${LANG_ENGLISH} "GeoServer Administrator"
LangString TEXT_CREDS_SUBTITLE ${LANG_ENGLISH} "Set administrator
credentials"

;Interface Settings
!define MUI_ICON "webapps\geoserver\images\gs.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\win-uninstall.ico"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_RIGHT
!define MUI_HEADERIMAGE_BITMAP header.bmp
!define MUI_WELCOMEFINISHPAGE_BITMAP side_left.bmp

;Start Menu Folder Page Configuration
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\${APPNAME}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"

; "Are you sure you wish to cancel" popup.
!define MUI_ABORTWARNING

; Optional welcome text here
!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the
installation of GeoServer 1.7.3. \r\n\r\n\
       It is recommended that you close all other applications before
starting Setup.\
       This will make it possible to update relevant system files without
having to reboot your computer.\r\n\r\n\
       Please report any problems or suggestions to the GeoServer Users
mailing list: geoserver-users@anonymised.com \r\n\r\n\
       Click Next to continue."

; What to do when done
; !define MUI_FINISHPAGE_RUN "$INSTDIR\wrapper.exe -t
./bin/wrapper/wrapper.conf"

; Install Page order
; This is the main list of installer things to do
!insertmacro MUI_PAGE_WELCOME ; Hello
Page custom CheckUserType ; Die if not
admin
!insertmacro MUI_PAGE_LICENSE "LICENSE.txt" ; Show license
!insertmacro MUI_PAGE_DIRECTORY ; Where to
install
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER ; Start menu
location
Page custom JavaCheck ; Check for
JDK
Page custom DataDirCheck ; Set data
directory
Page custom CredsCheck ; Will set
admin/password (if new install)
Page custom Ready ; Ready to
install page
!insertmacro MUI_PAGE_INSTFILES ; Actually do
the install
!insertmacro MUI_PAGE_FINISH ; Done

; Uninstall Page order
!insertmacro MUI_UNPAGE_CONFIRM ; Are you sure you wish to uninstall?
!insertmacro MUI_UNPAGE_INSTFILES ; Do the uninstall
!insertmacro MUI_UNPAGE_FINISH ; Done

; Set languages (first is default language)
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_RESERVEFILE_LANGDLL

; Startup tasks
Function .onInit

; Splash screen
SetOutPath $TEMP
File /oname=spltmp.bmp "splash.bmp"
advsplash::show 1500 500 0 -1 $TEMP\spltmp
       ;advsplash::show Delay FadeIn FadeOut KeyColor FileName
Pop $0 ; $0 has '1' if the user closed the splash screen early,
        ; has '0' if everything closed normally, and '-1' if some error
occurred.
Delete $TEMP\spltmp.bmp

; Extract install options from .ini files
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "jdk.ini"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "datadir.ini"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "creds.ini"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "ready.ini"

FunctionEnd

; Check the user type, and quit if it's not an administrator.
; Taken from Examples/UserInfo that ships with NSIS.
Function CheckUserType
ClearErrors
UserInfo::GetName
IfErrors Win9x
Pop $0
UserInfo::GetAccountType
Pop $1
StrCmp $1 "Admin" Admin NoAdmin

NoAdmin:
   MessageBox MB_ICONSTOP "Sorry, you must have administrative rights in
order to install GeoServer"
   Quit

Win9x:
   MessageBox MB_ICONSTOP "This installer is not supported on Windows
9x/ME."
   Quit

Admin:

FunctionEnd

; Find the %JAVA_HOME% used on the system, and put the result on the top of
the stack
; Will return an empty string if the path cannot be determined
Function findJavaPath

ClearErrors

ReadEnvStr $1 JAVA_HOME

IfErrors 0 FoundJDK

ClearErrors
; Commented out becasue it appears to not distinguish between JDKs and
JREs.
; ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment"
"CurrentVersion"
; ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$2"
"JavaHome"
; ReadRegStr $3 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$2"
"RuntimeLib"

FoundJDK:
IfErrors 0 NoErrors
StrCpy $1 ""

NoErrors:
ClearErrors
; Put the result in the stack
Push $1

FunctionEnd

; The page to specify the %JAVA_HOME% path.
Function JavaCheck
!insertmacro MUI_HEADER_TEXT "$(TEXT_JDK_TITLE)" "$(TEXT_JDK_SUBTITLE)"
CheckAgain:
       Call findJavaPath
Pop $3
       ; This puts the JDK, if any, into the field...
!insertmacro MUI_INSTALLOPTIONS_WRITE "jdk.ini" "Field 2" "State" $3
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "jdk.ini"

       ; ...and reads it back in (may be redundant)
!insertmacro MUI_INSTALLOPTIONS_READ $3 "jdk.ini" "Field 2" "State"
IfFileExists "$3\bin\java.exe" NoErrors Errors

       Errors:
   MessageBox MB_RETRYCANCEL|MB_ICONSTOP "No Java Development Kit (JDK)
found in folder:$\r$\n$3$\r$\nPress Retry to try again or Cancel to Exit."
IDRETRY CheckAgain IDCANCEL Kill

Kill:
   MessageBox MB_OK "Setup will now exit. Please make sure you have a valid
JDK on your system."
Quit

NoErrors:
   StrCpy "$JavaHome" $3

FunctionEnd

; Find the %GEOSERVER_DATA_DIR% used on the system, and put the result on
the top of the stack
; Will return an empty string if the path cannot be determined
Function findDataDirPath

ClearErrors
ReadEnvStr $1 GEOSERVER_DATA_DIR
IfErrors 0 NoErrors

StrCpy $1 "$INSTDIR\data_dir"

NoErrors:
   ClearErrors
   ; Put the result in the stack
   Push $1

FunctionEnd

Function DataDirCheck

       !insertmacro MUI_HEADER_TEXT "$(TEXT_DATADIR_TITLE)"
"$(TEXT_DATADIR_SUBTITLE)"

CheckDirAgain:
       Call findDataDirPath
Pop $4
       ; This puts the JDK, if any, into the field.
!insertmacro MUI_INSTALLOPTIONS_WRITE "datadir.ini" "Field 2" "State" $4
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "datadir.ini"

       ;...and reads it back in (may be redundant)
!insertmacro MUI_INSTALLOPTIONS_READ $4 "datadir.ini" "Field 2" "State"
IfFileExists "$4\catalog.xml" Exist Errors

Errors:
         StrCmp "$4" "$INSTDIR\data_dir" ErrorNewDir ErrorBadDir

       ErrorNewDir:
         ; This is the dir that will be created, so it's okay that it
doesn't exist.
         ; MessageBox MB_OK "Setup will create a new data directory at the
following path:$\r$\n$4"
               StrCpy $DataNewOrUsed "New"
               Goto NoErrors

ErrorBadDir:
         MessageBox MB_RETRYCANCEL|MB_ICONSTOP "No valid GeoServer data
directory found in folder:$\r$\n$4$\r$\nPress Retry to try again or Cancel
to Exit." IDRETRY CheckDirAgain IDCANCEL Kill

Kill:
   MessageBox MB_OK "Setup will now exit."
Quit

Goto CheckDirAgain

       Exist:
         MessageBox MB_OK "Setup will use the existing data directory
at:$\r$\n$4"
               StrCpy $DataNewOrUsed "Used"
         Goto NoErrors

NoErrors:
       StrCpy "$DataDir" $4

       ; Writes environment variable
       Push GEOSERVER_DATA_DIR
Push $DataDir
Call WriteEnvStr

FunctionEnd

; Page for setting admin username/password
; Will be skipped if using a pre-existing data dir
Function CredsCheck

StrCmp $DataNewOrUsed "Used" SkipCreds SetCreds

; New data directory, so can set credentials without harming existing setup
SetCreds:

         !insertmacro MUI_HEADER_TEXT "$(TEXT_CREDS_TITLE)"
"$(TEXT_CREDS_SUBTITLE)"
   !insertmacro MUI_INSTALLOPTIONS_DISPLAY "creds.ini"

               ; Username (admin) to $6
         !insertmacro MUI_INSTALLOPTIONS_READ $6 "creds.ini" "Field 3"
"State"
   ; Password (geoserver) to $7
   !insertmacro MUI_INSTALLOPTIONS_READ $7 "creds.ini" "Field 5" "State"

SkipCreds:
   ; Skip this process since existing data dir already has credentials set

FunctionEnd

; One final page to review options
Function Ready

!insertmacro MUI_HEADER_TEXT "$(TEXT_READY_TITLE)" "$(TEXT_READY_SUBTITLE)"

; Big long string with all the settings
StrCpy $9 "Java Development Kit (JDK) directory:\r\n
$JavaHome\r\n\r\nGeoServer install directory:\r\n
$INSTDIR\r\n\r\nGeoServer data directory:\r\n $DataDir"

!insertmacro MUI_INSTALLOPTIONS_WRITE "ready.ini" "Field 2" "Text" $9
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ready.ini"

FunctionEnd

; The main install section
Section "GeoServer" Main_Sec

       ; Makes this install mandatory, although not necessary as it's the
only section
       SectionIn RO

       ; Set Section properties
       SetOverwrite on

       ; Set Section Files and Shortcuts
       SetOutPath "$INSTDIR\"
       File /a start.jar
       File /a GPL.txt
       File /a LICENSE.txt
       File /a README.txt
       File /a RUNNING.txt
       File /a wrapper.exe
       File /a wrapper-server-license.txt
       File /r data_dir
       File /r bin
       File /r etc
       File /r lib
       File /r logs
       File /r resources
       File /r webapps

       StrCmp $DataNewOrUsed "New" WriteCreds NoWriteCreds

       ; New users.properties file is created here
       WriteCreds:
               Delete "$DataDir\security\users.properties"
   FileOpen $R9 "$DataDir\security\users.properties" w
         FileWrite $R9 "$6=$7,ROLE_ADMINISTRATOR"
   FileClose $R9

       NoWriteCreds:

       ; Install the service
nsExec::Exec "$INSTDIR\wrapper.exe -i ./bin/wrapper/wrapper.conf"

!insertmacro MUI_STARTMENU_WRITE_BEGIN Application

   ;Create shortcuts
   CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
   SetOutPath "$INSTDIR"
   CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GeoServer Homepage.lnk" \
                              "http://geoserver.org"
   CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GeoServer Web Admin
Page.lnk" \
                              "http://localhost:8080/geoserver&quot;
   CreateShortCut '$SMPROGRAMS\$STARTMENU_FOLDER\Start GeoServer.lnk'
'"$INSTDIR\wrapper.exe"' '"-t" "bin/wrapper/wrapper.conf"'
'$INSTDIR\webapps\geoserver\images\gs.ico' 0
               CreateShortCut '$SMPROGRAMS\$STARTMENU_FOLDER\Stop
GeoServer.lnk' '"$INSTDIR\wrapper.exe"' '"-p" "bin/wrapper/wrapper.conf"'
'$INSTDIR\webapps\geoserver\images\gs.ico' 0
   CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk"
"$INSTDIR\Uninstall.exe"

!insertmacro MUI_STARTMENU_WRITE_END

SectionEnd

; What happens at the end of the install.
Section -FinishSection

       WriteRegStr HKLM "Software\${APPNAME}" "" "$INSTDIR"
       WriteRegStr HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAMEANDVERSION}"
"DisplayName" "${APPNAMEANDVERSION}"
       WriteRegStr HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAMEANDVERSION}"
"UninstallString" "$INSTDIR\uninstall.exe"
       WriteUninstaller "$INSTDIR\uninstall.exe"

SectionEnd

; Commented out as there's only one install component
; Modern install component descriptions
; !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
; !insertmacro MUI_DESCRIPTION_TEXT ${Main_Sec} "Installs Geoserver
core components."
; !insertmacro MUI_FUNCTION_DESCRIPTION_END

; ----------------------------------
; Environment Variable stuff (start)

!ifndef _WriteEnvStr_nsh
!define _WriteEnvStr_nsh
!include WinMessages.nsh

!ifndef WriteEnvStr_RegKey
   !ifdef ALL_USERS
     !define WriteEnvStr_RegKey \
      'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
   !else
                       ; This is hacked to set a System var, not a user var
     !define WriteEnvStr_RegKey 'HKLM
"SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
   !endif
!endif

# WriteEnvStr - Writes an environment variable
# Note: Win9x systems requires reboot
#
# Example:
# Push "HOMEDIR" # name
# Push "C:\New Home Dir\" # value
# Call WriteEnvStr
Function WriteEnvStr
Exch $1 ; $1 has environment variable value
Exch
Exch $0 ; $0 has environment variable name
Push $2

Call IsNT
Pop $2
StrCmp $2 1 WriteEnvStr_NT
   ; Not on NT
   StrCpy $2 $WINDIR 2 ; Copy drive of windows (c:)
   FileOpen $2 "$2\autoexec.bat" a
   FileSeek $2 0 END
   FileWrite $2 "$\r$\nSET $0=$1$\r$\n"
   FileClose $2
   SetRebootFlag true
   Goto WriteEnvStr_done

WriteEnvStr_NT:
     WriteRegExpandStr ${WriteEnvStr_RegKey} $0 $1
     SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} \
       0 "STR:Environment" /TIMEOUT=5000

WriteEnvStr_done:
   Pop $2
   Pop $0
   Pop $1
FunctionEnd

# un.DeleteEnvStr - Removes an environment variable
# Note: Win9x systems requires reboot
#
# Example:
# Push "HOMEDIR" # name
# Call un.DeleteEnvStr
Function un.DeleteEnvStr
Exch $0 ; $0 now has the name of the variable
Push $1
Push $2
Push $3
Push $4
Push $5

Call un.IsNT
Pop $1
StrCmp $1 1 DeleteEnvStr_NT
   ; Not on NT
   StrCpy $1 $WINDIR 2
   FileOpen $1 "$1\autoexec.bat" r
   GetTempFileName $4
   FileOpen $2 $4 w
   StrCpy $0 "SET $0="
   SetRebootFlag true

   DeleteEnvStr_dosLoop:
     FileRead $1 $3
     StrLen $5 $0
     StrCpy $5 $3 $5
     StrCmp $5 $0 DeleteEnvStr_dosLoop
     StrCmp $5 "" DeleteEnvStr_dosLoopEnd
     FileWrite $2 $3
     Goto DeleteEnvStr_dosLoop

   DeleteEnvStr_dosLoopEnd:
     FileClose $2
     FileClose $1
     StrCpy $1 $WINDIR 2
     Delete "$1\autoexec.bat"
     CopyFiles /SILENT $4 "$1\autoexec.bat"
     Delete $4
     Goto DeleteEnvStr_done

DeleteEnvStr_NT:
   DeleteRegValue ${WriteEnvStr_RegKey} $0
   SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} \
     0 "STR:Environment" /TIMEOUT=5000

DeleteEnvStr_done:
   Pop $5
   Pop $4
   Pop $3
   Pop $2
   Pop $1
   Pop $0
FunctionEnd

!ifndef IsNT_KiCHiK
!define IsNT_KiCHiK

;---------------------------------------

# [un.]IsNT - Pushes 1 if running on NT, 0 if not
#
# Example:
# Call IsNT
# Pop $0
# StrCmp $0 1 +3
# MessageBox MB_OK "Not running on NT!"
# Goto +2
# MessageBox MB_OK "Running on NT!"
#
!macro IsNT UN
Function ${UN}IsNT
Push $0
ReadRegStr $0 HKLM \
   "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
StrCmp $0 "" 0 IsNT_yes
; we are not NT.
Pop $0
Push 0
Return

IsNT_yes:
   ; NT!!!
   Pop $0
   Push 1
FunctionEnd
!macroend
!insertmacro IsNT ""
!insertmacro IsNT "un."

!endif ; IsNT_KiCHiK

!endif ; _WriteEnvStr_nsh

; Environment Variable stuff (end)
; ----------------------------------

;Uninstall section
Section Uninstall

Push GEOSERVER_DATA_DIR
Call un.DeleteEnvStr

       ;Remove from registry...
       DeleteRegKey HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAMEANDVERSION}"
       DeleteRegKey HKLM "SOFTWARE\${APPNAME}"

       ; Delete self
       Delete "$INSTDIR\uninstall.exe"

       ; Remove service
nsExec::Exec "$INSTDIR\wrapper.exe -r ./bin/wrapper/wrapper.conf"

       ; Delete Shortcuts
       RMDir /r "$SMPROGRAMS\${APPNAMEANDVERSION}"

       ; Clean up GeoServer
       RMDir /r "$INSTDIR\"

SectionEnd

; This is the gray text on the bottom left of the installer.
; BrandingText "Where does this text go"

; eof
------------------------------------------------------------------------------
Crystal Reports &#45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty&#45;free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

I think the 504 error may be the result of Java not being listed as an
exception in the Firewall.

That cannot be the case as Jetty is answering requests sent to the
base localhost:8080 URL.

(Now that I recall, I had similar errors until I added it as an exception.) In the next iteration, I'll make sure that the
installer checks/sets this. Stay tuned...

I have this exception for Java in the firewall.

Jody

Hi Jody. I haven't forgotten about either this project or your suggestions, however I haven't had much time to devote to this recently. In the meantime, I've committed the artifacts for the new Windows installer to svn, along-side the old one, for now.

https://svn.codehaus.org/geoserver/branches/1.7.x/src/release/installer/winv2/
https://svn.codehaus.org/geoserver/trunk/src/release/installer/winv2/

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

Jody Garnett wrote:

I think the 504 error may be the result of Java not being listed as an
exception in the Firewall.

That cannot be the case as Jetty is answering requests sent to the
base localhost:8080 URL.

(Now that I recall, I had similar errors until I added it as an exception.) In the next iteration, I'll make sure that the
installer checks/sets this. Stay tuned...

I have this exception for Java in the firewall.

Jody