How to create a service for automatic update? - service

I've tried to create a service that calls the update application configured in the project. Therefore I used the "silent version check" template for the update process and modified the ServiceDemo.class from the sample to start the update application.
ApplicationLauncher.launchApplication("2529", null, true, null);
But everytime I tried to install or start the service manually or with the command line executor nothing happened.
With the following command line call the updater starts:
java -cp classes;.install4j\i4jruntime.jar install4j.sample.service.ServiceDemo
Is it necessary to add the i4jruntime.jar to the classpath or is it bundle with the exe-file? But I can't see anything like that for the greetings-example. Has anybody an opening for me how to create such a service?
I am using version 5.1.5.
Thanks in advance
Hardie

Generally, you cannot use a service to display a GUI. The updater would work if you run it in unattended more (with the -q flag).
To check what happens, redirect the output to a file ("Executable info->Redirection" in the launcher wizard). Also, the updater writes a log file to the temp directory that is deleted after successful completion. To keep the log file, start the updater with -Dinstall4j.keepLog=true.
You never have to add i4jruntime.jar to launchers that are generated by install4j. That JAR file is added automatically to the class path.

Related

Check Launch application before server completes startup in WAS via deployment.xml

How can I check this in the deployment.xml in Websphere. So when I deploy my application this is already checked.
The name of the XML attribute is "backgroundApplication" (it's not in there by default, as it defaults to "false"); however, deployment.xml is generated by WebSphere at deployment time, so you can't specify this setting prior to deployment.
If you script your application install through wsadmin, you could update your script to add a call to update the setting after the call to install the app. That will get the setting modified right away as part of your deployment process.

ApplicationLauncher.Callback notification on finishing Install4j installation

I am using autoupdate feature of install4J by using ApplicationLauncher.launchApplicationInProcess() API from my Java code.
This API has a parameter ApplicationLauncher.Callback. I thought this call-back method will be called when complete Installation process will finish.
But I observed that, this call back is not getting called when actual installation process (name of this process is same as setup file name) is completed.
Is there any callback mechanism to detect the status of installation?
There are two separate processes here:
The updater, which is what you call with ApplicationLauncher.launchApplicationInProcess()
The new installer, which is started downloaded and started by the updater.
The callback is called before the updater executes the installer, then the updater terminates itself. This sequence of events is required to avoid problems with locked or deleted files.
If you need to do something at the end of the installation, you have to place that logic in the installer.

Debugging Drools inside an EJB in eclipse

I am currently debugging a web application which uses a drools ruleset inside an EJB to process business rules. It's deployed inside a JBoss server. I've configured eclipse to run the server so I could use Debug on Server functionality of eclipse.
When I reach the class that fires the drools ruleset, the server loses focus and returns after all the rules are fired. Is there a way where I could trace what rules are being fired? Right now, what I do is put logs inside the *.drl files so I know where the application is inside the rules engine.
you can get the generated java source code of any rule when you add a file with name drools.packagebuilder.conf to your %USERHOME% directory.
The file must contain the following instruction:
drools.dump.dir = d:/myDroolsJavaSourceCode
The directory d:/myDroolsJavaSourceCode - Directory (or any other given name) must exist otherwise the Drools Packagebuild will stop execution.
Then you can add this directory to your Eclipse Environment as new project (probably you have to remove the flag 'Default Location' to choose the 'myDroolJavaSourceCode').
Then you can open the file in Eclipse and set break points in the editor.
May be you must attach the directory also during debugging execution twice.
Best regards!
Christof
As far as I know you can't debug drl file. What we did was to encapsulate the logic of when and then in a method, so that you can at least debug that.
Maddy
What I did is I downloaded the sources for drools-engine and compiled the drl files to their java sources. When you run the app, you'll have an option to attach sources when the break point reaches the engine. It's still hard to trace the rules that are fired (multiple rules from different drls can be fired) but it's better than just sysout logging.

How do I run build Release from the command line in Eclipse / Flash Builder

Is there a way to run a Export Release build from the command line in Flash Builder (Eclipse)?
More Context
Flash Builder has debug, run and build release commands or configurations (not sure what they're called). I want to put Flash Builder on the server and invoke the build release configuration from the command line.
You don't need Flash Builder on the server. You can do it with the Flex SDK, Java and Apache ANT installed on the server. If it is a Windows server you can set it up to run like this:
Create an ANT script to update from the repository, then build the Flash app.
Create a .bat file to run the ANT build (literally just a text file 'build.bat' in the folder with the build.xml that just says 'ant' in it).
Set up a scheduled task to run the build.bat at whatever interval you desire, or, if you have SVN on the same server you can set up a post commit hook to run that scheduled task so when a person commits to the repo, the build script will run and the new version can be viewed on the dev server.
I have an ANT script that also will email all devs if the build fails to let everyone know who broke the build, so they can take care of it. If you message me back I would be happy to post a zip for you with my ANT script files you can use an example.
EDIT: I've posted the files to GitHub in case anyone else needs them. https://github.com/royaldigit/ant-flash-build

Grails: Where is the startGrails script in Eclipse/STS on the Mac?

In order to fix another problem (Stackoverflow Question 6367763) I needed to modify the startGrails script. I made the necessary updates however the modifications are not being picked up when I run Grails commands from within Eclipse/STS.
I put debug in the script and know it is functioning correctly when I call it directly from the command line. However STS appears to be running the original version.
Does STS have another copy of the startGrails script? How can I update this one or ensure STS links to the version of the startGrails script that I updated?