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

Conditional installs based on ComputerName?


4 replies to this topic

ab2cv

ab2cv
  • Members
  • 6 posts

Posted 21 July 2005 - 22:54

Is there a way to conditionalise an install of an MSI and/or components or features within an MSI dependant on the name of the computer (%computername% or [ComputerName]) ?

What I ideally want to do is create a single package that I can deploy to desktops and laptops, whereby the laptops get additional components/features installed that the desktops dont. Since our organisation has a computer naming convention to distinguish a desktop from a laptop, this is the preferred method of detection/setting the condition.

I've tried using the ComputerName property to no avail and I've also tried using AppSearch combined with the RegLocator table to check for the computer name stored in the registry. Sadly, this only stores the key value "ComputerName" and not the actual data value (ie the computername itself)

Any other ideas?

Alan

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 22 July 2005 - 11:16

How exactly did yu try to use the ComputerName property? A feature conition such as
ComputerName ~>< "Laptop"
should work (is true if the computer name includes the word "laptop", not case sensitive)


ab2cv

ab2cv
  • Members
  • 6 posts

Posted 22 July 2005 - 12:37

Ahhh, I don't think I was using that exact syntax (no ~ and no quotation marks round my actual computer name).

I'll give this a try and see if it works for me.

Many thanks

Alan

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 22 July 2005 - 14:33

The quotation marks are required. Otherwise your computer name will not be recognized as a string constant but instead interpreted as a property name.
The ~ is not required but useful to make the comparison non-case-sensitive.

ab2cv

ab2cv
  • Members
  • 6 posts

Posted 22 July 2005 - 16:31

Brilliant Stephan,

It has worked a treat! I knew it had to be something simple.rolleyes.gif

Your help is much appreciated smile.gif

Alan