If there are any open questions regarding the use of install4j, please check out its In our blog, we have published a three step tutorial based on a real-world. With the API, it is possible to create extensions for install4j that add user- configurable screens, actions and form components to the install4j IDE. The following. Help topics present important concepts in install4j. They are not necessarily tied to a single configuration step. Help topics are recommended reading for all.
|Published (Last):||10 June 2006|
|PDF File Size:||12.73 Mb|
|ePub File Size:||18.15 Mb|
|Price:||Free* [*Free Regsitration Required]|
In the two last ttuorial, I showed how to build turorial installer with install4j for Sweet Home 3Dthen improve it with various options. But a program lives, and more and more users are used to getting program updates automatically. The auto-update feature is informed about the availability of a new version thanks to an updates. Each time an installer is built, install4j creates a default updates. For the version 3. In the Select an Application Template dialog box, I select the Updater with silent version check template.
To run this updater automatically when Sweet Home 3D or Furniture Library Editor are launched, I click on the Launcher Integration tab, select the Start automatically when launcher is executed option and choose to Always run the updater. Minimum auto-updating is now integrated and I just have to build a new installer to make it available for a future version of the program.
To test it, I immediately install version 3. Then, a few seconds after I launch Sweet Home 3D version 3. If I click on the Show comments link, I get the comments entered in the updates. Because the installer detects that a previous version is installed on my computer, it asks me whether to update or to install it in another location before performing the installation.
If an application shares the same list of files which is generally install4u caseI would just have to create a different media for each targeted operating system with its dedicated JRE.
Each of these zipped files contains insgall4j j3d-jre. Once I retrieve all these files, I copy the ones required by Java 3D in a lib subdirectory of Install directory and reorganize them to avoid any name conflict.
These files will have to be copied in the lib lnstall4j of the destination directory where program will be installed. Then, for each of these file sets, I create a new lib folder by clicking on the Insert button and choosing the New Folder option.
Once the lib subdirectories are ready, I select the one in Windows file set, click on the Insert button and choose Add Files and Directories option. Program Files x86 Sweet Home 3D 3. I select the Content of C: I go to the Media screen.
install4j Download – install4j tutorial  – video dailymotion
Then, I click on New media file icon to create Linux 32 bits media file. Once the Media wizard is finished for Linux 32 bits, I create similarly the media file for Linux 64 bits, and rename them as Linux 32 bits and Linux 64 bits with the Rename Media File menu item available in their contextual menu, to be able to distinguish more easily. To set this VM option that should replace the -Djava.
Last week, I explained how to build an installer with install4j for Sweet Home 3D, that would behave as the one distributed on the web site of the program.
But Sweet Home 3D and install4j provide some options that could be nice to offer to end users at installation time like:. The persistence of his choice is managed with Java Preferences class which stores its values in the registry under Windows. As I want this action to occur after files were installed, I select Installation node in install4j and choose Add Action in its contextual menu. The value of the Value text field must be set according to the language currently used in the installer, something stored in one of the install4j variables.
To find it out, I click on the button arrow at the right of the text field and select the Insert Installer Runtime Variable option. Sweet Home 3D may require a lot of memory in some circumstances, and the default amount of maximum memory used by a Java Virtual Machine is generally not enough to let the program work correctly for big layouts.
At the opposite, if too much memory is required, the program may slow down too much because the operating system will have to manage the missing RAM with disk swapping.
A nice option could be to fix the maximum memory used by the JVM by program according to the available physical memory. I already set -Xmx to m during the configuration of a launcher by setting the VM parameters value at the fourth step of the launcher creation wizard. To set this value according to the memory available on the end user computer, the easiest way is to remove the -Xmxm option from VM parameters and add an action to update VM parameters when the installer is run.
As this action should happen at the end of the installation, I select the Installation node, click on the Insert button the button with a green plus and select the Add Action menu item.
This value references the installer: As I need to create this variable and give it a value, I click again on the Insert button and select Add Action menu item. This opens a text editor where I have to enter a Java expression whose value will be saved to the xmx variable. The comment displayed by the editor suggests I can use the two context and action parameters if required, and the classes of these two parameters are com.
InstallAction shown as hyperlinks to their respective javadoc pages. To help me to find this log file, install4j displays an information dialog box recalling where it can be found. Reading this file I can installl4j a vmoption line with -Xmxm option stating the half of the 1. A program called the Furniture Library Editor was recently added as a separate application. It allows the user to import and edit faster the attributes of a group of 3D models instead of importing them one by one in the program.
This program is a Jar executable application and I want to suggest it as an option in the installer. To make it a downloadable file, I have to add it to the installer Files and then select it as a downloadable component in the Media wizard. Install44j, I download FurnitureLibraryEditor This time, I name the executable file as FurnitureLibraryEditorselect the Allow only a single running instance of the application option.
FurnitureLibraryEditorBootstrap as main class. I click on the Insert button, enter first the name of the basic component that will contain the Sweet Home 3D application files and click on OK.
Then I create a second component for the FurnitureLibraryEditor In the Options tab of that component, I unselect Initially selected for installation option and select Downloadable component. Now that installation components are created, I go to the Installer screen and install4 the Installation components node, that will be displayed from now on since I created imstall4j components. As I need to select the Furniture Library Editor launcher component if the Furniture Library Editor component is selected by the user, I click on the ellipsis button beside Selection change script field and enter the matching Java statement.
The IDs of install4j items can be displayed by clicking on the Show IDs button found on many screens, but to avoid closing the editor window, I prefer here to click on the Insert ID button to find the desired ID.
I click on OK to close the script window, and finally go to the Media screen to update the Windows media file. I build a new installer and test it. A new step is now displayed that will let me choose what I want to install.
Sweet Home 3D lets the istall4j import pieces of furniture one by one, but also by group of pieces from. At this time, four. Once downloaded, these files should be unzipped in a private directory of Sweet Home 3D that depends on the target system. Under Windows 7 and Vista, it should be under the directory C: Thus, I create four additional Installation components in the proper tab of the Files screen. To simplify the way install4h find them later, I create a custom ID for each of imstall4j with a value equal to its name.
Then I unselect the Initially selected for installation option and select the Downloadable component option for the 4 new components. To manage the download of the optional files, I go to the Installer screen, select the Installation node and insert a Download file action.
Installation screen runs 20 actions now! Once yutorial, the new version of the installer displays the options to download the optional files. From the previous parts, you understood that like many other applications, Sweet Home 3D stores its configuration data in private directories.
But insyall4j users want to be able to move an application and its configuration around without bothering how tutorixl copy this data, and requested to make Sweet Home 3D portable not across operating systems, but across different computers. This ended up by the new com. To create this customized screen in install4j, I select the Installation location node in Installer screen, click on the Insert button and choose Tuhorial screen option.
I click first on the Configure Form Components button to add a check box to the empty form. In the dialog box that indtall4j, I click on the Insert tutkrial and choose the Add Form Component option. This will open another dialog box in which I can choose among more than 30 different components. I choose a Check box component. Then, I click on the Preview Form button at the top right of the dialog to check how the check box and its help text will be shown. This looks nice but the screen title and subtitle tutoorial still missing!
As this screen should be displayed only if the user chose a removable drive, I finally click on the ellipsis button of the Condition expression property to enter the condition.
As this condition can be checked only under Windows I check first if the installer is running under Windows with a call to Util. The ijstall4j screen is now configured, and I have to insatll4j the value of the portable variable bound to the check box to configure Sweet Home 3D accordingly instll4j the installation screen.
I click on OK and use the portable value in the Installation node to add new VM options that will set the desired system preferences: I select the Set a variable action that defines the privateDir variable to add this new action after it, click on the Insert button, select Add Action option and choose the Add VM options action.
Therefore, I select the Set a variable action that defines the privateDir variable and click on the ellipsis beside its Script field to update it.
While editing this script, I got the context. I build this updated configuration and try the new version of the installer that displays the installj screen if I choose to install it on a USB key. Sweet Home 3D stores user preferences and configuration data in private directories to help users to upgrade the installed version of the software without losing data.
But sometimes some users want to really remove all information bound to the installed software.
install4j 5.0.8 Build 5311 Tutorials
I select the Uninstaller node in Installer screen, click on the Insert button, select the Add Screen option and choose the Additional confirmations screen. I click on the Insert button, select the Add Form Component option and choose Check box among the list of components. I titorial the Configure Form Components dialog box and click on Unistallation node to add a new action to it. I click on the ellipsis beside the Condition expression field, insert the intall4j of the privateData variable to check the condition, and confirm my choice.
To delete private files, I add a Delete files and directories action to Unistallation node with the same Condition expression and install4 the Recursive option.
The files to delete are in the directory referenced by the privateDir variable created at installation time, but I need it also at uninstallation time. A response file is a properties file that contains key-value pairs for installer variables.
This file is created during installation process and is reused during instlal4j. All the variables bound to a form component like the portable variable bound to the Install as a portable application check box, are automatically saved in a response file.
Finally, I select again the Delete files and directories action, and complete its Files and directories field by clicking on the ellipsis button beside it.