PDA

View Full Version : Environment path variable is not working!?!



Hani Atassi
12-15-2004, 06:32 PM
I have no idea what's wrong.. I setuped the following path variable to be of type "Environment":

Name: PATH_TO_WATCHDOG_INSTALLER_FILES
Type: Environment

Now, before I do the build in command line, I set the environment variable like the following:

SET PATH_TO_WATCHDOG_INSTALLER_FILES="c:\temp"

Then I call the stand alone builder like the folloiwng:

issabld.exe -p Watchdog.ism

The builder gives me the error 6102:
ISDEV : error -6102: Error searching for dynamic files matching "<path_to_watchdog_installer_files>\alarm relay\ewsv5\*.*"

Why it's not picking my defined environment variable..?! :confused: :confused:

Tim Owers
12-16-2004, 04:35 AM
Using SET from dos is applicable to that session only, so I suspect you maybe running issabld.exe in a different dos session from when setting the environment variable. Either use SET and issabld.exe from the same dos session or write a small exe that writes the environment name and value (passed as a command line parameters to the exe) to the registry and then posts a SendMessageTimeout message to notify the rest of the system about the change.
Tim Owers

Hani Atassi
12-16-2004, 10:09 AM
Tim, I am pretty sure I was in the same session (same dos window).. Right after the SET i called issabld.exe ..

Tim Owers
12-16-2004, 10:16 AM
1. Open a dos session (cmd) and set a variable.
2. Type SET to see all current variables, you'll see the one you just set amongst them.
3. Close the dos box and open a new dos box.
4. Type SET again and your previous variable has now gone.
This must have something to do with your problem.
If you have a fixed variable, i.e. created via the windows environment variable dialog does the problem go away?

Tim Owers
12-16-2004, 12:11 PM
Have just done a test and found the following.
Setting a files path to be an environ variable works fine in the IDE. Open up a DOS box (cmd) and run the standalone build - this also works fine.
Now while leaving that DOS box open, change the environ variable to a new path, rename the old folder to the match new environ variable and re-run the same standalone build - it fails because that DOS session still refers to the old environ value. Close down the DOS box, open a new DOS box and re-run the standalone build again. All is now fine because the new DOS session has picked up the new environ variable.
So, as long as the environ variable is set independantly and before running a standalone, it always works.

Hani Atassi
12-16-2004, 12:32 PM
1. Open a dos session (cmd) and set a variable.
2. Type SET to see all current variables, you'll see the one you just set amongst them.
3. Close the dos box and open a new dos box.
4. Type SET again and your previous variable has now gone.
This must have something to do with your problem.
If you have a fixed variable, i.e. created via the windows environment variable dialog does the problem go away?


I tried local environment variable to the session, and I tried a global environment variable through System for both User and Machine..

When I type SET my environment Variable is there, but the build doesn't work..

Even in a globally set environment variable, you would think that the IDE build will work but still gives me the same error!



Setting a files path to be an environ variable works fine in the IDE. Open up a DOS box (cmd) and run the standalone build - this also works fine.


Didn't work with IDE even my path is set globally through System and my cmd window is showing me my variable when i type SET..

What version of Install Shield you are using? There is something wrong somewere!!!

Tim Owers
12-16-2004, 12:52 PM
Ahh! if it's not working in the IDE then it sure won't work any other way!
OK, I've attached a tiny sample project ENV.ism (zipped). First create folder c:\xxxx and put anything in there. Now create a user environment variable called IS_PATH and set it's value to c:\xxxx. Open the project and you'll see one Feature with one Component that's dynamically linked to IS_PATH so you'll see whatever files you put into c:\xxxx there (look at the properties of any file listed in the Component). Now whenever the environ var IS_PATH is changed, that component will pickup the files in whatever folder is IS_PATH is pointing at.
Just make sure that both IDE and standalone build are completely closed and restarted everytime the env var is modified.

Hani Atassi
12-16-2004, 02:00 PM
Ok from ur test project, I know what I was doing wrong.. :o :o

Well originally my path variable was of type "Standard", then I changed it to type "Environment", but didn't chnage the value inside "Defined Value". The defined value was the path when it should be the name of the environment variable..

At least InstallShield, should give me a warning of sometype.. Anyways, thanks Tim, without your help I could'v lost my mind..

:)

Tim Owers
12-17-2004, 04:49 AM
No problem. Glad you sorted out the problem.
I can see this may trip people up in future so at least they may find this thread useful!