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

preset installdir based on environment setting?


7 replies to this topic

BeemerBiker

BeemerBiker
  • Members
  • 12 posts

Posted 31 January 2006 - 15:49

Currently, our install project default location is "d:\dcn" where "d:" is a raid drive. However, it might also be "E:" depending on partitions on the "C".

We have an environment variable that is set when the raid, ide, c, d, etc are configured. "DCN_ROOT=E:\DCN" for example. This is prior to the installation of our software. I would like to change the [installdir] location to have it lookup the environment variable. I know how to get it and pass it back into the install program using a function, can [installdir] be set to its value? How is this done.
We have DevStudio 9.0


antyagi

antyagi
  • Full Members
  • 121 posts

Posted 31 January 2006 - 17:44

Add a CA that sets INSTALLDIR property, call CA before InstallInitialize, and its done.
  ankur tyagi

BeemerBiker

BeemerBiker
  • Members
  • 12 posts

Posted 31 January 2006 - 20:38

thanks, but I think that is exactly what I cant figure out.

For at least starters, if I go to files and look at the target computer, how can i change [installdir] to be E:\DCN

Currently it is under [WINDOWSVOLUME]

We just got an upgrade from 9.0 to 11 maybe there are some examples in 11



Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 31 January 2006 - 20:40

Question to BeemerBiker:
Since you're detecting RAID drives, do you know how to detect them programmatically? I understand you read an environment variable, apparently set one way or another. If it's done by a program I sure like to know...

BeemerBiker

BeemerBiker
  • Members
  • 12 posts

Posted 31 January 2006 - 23:52

Z...
We are not detecting them programetically. I looked into doing this and I would have to populate the Adaptec Controller then pick off the drive letter. That was too much trouble. It was easier to enumerate the volumes and look for the names "DATA" for raid, "SYSTEM" for "C" and "APPS" for the applications. This is unique to our install. We got about 50 systems we are building and are using Acronis server on 2003 server to handle preloading the disks so it was easy to name the volumes and then look for those names during the install. If I had more time I would populate the controller, pick off the letter and use that on the install.

I have not figured out how to get the installshield to use that info. Currently, I got a VBscript that creats shares and structures and then prints out a message to use "e:\dcn" and then the user has to remember to put in e:\dcn when running installshield. Eventually i will get just one install and not use two procedures, at least that is my hope!



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 01 February 2006 - 10:28

To change the default value for INSTALLDIR go to General Settings.
To set INSTALLDIR based on an environment variable add a custom action of type Set a Property and insert it before CostInitialze in the InstallUI and InstallExecute sequences.

BeemerBiker

BeemerBiker
  • Members
  • 12 posts

Posted 03 February 2006 - 02:32

Thanks, that worked. To show you how difficult something like this is to a newbie. Take your phrase "General Settings"

It should be Descripion - General Information - Product Properties

at that location I put in E:\DCN and observed that E:\DCN shows up under target computer for the folder. It would appear I could have just entered in a new folder named "E:\DCN" but I didnt know that nor hitting F1 gave any help.

One would IMHO assume that you could right click on [INSTALLDIR] and find properties and somewhere change [WINDOWSVOLUME]\DCN to E:\DCN but no, they didnt make it that simple

On getting the environment setting using a Custom Action, indeed there was an example of how to do a GetEnvVar in a custom action. The demo example showed getting the var and then printing it in a message box. If I wrote the example I would have showed how to return the value back in addtion to printing it out. It is nice to print something out as you know it got the value correct. It is more important to get the value back. This is not too user friendly.

On a similar subject I noticed that many times, in the help documention, they refer to topics or items that I cannot find. Rather, I can find them in the help, but I got to hunt for the property in the InstallScript program itself. Reminds me of microsoft asking people to click on "any key". However InstallShield seems to have more "Any Keys" than any other product I have bought.



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 06 February 2006 - 17:47

QUOTE
Take your phrase "General Settings"
It should be Descripion - General Information - Product Properties

Sorry if this incorrectness was misleading. I'm writing most of my replies here from the top of my head so I sometimes don't get the wording exactly right. BTW in InstallShield 11.5 Basic MSI projects the location is Installation Information > General Information > Product proeprties.
But I'm glad you were able to find it.

In a Basic MSI project you can access an environment varialble like this:
[%YOUR_ENV_VAR]
so you could add a custom action of type "Set a property" to set INSTALLDIR to [%YOUR_ENV_VAR]

QUOTE
I noticed that many times, in the help documention, they refer to topics or items that I cannot find.

The different projects types make the help topics somtimes confusing. You need to look carefully to which project types the topic applies (and yes, the help is sometimes wrong)