Custom spark build, missing server and port option?

I am working on a custom build of Spark for our Windows people, I have got almost everything done that I needed from the various documents I found, just a couple more things I have not been able to find.

  1. How do I lock in the server IP and Port? I already have put in our hostname in src/java/org/jivesoftware/resource/default.properties

  2. After I run “ant”, for testing I am navigating to the target/build/bin and running startup.bat on my test windows VM. and while this works. How do I make the console not show up? Also is there an easier way to run this one windows after I build it, with out requiring a user to install anything?

So after I ran “ant”, I ran startup.bat, went into advanced, set my IP and Port, logged in and then logged out. I now see in C:\Documents and Settings\admin\Application Data\Spark\spark.properties, the 3 fields that I need.

  1. xmppPort=1234
  2. hostAndPort=true
  3. xmppHost=1.2.3.4

Now to just figure out how to hard code those prior to building so I can lockout the advanced tab.

  1. by putting in the HOST_NAME from default.properties, it should hardcode that into the build, then set HOST_NAME_CHANGE_DISABLED = true to prevent chagnes… then you probably want to set ADVANCED_DISABLED = true to remove the Advanced menu button (this will prevent anyone from mucking up your settings)

  2. its running from the console since you launched it by the bat file… this automagically runs a cmd prompt… if you assemble it into a .exe installer using something like Advanced Installer or else, then it will install properly and you wont see the console window while running spark.

Here’s a great link on how to accomplish making your own installer package (you can also make a .msi which is easier to work with and deploy via GPO’s in active direcotry if you have that setup at your place… but .msi’s are supported for deployment from the OpenFire server yet… so pick your poison (really just comes down to how you plan to deploy it).

http://community.igniterealtime.org/thread/48931

skip to the “Rebranding” and “Final Step” sections – this guide will produce a .msi for you…

At my company we wanted to deploy the new custom spark build via OpenFire (since spark will check for updates and fetch it from the server if you have it setup) – this required a .exe instead of a .msi – so we put our .msi into a folder and zipped it – then used the free program “Zip 2 Secure EXE Creator” – this takes your zip, and creates a self extracting .exe file out of it. You specify what to do after extraction, so just set it to run your .msi file… You can even change the icon file for the .exe to whatever you want. –

1 Like
  1. Yep, I am already using HOST_NAME and HOST_NAME_CHANGE_DISABLED, however our hostname is different than our openfire server IP. And no we can not get dns updated for our domain as they see that as a security issue.

I fixed this by LoginDiaglog.java, and just hardcoding the IP address in there and taking out getXmppHost.

  1. Yes I am launching it from the bat file for testing But for the end product, I guess my question was not clear enough, or I don’t understand the answer well enough. We do not want a user to have to install anything, we just want like to be able to just send them a file, then put it on their desktop or whatever and just launch from there. Our ultimate goal is to somehow “publish” this to our internal portal/wiki and they can just click on it there and it will download and launch with out installing the actual spark client.

P.S., I am do not like/use Windows… so bare with me on the windows questions. Thanks!

no worries on the windows stuff

  1. I think you can specify an IP address where it says HOST_NAME in the properties file – at least for me I can connect to my openfire installation via IP address if I type it into the Host box on the login screen – but I have not tried putting an IP into the properties file – i don’t see why it wouldn’t work…

Also, it sounds like they are pretty set on the server host name, etc. its a shame, since if you hard code in an IP address, what happens if that address isn’t available sometime in the future? machine has problems or gets reused for soemthing different, – etc. the host name would allow you to point the clients to the right server by just updating DNS… anyways… i digress…

Just a tip for you: In my experience, Spark does not care if its is pointed at an IP address, FQDN Host name, or Internal (Non-FQDN) HOst name, – as long as the port 5222 traffic (or whatever port you set it to) gets to the server, it will connect. Openfire (the server side) is more picky and it must have a FQDN in its config.

what this means, is you can have your server’s hostname be something different than what you points your clients to. So if you had another unsed Host Name or Alias, it should work and help hide the statically set IP address… just my 2 cents.

  1. This is a bit more tricky – without building the installer I think you will have to deal with the cmd prompt window. Its how windows runs bat (batch) files… much in the way the *nix’s run shell scripts. Except in windows, it will actually dispaly the console while its running the script. There’s way to make the console launch minimized, but its still there. You can also have the spark run as a different user thats not logged in, the console (cmd prompt) will actually still launch and be open while Spark is running, but the logged in user wont see it since the console is actually running under a different profile. This is a trick windows admins use for hiding batch scripts from users. Create a user account that wont actually be used except for runnign your batch script… but this isn’t practical for a lot of reasons.

You could also deploy the program via GPO’s if you have Active Directory – so i guess we should ask, are you deploying Spark to customers outside your intranet, or is this internal use only? if its internal, then deployment will be a lot easier lol… if its external, i dont’ see a way outside building an installer. There’s Jar files you can run that will kick spark off and might run ok… but the scipts do a bunch of environment checking, profile setup and other stuff at launch…

If the IP ever changes I will just have to build new clients(it is on a VM guest that can vm motion), but I am working on a long term solution. Working on standing up a socks proxy and then I will point all clients to it and then they will resolve the DNS properly.

So under the build directory if I run “ant -p” I see different install. options, I installed izpack on my desktop(Ubuntu 12.04) but not sure where to go from here. I am not using eclipse, could not get past on of the steps on the how to page for setting up eclipse with openfire, just good old vi and ant.

Ok, so I got launch4j and izpack installed. When I run “ant install.izpack” I get the following error:

net.sf.launch4j.BuilderException: net.sf.launch4j.ExecException: java.io.IOException: Cannot run program “./bin/windres”: error=2, No such file or directory

However, windres is in my launch4j path.