MSFN Forum: WPI Conditional Statements Enhancement - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

WPI Conditional Statements Enhancement Rate Topic: -----

#1 User is offline   BlueLabel 

  • Group: Members
  • Posts: 7
  • Joined: 28-December 04

  Posted 01 January 2005 - 08:54 AM

Working through the night trying to get the unattended CD/DVD I'm trying to setup I ran into a limitation of WPI and pulled together an enhancement that others might find of use:

My problem is that I want to create a single DVD that brings up WPI, but only with certain applications available to install. Why? In my case, it's hardware-specific information, but it can be almost any reason. The attached version of WPI, which for simplicity I'll dub WPI-BL, adds a new entry in the Config screen for each application called 'Condition' that expects a Javascript statement. When generating the menu, WPI will evaluate the condition -- if it evaluates to true (1) then it's displayed...if it evaluates to false (0) then the entry won't appear on the menu.

As a practical example:

fso.FileExists("%windir%\\System32\\Drivers\b57xp32.sys") || fso.FileExists("%windir%\\System32\\Drivers\\bcm4sbxp.sys")


This will check to see if (in this case) the Broadcom Ethernet drivers are installed in the system. I have attached to an entry that installs the Broadcom Advanced Diagnostics for Windows. Installing this (or even making it an option) just doesn't make sense on a system that doesn't have the right network card.

fso.FileExists("%windir%\\System32\\atiddc.dll")


This checks to see if the ATI drivers are installed...I have this condition attached to an entry to install some ATI-specific software. In my environment, I need a swiss army knife installation CD -- I know what all the hardware combinations are and rather than be inundated with options for things that don't make sense on the machine I'm on at the moment, we just hide them...but I still have all the convinience of keeping a single image to maintain.

Enjoy...

Attached File(s)




#2 User is offline   Astalavista 

  • MSFN loyalist
  • PipPipPipPipPipPipPipPipPip
  • Group: Banned
  • Posts: 3,338
  • Joined: 02-December 03

Posted 01 January 2005 - 09:08 AM

aren't u using bashrat's device drivers?

it automatically installs drivers

but your work is appreciated.

#3 User is offline   BlueLabel 

  • Group: Members
  • Posts: 7
  • Joined: 28-December 04

Posted 01 January 2005 - 09:35 AM

Astalavista, on Jan 1 2005, 09:08 AM, said:

aren't u using bashrat's device drivers?

it automatically installs drivers

but your work is appreciated.

No, I'm not...but the drivers themselves aren't the issue. All the drivers do, in fact, get installed automatically. That's not what I was originally trying to do. There are certain hardware-specific applications that I was interested in.

In my situation, I've got several Dell laptops to contend with that are different models and have different hardware configurations. The ASF Management and Broadcom Diagnostics applications, for instance, will only work if the system in question has a Broadcom card in the first place. This isn't a driver question -- the drivers are in fact already installed and working just fine.

Another example, that's relevant for me -- some of these laptops have NVidia cards and some have ATI cards. Again, the drivers get installed fine...but what I want to do is also have the option to install tweaks/tools based on which card is in the system, so conceptually I do:

if(This machine has an NVidia card)  {
  Add menu entries for NVDVD, NVHardPage, GeForceTweakUtility, etc.
}

if(This machine has an ATI card)  {
  Add menu entries for ATI Tray Tools, etc...
}


The hardware selection aspect is just one example (the one I happened to use the most so far in my builds). You can also do funky things like (on Dells and other systems that have a service/asset tag accessible) make menu options available only on certain specific machines.

Another use I've had for this functionality already is not making applications with a large footprint available if the hard drive is below a certain size, for instance.

I'm sure everyone here whose had a lot more sleep than I have will come up with infinitely more ways to use the functionality provided. :)

Hope this helps...

#4 User is offline   Wile.E 

  • Group: Members
  • Posts: 9
  • Joined: 25-May 04

Posted 02 January 2005 - 02:13 PM

Sounds very interesting to me. Especially for installing the Ati Drivers.
Have to do some test.

Maybe Hasi could put it into the final version.

#5 User is offline   hasi001 

  • Coder
  • PipPipPip
  • Group: Members
  • Posts: 324
  • Joined: 27-September 04

Posted 02 January 2005 - 03:25 PM

This I'll do for sure.

Nice changes BlueLabel. Cool enhancement. I'll replace the cons-property with your cond-property, since it's more useful.

Changes will be included in next WPI version (this week).

#6 User is offline   Wile.E 

  • Group: Members
  • Posts: 9
  • Joined: 25-May 04

Posted 05 January 2005 - 02:07 AM

Do somebody have more examples to use it with wpi?

#7 User is offline   hasi001 

  • Coder
  • PipPipPip
  • Group: Members
  • Posts: 324
  • Joined: 27-September 04

Posted 05 January 2005 - 02:46 AM

See here.

#8 User is offline   BlueLabel 

  • Group: Members
  • Posts: 7
  • Joined: 28-December 04

Posted 10 January 2005 - 11:12 PM

hasi001, on Jan 2 2005, 03:25 PM, said:

This I'll do for sure.

Nice changes BlueLabel. Cool enhancement. I'll replace the cons-property with your cond-property, since it's more useful.

Changes will be included in next WPI version (this week).

Sorry I've been a bit indisposed...glad to see it incorporated and that it's of some use. Hasi -- nice example usage. I might have a few examples to post in short order that others might find of use.

Is there a 'script repository' or perhaps a 'cond repository' thread anywhere? Or do we just let folks search and stumble upon it? :)

#9 User is offline   hasi001 

  • Coder
  • PipPipPip
  • Group: Members
  • Posts: 324
  • Joined: 27-September 04

Posted 11 January 2005 - 12:43 AM

no - but people would happy, if you'd open one to spare them searching

#10 User is offline   ankap 

  • Junior
  • Pip
  • Group: Members
  • Posts: 96
  • Joined: 18-March 04

Posted 12 January 2005 - 09:37 PM

Please insert statements to check if registry key and value exists or equals smth.

#11 User is offline   hasi001 

  • Coder
  • PipPipPip
  • Group: Members
  • Posts: 324
  • Joined: 27-September 04

Posted 13 January 2005 - 10:10 AM

Good idea. Next version. Will take a while.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy