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

setting Environment Variable


4 replies to this topic

JWPP

JWPP
  • Members
  • 18 posts

Posted 20 March 2002 - 11:32

wanting to us a VB Script to create a temp Env Variable so I can use MSI Script to check whether something's installed.

Anyone know the code to do this?
John Penford

Scott Williams

Scott Williams
  • Members
  • 38 posts

Posted 20 March 2002 - 18:10

I'm not sure what you mean by MSI script.  However, to set and Environment Variable in VBScript, you will need to use the WshShell.Environment object.  Here is a link to the MSDN page on it WshShell.Environment Object

Now, the question is, could you do the same thing just by setting a Property in your VBScript CA?

Session.Property("YOURPROP") = "You string to store"

This would probably be a better solution, but then again, I have no idea what you are trying to accomplish.

JWPP

JWPP
  • Members
  • 18 posts

Posted 21 March 2002 - 09:52

not quite sure what you're saying about setting a property value as I'm not sure if it'll work for what I'm trying to do....

..... I'm trying to establish whether or a certain the application is already installed on the PC. This application is a nested install. However, using the MSI Scripting (in Wise for Windows 4.0) you can't query a file, e.g. if x.exe exists then install else exit.

The only way I have found to get round this is to run a VBS first setting a Env Variable and then create;  IF SQL=NotInstalled then ...Install it.... End.

This way it checks whether it's there and then installs it depenting on the result.

Does that make sense.... is there an easier way round do you think?

Anyway, thanks for the above post I've used it and implemented it successfully.

Kind Regards.
John Penford

Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 21 March 2002 - 10:17

I use Appsearch, CompLocator, RegLocator etc.  to find previously installed programs.  I do not know Wise but I think thay should be available,

Scott Williams

Scott Williams
  • Members
  • 38 posts

Posted 21 March 2002 - 15:09

I concur with Ian on this one, that would be a *MUCH* better approach, and is exactly what those tables are in the Installer for.