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

INSTALLDIR as environment variable


7 replies to this topic

jaison

jaison
  • Members
  • 7 posts

Posted 23 May 2005 - 08:23

I want to install a package to a directory specified using System variable (%APP_HOME%) . The package must set the installation directory as %APP_HOME and install it in the target system. I have created a folder named %APP_HOME% and set it as INSTALLDIR. I have added the registry entry key for that path as well. But when it installs, it is throwing an error 1606 : Could not access network location %APP_HOME.
I have also created an Environment variable and it isn't working as well.
Do I have to write a script to retrieve the environment variable?

I have used the following vbscript code to get the system variable. But it still throwing an error?
<script LANGUAGE=VBScript>
Sub setAudiumPath
Dim WshShell
Dim WshSysEnv
Dim DummyVAR
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment("USER")
DummyVAR = WshSysEnv("APP_HOME")
Session.Property("INSTALLDIR") = DummyVAR
End Sub
</SCRIPT>
Can you tell me any other simple way of doing it?

mandy

mandy
  • Members
  • 121 posts

Posted 23 May 2005 - 15:20

You could use the AppSearch action, but your script should work too if it's sequenced correctly. Where have you placed the action?

Try inserting one or more message boxes within your script in order to troubleshoot. For example, put the following line at the end:

Msgbox Property("INSTALLDIR")

Is it supposed to be a "User" environment variable or a "Machine" one?

What value did you give the environment variable during your tests?




jaison

jaison
  • Members
  • 7 posts

Posted 24 May 2005 - 07:48

Hi Mandy,
I have tried using AppSearch table and it is working.
I have created a property TARGETDIR as %APP_HOME% and updated AppSearch and RegLocator Table to get the Key from the registry. What I want to know, i would like to install some files to %TOMCAT_HOME% path as well .
How do I package the application that installs files to %APP_HOME% and some files to %TOMCAT_HOME% as well.
we can set TARGETDIR as one value. Isn't it?



mandy

mandy
  • Members
  • 121 posts

Posted 24 May 2005 - 09:22

That should be just as easy...

Duplicate the "INSTALLDIR" row in your "Directory" table, and call it "INSTALLDIR1". Then install all your Tomcat components to this folder.

The only thing missing now should be another AppSearch to populate the "INSTALLDIR1" property.

Let me know if it works.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 24 May 2005 - 13:38

You could use a custom action (type 51, set a property) that sets INSTALLDIR to the value of
[%APP_HOME]
You should condition this custom action to execute only if this environment variable isn't empty. To do this, simply enter [%APP_HOME] as the condition. If the string is empty, the condition will evaluate to false and the default value will be used for INSTALLDIR.

mandy

mandy
  • Members
  • 121 posts

Posted 24 May 2005 - 15:20

That's indeed another method that should work - you're spoilt for choice now!

The same logic I described above for the second installation folder should work with this method too. Just replace the AppSearch with a type 51 action.


jaison

jaison
  • Members
  • 7 posts

Posted 30 May 2005 - 03:29

Hi Mandy,
I have created a AppSearch1 table and inserted "INSTALLDIR1", "CATALINA_HOME" values as property and Signature.
How do I point this to install the all Tomcat files to webapps\Audium folder? (Please check the attached image).
Where do I add the AppSearch table?
Can you give me a detailed explanation?

mandy

mandy
  • Members
  • 121 posts

Posted 30 May 2005 - 08:35

I can't see your attachment - are you sure it's attached?

I'll try to explain...

1) Find the directory table entry that currently represents your "webapps\Audium" folder. Remember the name of the directory from the Directory column (case-sensitive).

2) Search the "Directory Parent" column of the Directory table for occurances of this name, and replace them with "INSTALLDIR1". This should move any subfolders of "webapps\Audium" (and their components) under "INSTALLDIR1".

3) Search the "Directory" column of the Component table for occurances of this name, and replace them with "INSTALLDIR1". This should move any components that install to "webapps\Audium" to "INSTALLDIR1" folder.

4) Search the rest of the MSI database for occurances of the name in case it is used for something else. It is probable that you will need to replace these values too, but you should try to understand what the entries are to be sure.

I don't understand your question about where to add the appsearch table? The table should already exist.