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
- :
- Re: How to set PATH and CLASSPATH
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
‎Nov 11, 2008
03:03 AM
How to set PATH and CLASSPATH
I have used 'Set System Variables' for setting PATH and CLASSPATH variables.
This has two disadvantages:
1. It prepends the entries blindly, without checking if there exists the same entries or not.
2. It doesn't remove the entries on uninstallation.
Is there any other way to add PATH and CLASSPATH values?
This has two disadvantages:
1. It prepends the entries blindly, without checking if there exists the same entries or not.
2. It doesn't remove the entries on uninstallation.
Is there any other way to add PATH and CLASSPATH values?
(12) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 11, 2008
05:38 AM
Does uninstaller really removes the entries the installer made in the environment variables?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 11, 2008
07:46 AM
Have I asked some stupid question here? Please do reply.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 11, 2008
09:01 AM
Put a rule, on whether variable lax.nl.env.PATH or lax.nl.env.exact_case.Path contains the string that you are adding to it. If this rule executes to true, then the action should not be performed, otherwise it should be.
Do same with Classpath,
Put a reverse action in (Pre/Post)Uninstallation.
Simple.
Do same with Classpath,
Put a reverse action in (Pre/Post)Uninstallation.
Simple.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 11, 2008
10:25 PM
How to put a reverse action in uninstallation? It means to set the variables to the original values? How to do it?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 17, 2008
05:02 AM
During installation, I'll copy the PATH variable value to some variable and then use this variable again during un-installation to set the PATH variable to the original value.
What variable can be used bot during installation and un-installation time?Can I use USER_MAGIC_FOLDER?
What variable can be used bot during installation and un-installation time?Can I use USER_MAGIC_FOLDER?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 17, 2008
05:26 AM
But if user modifies the PATH after the installation of ur install.exe .. .. then if he uninstalls .. the changes made by him will be lost !!:eek:
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 17, 2008
05:47 AM
Oh yes, that make sense..
I plan to put this logic:
1. Split the PATH value with ";" and read it one-by-one in a buffer. If it matches USER_INSTALL_DIR, don't add it to the buffer, else add it.
2. set the PATH to the buffer value.
or is there any other mechanism?
I plan to put this logic:
1. Split the PATH value with ";" and read it one-by-one in a buffer. If it matches USER_INSTALL_DIR, don't add it to the buffer, else add it.
2. set the PATH to the buffer value.
or is there any other mechanism?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 17, 2008
05:54 AM
sandy_2008 wrote:
Oh yes, that make sense..
I plan to put this logic:
1. Split the PATH value with ";" and read it one-by-one in a buffer.
Beware of the differences between platforms: while it is true that ";" is the separator on Windows, it's ":" the separator on Unices!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 18, 2008
03:00 AM
Thanks Vlad..Here,I'm talking about Windows.
Our installation will add some entries to the CLASSPATH like,
/rt.jar;/jdo.jar;/jvi-jdk.jar
I have written a custom code which will be run in post-uninstallation and which will split the CLASSPATh value with ";" and then add to the buffer the values that doesn't contain rt.jar. That means the objective is to remove rt.jar path from CLASSPATH.
This is my code.
[CODE]
public void uninstall( UninstallerProxy ip )
{
try
{
//get the CLASSPATH value
String GetClassPath = (String) ip.getVariable("lax.nl.env.CLASSPATH");
String NewClassPath = "";
String[] NCP;
NCP = (GetClassPath).split(";");
StringBuffer buff = new StringBuffer("");
for(int i =0; i < NCP.length ; i++) {
if (!NCP.contains("rt.jar")){
buff.append(NCP);
buff.append(";");
NewClassPath = buff.toString();
}
}
NewClassPath = (String) ip.substitute (NewClassPath);
ip.setVariable("NEW_CLASSPATH", NewClassPath);
}
catch(Exception e)
{
String errorMsg = e.getMessage();
System.out.println(errorMsg);
}
[/CODE]
and then I added 'Set System Environment variable' and I set CLASSPATH to NEW_CLASSPATH..
But it doesn't seem to work.. Have I done something wrong here?
Our installation will add some entries to the CLASSPATH like,
I have written a custom code which will be run in post-uninstallation and which will split the CLASSPATh value with ";" and then add to the buffer the values that doesn't contain rt.jar. That means the objective is to remove rt.jar path from CLASSPATH.
This is my code.
[CODE]
public void uninstall( UninstallerProxy ip )
{
try
{
//get the CLASSPATH value
String GetClassPath = (String) ip.getVariable("lax.nl.env.CLASSPATH");
String NewClassPath = "";
String[] NCP;
NCP = (GetClassPath).split(";");
StringBuffer buff = new StringBuffer("");
for(int i =0; i < NCP.length ; i++) {
if (!NCP.contains("rt.jar")){
buff.append(NCP);
buff.append(";");
NewClassPath = buff.toString();
}
}
NewClassPath = (String) ip.substitute (NewClassPath);
ip.setVariable("NEW_CLASSPATH", NewClassPath);
}
catch(Exception e)
{
String errorMsg = e.getMessage();
System.out.println(errorMsg);
}
[/CODE]
and then I added 'Set System Environment variable' and I set CLASSPATH to NEW_CLASSPATH..
But it doesn't seem to work.. Have I done something wrong here?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 19, 2008
05:07 AM
In the pre_install tak, I have added the custom code to get the CLASSPATH value, and display it in message dialog, but it doesn't show any value. Why?
String GetClassPath = (String) ip.getVariable("lax.nl.env.CLASSPATH");
MessageDialog.showAndWait("Product Installation", GetClassPath, "OK");
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 19, 2008
06:07 AM
I used the following code to get the classpath value.
But the code doesn't get the values set in the system and instead contains the these values:
Why?
String GetClassPath = System.getProperty("java.class.path",".");
But the code doesn't get the values set in the system and instead contains the these values:
C:\WINDOWS\TEMP\I1227095198\InstallerData\IAClasses.zip;C:\WINDOWS\TEMP\I1227095198\InstallerData\Execute.zip;C:\WINDOWS\TEMP\I1227095198\Windows\InstallerData\Execute.zip;C:\WINDOWS\TEMP\I1227095198\InstallerData\Resource1.zip;C:\WINDOWS\TEMP\I1227095198\Windows\InstallerData\Resource1.zip;C:\WINDOWS\TEMP\I1227095198\InstallerData;C:\WINDOWS\TEMP\I1227095198\Windows\InstallerData;
Why?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 28, 2009
01:03 AM
did you get any solution to this?