RFI: Windows installers for Skyproc based (Java) programs li

Post » Fri Jul 13, 2012 4:59 am

RFI: request for information.

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."
User avatar
Miranda Taylor
 
Posts: 3406
Joined: Sat Feb 24, 2007 3:39 pm

Post » Fri Jul 13, 2012 6:24 am

Well, if support from the WB team is given I would say easiest would be if WB itself checked the PCs java version whenever something with a .jar gets installed and gives a warning if out of date.

This is as simple as running command line 'java -version' and parsing the string returned. If it says invalid command, no java and should suggest going to java site. If the version is < 1.7 then suggest updating.

That said this isn't a solution for NMM and requires WB to explicitly support a specific mod with all of the support issues that brings. Even better would be if executing the .jar it tests itself and gives a warning. It would refuse to run at all if no java, but would it run far enough to run a check and return a message and quit if its simply old? Honestly I'm not too much of a fan of including .exe's and .dlls with EVERY mod that uses SkyProc in case the user refuses to read the description (how did he even know to manually run the .jar in this case?) and make sure his java is up to date. Perhaps if its only a couple of kb, but otherwise a more lightweight solution is needed.

All this said, the best solution would be simply if people read the readme's. Which, if they know to even run the .jars in the first place instead of installing and forgetting, they would have.

If SkyProc gets enough support that Bashed patch makers actually starts detecting and running SkyProc Patchers automatically as part of its rebuild patch operation, something that makes sense to me but I think has no plans right now, THEN detecting java version and all that becomes very important. Perhaps even properly sandboxing the .jar for security reasons to prevent it having any IO access outside the Data directory and stuff like that. But it would be the duty of the Bash Patcher in those cases, not the individual SkyProc jar.

I'd like to hear from pluto about the possibility that SkyBash could do something like this in the future. Would certainly save me some clicks, since right now any mod changes that forces me to rebuild the patch, ALSO means I should rerun every SkyProc Patcher. I cannot think of many cases where you'd want to do one but not the other.

EDIT: Okay, I prolly shoulda said. I'm against the windows installer route. I use WB and it works well. I would hate it if AV and other SkyProc related mods ever REQUIRED non-WB installation methods. I am already annoyed that ENB requires the manual install route. Still means that a windows installer could be an ALTERNATIVE method of installation, but a WB route should remain supported.
User avatar
Austin Suggs
 
Posts: 3358
Joined: Sun Oct 07, 2007 5:35 pm

Post » Thu Jul 12, 2012 4:28 pm

@Antagonostic. Thanks for your response. I hope more people will reply also ;-)

Checking Java version is a bit more complicated than that. You can have Java installed without having issuing java from a cmd prompt result in executing it (PATH) problem. If path is set correctly when installing the JRE it can also be the case that installing 32 bit and later 64 bit can result in problems with for example modorganizer which can only handle 32 bit programs.

In an ideal world ppl would read the readme but they don't and start asking question in the thread. If they are polite it looks something like 'ASIS/AV doesn't work. please Help'. I've seen some other (not so polite) reactions as well.... Also even when they read the readme ONCE, changes are they don't read it again when a new version is out. The newest ASIS needed Java7 (older ones didn't). I have seen quite some questions in the ASIS thread stating 'does not work'. Ideally modders should be able to concentrate on bugs and new features and not this kind of messages.

Leviathan1753 is working on SUM (Skyproc Unified Manager). No idea what the currrent status is and when a release can be expected. As far as I understood it, it wll manage all installed Skyproc Based programs and will call all SkyprocPatchers which needs to be called. For example when running the ASIS patcher now you have to disable AV.esp first (and have BashedPatch.esp enabled). If you run the AV patcher you NEED to have ASIS.jar and BashedPatch.esp enabled. SUM will handle this all for you.

Concerning having the .jar checking for the installed version of Java. In my search today I found ppl mentioning using a so called .jar launcher which does the checking and calls for example ASIS.jar. Hence introducing an extra .jar file. The laucher is needed because for example ASIS.jar needs Java7 to start otherwise it generates an exception. So no checks can be done there. The "lauch ASIS.jar" itself has to be compiled to an old version of Java, eg Java 1.2 from 1998. Here the checks can be done and actions taken. If all is fine then ASIS.jar can be called otherwise for example a download link for Java can be shown, a website called in the browser etc...

To be honest I think most ppl (if they use an installer) use NMM because of the Nexus and that far fewer ppl use WB. As I said (if I read the post correctly) currently WB can't be used to install Skyproc Based intallers. That said Real Lighting With Customization (RLWC) has a Bain installer (but does not use the default SkyprocPatch directory structure). Curious how they got that to work...

Most mods have multiple versions to download: eg a NMM download, manual install, Bain version for WB etc. An windows installer could be put here as preferred together with other versions....
User avatar
willow
 
Posts: 3414
Joined: Wed Jul 26, 2006 9:43 pm

Post » Fri Jul 13, 2012 3:13 am

To be honest I think most ppl (if they use an installer) use NMM because of the Nexus and that far fewer ppl use WB. As I said (if I read the post correctly) currently WB can't be used to install Skyproc Based intallers. That said Real Lighting With Customization (RLWC) has a Bain installer (but does not use the default SkyprocPatch directory structure). Curious how they got that to work...

It's quite simple really. Wrye Bash doesn't recognize SkyProc Patchers as a content directory, so archives with nothing but that directory cannot be installed. Everything else (RLWC doesn't use it, ASIS has an extra .esp) can be installed.

I personally don't see the harm in having an installer in addition to the manual (or BAIN/NMM) method. Note that Wrye Bash also has a manual version available for download.
User avatar
Amanda Leis
 
Posts: 3518
Joined: Sun Dec 24, 2006 1:57 am

Post » Fri Jul 13, 2012 5:06 am

@Arkangel. Not totally sure what you mean, content directory and .esp.
Does it mean that when RLWC would use the default SkyprocPatcher directory structure like AV, ASIS, SkyBash it would still work because it does not have an .esp (but it has an .jar file). And that SkyprocBased programs which do not have an .esp to start with, like Automatic Variants would work. If you could elaborate this a bit for me (new to WB and how it exactly works) that would be appreciated.
User avatar
Jordan Moreno
 
Posts: 3462
Joined: Thu May 10, 2007 4:47 pm

Post » Thu Jul 12, 2012 5:50 pm

I'll just quote myself here
ASIS comes with ASIS-Dependency.esp, Bash recognizes this as a plugin and declares that directory as the Data directory. Anything deeper that has unknown folder names (i.e. SkyProc Patchers) will be ignored unless you check Has Extra Directories.
SkyBash has only the SkyProc Patchers directory, no accompanying esp file. Bash semi-recently added support for custom named directories in archives, basically it believes, since nobody has taught it otherwise, that the first folder with actual files inside is the Data directory. I just tossed it in manually, since there's no need to fear any overwrites. And if you want to remove it, just delete the SkyBash folder.

RLWC can be installed precisely because it doesn't have only the SkyProc directory. Although, even if it did have that directory, it still comes with another esp file, so Wrye Bash would still recognize the folder structure. YOu can check the Wrye Bash thread a few pages back, I believe the problem has been clearly outlined there. Automatic Variants basically only works because of a freak coincidence, as it contains a Screenshots directory, which is recognized by Wrye Bash :D
User avatar
joannARRGH
 
Posts: 3431
Joined: Mon Mar 05, 2007 6:09 am


Return to V - Skyrim