Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Environment variables


4 replies to this topic

merav

merav
  • Members
  • 28 posts

Posted 28 June 2001 - 14:34

Hello,

I am new to ISMP and try for some days to get environment variables - with no success.
Did anyone did this, and explain me / send me the bean how to do it?

I tried  to write a bean based on the EnviromentVariableUpdate sample. I created the bean, entered it to the bean gallery, used it, but it seams that it doesn't enter the install logic.

I am desperate, and will appreciate your help very much

Merav.



RobertDickau

RobertDickau
  • Members
  • 29 posts

Posted 11 July 2001 - 22:45

Here's a wizard bean that gets the value of the PATH environment variable using the system-utility service:

// javac -classpath "...ISMP/lib/wizard.jar" GetEnvVar.java

import com.installshield.wizard.*;
import com.installshield.wizard.service.*;
import com.installshield.wizard.service.system.*;

public class GetEnvVar extends WizardAction
{
   public void execute(WizardBeanEvent event)
   {
       try
       {
           SystemUtilService ss = (SystemUtilService)getService(SystemUtilService.NAME);
           String evpath = ss.getEnvironmentVariable("PATH");
           System.out.println("PATH = " + evpath);
       }
       catch(Exception e)
       {
           e.printStackTrace( );
       }
   }

   public void build(WizardBuilderSupport support)
   {
       support.putRequiredService(SystemUtilService.NAME);
   }
}


merav

merav
  • Members
  • 28 posts

Posted 12 July 2001 - 06:26

Thank you...

Merav


jesse

jesse
  • Members
  • 7 posts

Posted 01 August 2001 - 16:03

Hi,

I need to set a value for the environment variable to be the destination where the files are installed and the jar file name. This destination should be the destination where the user installs the files. how can I grab this destination value and set it in the environment variable value. Please let me know if you have an idea.


merav

merav
  • Members
  • 28 posts

Posted 05 August 2001 - 08:45

You can do one of the following :
1. $P(absoluteInstallLocation)
2. You need to write your own Destination panel, add a new property to it that will hold the destination value, then you can use the environment wizard (for ISMp) with action replace to add it to the environment variables, you should do it using the $W notation.

Hope it helps