This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- how to display message in silent installation?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 15, 2010
10:42 AM
how to display message in silent installation?
Hi everyone,
Do you know how to display message in silent mode? I try to use custom code but it doesn't work.
System.out.println("Show message");
Do you know how to display message in silent mode? I try to use custom code but it doesn't work.
System.out.println("Show message");
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 15, 2010
12:35 PM
Silent mode = SILENT. You won't see any messages. Best bet is to write them to a log file so you can review after the installation is complete.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 02, 2010
09:39 AM
zhiyangchen wrote:
Hi everyone,
Do you know how to display message in silent mode? I try to use custom code but it doesn't work.
System.out.println("Show message");
Why yes, yes you can. Silent mode has a rather silly design limitation that they don't give you a way to print a failure message when things go wrong.
Here is how you can overcome that:
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.io.PrintStream;
import com.zerog.ia.api.pub.CustomCodeAction;
import com.zerog.ia.api.pub.FatalInstallException;
import com.zerog.ia.api.pub.InstallException;
import com.zerog.ia.api.pub.InstallerProxy;
import com.zerog.ia.api.pub.UninstallerProxy;
/**
* Simple Install Anywhere Custom code task to stop the installer and print an
* error message. Useful for silent installs.
*
* Prints the value of the variable FAIL_MESSAGE before it stops the installer.
*
* @author Dan Armbrust
*/
public class Fail extends CustomCodeAction
{
@Override
public String getInstallStatusMessage()
{
return "Failing";
}
@Override
public String getUninstallStatusMessage()
{
// noop
return null;
}
@Override
public void install(InstallerProxy ip) throws InstallException
{
String failMessage = ip.substitute("$FAIL_MESSAGE$");
// install anywhere redirects these somewhere - put it back.
System.setOut(new PrintStream(new BufferedOutputStream(new FileOutputStream(java.io.FileDescriptor.out), 128),
true));
System.out.println("INSTALL FAILURE: " + failMessage);
System.exit(1);
// should be unreachable, but just in case...
throw new FatalInstallException("INSTALL FAILURE: " + failMessage);
}
@Override
public void uninstall(UninstallerProxy arg0) throws InstallException
{
// noop
}
}
If at any point in an install, you want to exit the (silent) install, and print a message to a user, simply put the message in the variable FAIL_MESSAGE and then execute this custom code.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 03, 2010
05:56 AM
Well, silent mode does not have a silly limitation, but it has been designed to run in a failure-free mode (i.e. the silent mode has been designed, I think, in order to facilitate multiple scale, automatic deployments, which should happen without any end-user interaction (i.e. once the setup has been launched). That is why this whole installation mode has been conceived with the idea that installation won't fail (and well, if it does fail, then the end user will see that the application hasn't been fully installed and will proceed to a manual installation). I think you defeat the whole purpose of the silent installation if you start working around it and try to get messages displayed etc.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 20, 2011
10:29 AM
First of all to add with others, a silent installer is always a silent installer. You cant change its functionality. But you can break it if required.
The following is the solution i identified when i had a task to address the same issue. The solution is as follows.
We can replace the PAUSE command with SLEEP so that it wont prompt the user, rather it will be visible for some time and it will disappear automatically.
Note: This works fine with windows ONLY.
The following is the solution i identified when i had a task to address the same issue. The solution is as follows.
- Add action Modify Text File and Select New File. example MessageDialog.CMD
- Add the Following contents into the file.
@echo OFF
echo Your Message Goes Here
pause
exit - Add action Execute Script/Batch File. Add the following line into that.
start MessageDialog.CMD - Add Action Delete File and select Existing. Give the file name MessageDialog.CMD
We can replace the PAUSE command with SLEEP so that it wont prompt the user, rather it will be visible for some time and it will disappear automatically.
Note: This works fine with windows ONLY.