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

Defining Environment Variable using Automation


4 replies to this topic

farrukh

farrukh
  • Full Members
  • 11 posts

Posted 07 January 2005 - 11:54

Hi
I'm using VB to automate the updating process of my Devstudio 9 Installscript project. But every time, before building the Installer, I have to define an Environment Variable to update the Path environment variable on target machine, which must be attached with a component.

Is there any way to define this environ. variable automatically so that I may not have to stop the Build process?.

Any help is really apreciated.

Thanks
Farrukh

Edited by farrukh, 07 January 2005 - 11:55.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 07 January 2005 - 12:18

Do you need to set this environment variable on the development/build machine or on the target machine?

farrukh

farrukh
  • Full Members
  • 11 posts

Posted 07 January 2005 - 13:03

QUOTE (Stefan Krueger @ 2005-01-07 11:18)
Do you need to set this environment variable on the development/build machine or on the target machine?

Hi Stefan,
Thanks for the reply. smile.gif

I need to set this environment variable on target machine where the installer is going to install the software. Actually I need to add the path of installed software (e.g. C:\Program files\MySoftware") to Path environment variable in System environment variables.

But I want this process to be done automatically i.e during the execution of my buid procedure, the ISM project is needed to be updated by defining the Environment Variable for Path under System Configurations --> Environment Variables and define its value.

I tried to search in Automation Interface for Devstudio 9, but I found nothing related to this.

Thanks & Regards
Farrukh

Edited by farrukh, 07 January 2005 - 13:09.


aviswanathan

aviswanathan
  • Members
  • 18 posts

Posted 27 January 2005 - 17:32

Hi Farrukh,

I did not get what you are trying to achieve here? You want to know the where your software will be installed in your customer's machine for building your installer ??????

If you want to add an environment variable to the end user's machine you can always do it when the installation has started at the end user's machine. For example the TARGETDIR property gives you the dir where your software is being installed. So if the user changes the dir during installation you have this updated info which you can add to the PATH variable at the end user's machine.

If you want set specific path variables in your local machine during building of the project you can use the MEDIA --> "Path Variables" section of the IDE to specify specific variables needed for building your set up. Check the help files for this one.

This is from the help files -->
"A common scenario where environment path variables may be useful is when performing a build from the command line. If you do nightly builds on a machine dedicated to that purpose, you may need to change the path variables from the command line. While this is not directly supported with InstallShield DevStudio, you can change the value of Environment variables from the command line. As long as you use environment path variables, you can define the paths to your project's files from either a batch file or the command line. These paths are evaluated when the setup project is built and the correct paths to the files will be used.

Creating Environment Variables:
When you have created an environment path, you can create a new environment path variable:
1) Go to the Path Variables view by clicking the Path Variables shortcut on the View List.
2) Double-click on the bottom row of the editor to create a new entry.

Implementing Environment Variables:
After you have created an environment variable, you can use it every time you add a source file to your project. For example, you might create a variable called <MyFiles> and it points to C:\Work\Files. If you add a source file to your project that contains that variable's path in its destination, InstallShield DevStudio recommends that you use the variable rather than hard-coding the path. This recommendation is displayed in the Path Variable Recommendation dialog.
"

I hope the above clears some of your questions.


farrukh

farrukh
  • Full Members
  • 11 posts

Posted 25 March 2005 - 08:00

Hi aviswanathan,
Thanks for the reply smile.gif.
As I had mention in my original post, that I want to set/update the Path environment variable on user's (Target) machine where my software in going to installed.
I'm aware of Media -->Path variables which is only related to build machine and for the install shield environment in which an installer is building. This has nothing to do with Target machine (user's machine).
On the other hand, in install script, I didn't find any method to update the environment varibales on User's machine.
There is one way in Custom actions i.e. using Vb script, but I don't know how to pass the user's selected path (for installation of my product) to this Vb Script so that it can set the env variables there.
Another way (which I am currentley using) is to define the variable and associate it with some component, but during the build process, components are reset (deleted and created again) and so the defined env variable is lost and cannot be created automatically using Automation interface.

Mostly importantly, I want to do this automatically i.e. I don't have to stop the build process just to define this env variable.

Thanks smile.gif
Farrukh