This post in in response to a question from the author of Automatic Variants (Leviathan1753) in thehttp://www.gamesas.com/topic/1387039-relwip-automatic-variants-thread-7/page__st__90 where he asked about the possibilies for a Windows installer for AV and how to check if a certain Java version is installed on the users system (AV needs Java 7). Given the fact that the userbase who reads/follow the AV thread is in my experience relative small I thought I repost it here.
I'm very interested if better solutions exist and would like to have a bit more information about NMM and the FOMOD format used by it. Also I would like to have your opinion about the matter. Is this a good thing or is it evil. If so why do you think its good and why bad?
I only know of two mods which have real (windows) installers (use them both): RCRN and Wrye Bash. Others seem to be using the scripting of NMM (FOMOD ??) . The first does not feel like a windows installer but looks like something they have built themselves (could be wrong). The latter does use one of the (many free) windows installers.
Because I didn't want to rewrite the post I just post here what I posted in the AV thread. Here it comes.
Original AV thread.
"@Leviathan1753. You asked me about windows installers and I have given some general information. Haven't seen any response from you so don't know what you have decided to do. As my main system is still down (getting Skyrim Withdrawal symptoms) and got bored (sometimes a good thing/motivation to check new things) I decided to do a bit more digging.
I started by looking how to check for a certain Java version when a (java) program starts. Because the README of AV on the Nexus says it needs Java7. Up to AV 1.4.2.2 it works like a charm with Java 6, don't now if the Nexus version REALLY needs Java7 or its just to be ready for future enhancements for AV and or Skyproc. Plutomans ASIS and SkyBash (and perhaps his forked Skyproc) DOES need Java7 otherwise it won't start and results in an Java exception.
If you want to go the full windows installer route.
NSIS (no pretty user interface for building installer but very very powerful) might be a good candidate because it allows you to check for a certain Java version etc. Others might be able to do as well, but in my initial search for 'check Java version' found this one . A script example can be found http://nsis.sourceforge.net/Java_Launcher_with_automatic_JRE_installation. You have to do the hard work once, with newer AV versions (same structure) just reuse the installer script/setup. You can place shortcuts on desktop to execute AV, or open the dir where AV resides, execute AV (optionally) at end of the installer etc etc.
Advantage: full control over installation.
Disadvantage: Some people prefer NMM or WB to install mods because it allows them to have one place to manage their mods, check for new versions etc....
Remark: At the end of my search journey and writing this thread I found http://izpack.org/which is a windows installer for Java programs which seems to be able to do everything NSIS does BUT has the advantage of having a nice GUI to built the installers
If you want to be able to make sure the correct Java JRE is installed when launching AV.
Launch4j is a cross-platform tool for wrapping Java applications distributed as jars in lightweight Windows native executables. You distribute an automatic variants.exe which contains automatic variants.jar. On startup it checks the installed JRE version (using registry,path etc, can also set environment variables) if no suitable one is found it can point to a website to obtain the JRE.
Advantage: You can use NMM to install the mod. I believe for complicated mods like Bellyache
which allows you to choose in a window certain options FOMOD (scripting language I guess) is used. Unknown if this allows you to call the .exe file after install. If so easy way to install AV and execute it. Don't think FOMOD works with Wrye Bash. If you don't want to use/learn FOMOD you can still use create a NMM package (very easy) to install AV and use NMM to check for newer AV versions. New AV version check could be built into AV of course. If you want ppl to install AV manually, you still have the advantage that Automatic Variants.exe checks for correct JRE.
Disadvantage: WB won't allow .exe files to be installed, security issues. Discussion ongoing on the Wrye Bash thread to allow Skyproc based programs to be installable with WB. Because skyproc based programs use java (.jar) which can also be a security risk. Iirc a newer version of WB will probably allow it by showing a warning message.
Please reread my older post and specifically the http://www.techsupportalert.com/content/best-free-setup-builder.htmto an overview of freeware windows installers.
Urls visited to get the information which ended up creating this post. I encourage you to check them out. It might be that you prefer another way to check for JRE version etc. Multiple solutions exists.
In the order of found urls when I started searching:
http://www.google.nl/search?q=windows+code+check+java+version. VERY general, starting point.
http://stackoverflow.com/questions/222187/how-to-check-jre-version-prior-to-launch. To the point. Several methods discussed, here I found Launch4J.
http://javatester.org/version.html. Generic. How to test for Java versions in general, using Java, windows, browser solution (Javascript).
http://launch4j.sourceforge.net/index.html. Launch4J website. Has support for 64 bit systems.
http://stackoverflow.com/questions/1967549/java-packaging-tools-alternatives-for-jsmooth-launch4j-onejar. like Jsmooth and onejar. Very usefull. Here I found LzPack. Another Windows installer, useable for JRE checking (it seems).
http://izpack.org/. quote "IzPack is a widely used tool for packaging applications on the Java? platform. Easily make installers that work seamlessly on Microsoft Windows?, Linux?, Solaris? and Mac OS X?"
I think that the above is enough to have a very user friendly way to allow ppl to use AV and reduce the number of questions in the Nexus thread. There might be much better alternatives (haven't got totally nuts in my search) but this is what I found.
Perhaps the users here can give their opinion what they prefer and perhaps have better alternatives. But perhaps the current userbase which follows this thread and reponds is to small. I might consider creating a seperate thread for this disucssion.
I think the usage is not restricted to AV but can be used for other Skyproc Based programs as well or even other mods."

