Install4j reboot - install4j

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".

Related

Suppress GUI Mode in install4j for Linux Installer While Allowing GUI Mode for Windows Installer

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.

Auto-update and launcher integration - install4j

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.

Auto-start in install4J

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.

Place shortcut to application in autostart folder with Install4J

I'm using Install4J to build my application.
Is there a way to make Install4J copy (make shortcut to) the created application to the autostart directory in windows?
I know there is a installer variable called sys.startupDir, which should point to the autostart directory, I just don't know how to make an action/script that does what I want.
There is an "Add startup executable" action in install4j which does what you want. It even works on Mac OS X as well.

installation.log does not get copied to installation directory

I use install4J 5.0.9 windows-only as my product's installer. According to the manual, the installation log file should be copied upon installation completion to the installation directory.
However this doesn't happen in my installation. I have an "Install Files" action, executed as part of the "Installation Location" screen.
During the installation I can find the log under %TEMP%\I4J_log*, but it's deleted at the end of the installation (as expected).
Is there another requirement for the log to be copied?
The log file is moved when the installer exits and not after the "Install files" action. This is only done if the directory ${installer:sys.installationDir}/.install4j exists. If the installer process is killed of if you call System.exit() from a script directly, this is not done either.