Is there an integrated feature that will enable me to auto-start the program after Install4J installer is finished? Ideally to add "Start after installation is finished" button.
I see that there is field "Post-activation script" property on the finish form in the installer, but not sure if this can be used.
Just add an "Execute launcher" action to your "Finish screen". When you do that, the install4j IDE will also ask you if you want to add a confirmation question to the finish screen.
Related
We are using install4j to generate a Windows and a Linux installer for our application. We would like our users to use the GUI mode for installations on Windows and the console mode for installations on Linux.
This works by passing the -c parameter to the installer, I know. But I would also like to suppress the usage of the GUI mode for Linux. Similarly to the "Disable console mode on Windows" option in the installer settings. Is there something I did not see, that enables this behavior?
If there is no option to suppress this, we will add an action to the installer to quit if it was started from Linux and is in GUI mode.
As of install4j 8.0.8 there is no way to prohibit the GUI mode, you would indeed have to add a "Run script" action with the script
!(Util.isLinux() && context.isGui())
and set its "Failure strategy" property to "Quit on Failure" and its "Error message" property to "GUI mode not allowed" or something similar.
There is also a "Default execution mode" property on the Installer, you can right-click it, select "Switch to text mode" from the context menu and set the text field to
${compiler:executionMode}
Then, define a compiler variable on "General Settings->Compiler Variables" named "executionMode" with the value "GUI". In the media wizard of the Linux media file, go to the "Customize project defaults->Compiler Variables" step and override the "executionMode" compiler variable with the value "CONSOLE".
Then your users do not have to pass -c as the argument on Linux.
Update: As of 8.0.8 there is a bug in install4j that prevents the replacement of compiler variables for this property. It will be fixed in 8.0.9.
I created a little test application to place a tray icon in the system tray bar of windows. The installation with install4j is working well and also the uninstall process by using the "Terminate immediately" option for the "Check for running system" action is working. But when the application is killed the tray icon still exists in the system tray bar until someone is hovering the icon. Then the icon diapear. So I thought about to implement a runtime hookup to the application main class to remove the icon from the system tray before the vm is terminated. I switched the mode of the install4j action to "Soft close immediately". But that causes an error saying application is still running. Now I am wondering how this option is working and what the "Soft close" means. Do this innitiate the vm shutdown? In the "Check for ..." action I disabled the "Inluding launcher" option and added the generated executable directly for the additional executables.
PS: we are using version 6.1.5.
"Soft close" sends a WM_CLOSE message to all visible windows of the process. "Terminate" kills the process. If there is only a tray icon, there will be no visible window and soft close will not work.
I have set up Auto-update and launcher integration within my project ( Update with silent version check). In my Launcher integration I select "start automatically when launcher is executed" and select my launcher ( which is an external launcher) from the list of launchers but when I select the launcher from the Start Menu after installation no update screen is displayed.
I get no error and no logs indicating the issue. I have confirmed there are updates available as when I run the updater exe on its own the appropriate update screen is dispalyed showing the version change.
I have selected Launch schedule: Always and Launch mode: Blocking on startup.
I cannot see what I am doing wrong? Is it possible to set auto update with an external launcher?
Launcher integration for updaters is only supported for generated launchers. For external launchers, install4j has no hook to insert the auto-update check.
You can call the updater yourself, though. On the "Launcher integration" tab, click on "Start integration wizard" and add the code snippet to your your own code.
I am trying to integrate install4j updater application to be part of start menu (in Windows). So that user can go to Start->Programs->AppName->Update and start updater.
I tried with "Launcher integration" option (I created launcher who points to batch file with only one echo command which is doing nothing) and setup my updater to be invoked whenever this launcher is invoked (launcher exists in the Start menu).
But when I start launcher from the Start menu, updater doesn't appear, no errors, no logs and launcher is executed (echo message).
Is there any other way or I miss something?
I am trying to integrate install4j updater application to be part of
start menu (in Windows). So that user can go to
Start->Programs->AppName->Update and start updater.
Presumably you have a "Create program group" action in your "Installation" screen. In the configuration of that action, activate the "Windows program group entries" tab and add a file link to the updater.
It is Possible with install4j to do an uninstall Force a Reboot And Continue with the Installation with Admin rights if they were granted with the Invocation for the uninstaller.
Any hints are welcome. Thanks
You can force a reboot by calling
context.triggerReboot(false);
in a "Run script" action. However, there is no feature that lets you call the installer again after the reboot and continue at the next screen.
What I would suggest in this case is to add a custom installer application for the post-processing on Installer->Screens & Actions and add a "Add a startup executable on Windows and OS X" action for this custom application to the installer.
After successful completion of the post-processing, you would have to delete the auto-start link. The link is in the directory
new File(FolderInfo.getSpecialFolder(FolderInfo.FOLDER_STARTUP, false)
has the name of the executable and a ".lnk" extension. If you use a "Delete files and directories" action, set its "Action elevation type" property to "Do not elevate".