Jump to content

Built-in WPI Functions


Recommended Posts

Where is the list of all available Built-in WPI Functions and there acceptable commands? The manual only gives a few and does not give all acceptable parameters (i.e. getOSVer()=="2000" is not even there, but it works). The PRIMARY reason I ask for this is because I am looking for a function that can tell me if the OS is x86 or x64

Does such a command exist? If not, I was thinking of using the RegKeyValue or RegKeyExists entries but am not sure where to look...

Your thoughts? Thanks!

Link to comment
Share on other sites


Found a way:

x86

RegKeyValue("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE")=="x86"

x64

RegKeyValue("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE")=="AMD64"

Using VBScript, you can do it like this:

sub EnsureNativeScriptEngine

On Error resume next
dim WshShell,WshProcEnv,process_architecture
Set WshShell = CreateObject("WScript.Shell")
Set WshProcEnv = WshShell.Environment("Process")
process_architecture= WshProcEnv("PROCESSOR_ARCHITECTURE")
end sub

I notice you closed the 'suggestions' topic. I had a couple of ideas I wanted to bounce off of you (one of them was this)

One idea I had was having 'description on condition met' dialog thing that would come up if a 'grey condition' was enabled so that on mouse over, the user would 'know' why it was greyed out etc so I can display ("already installed" or "not compatible with <insert OS here>" etc

Another idea I had was to add the ability to execute '1 last thing' @ the end, before WPI closes, like a cleanup script option incase we need to take care of misc things (Right after installer.hta finishes).

On a sorta related topic:

I noticed that for the 'reboot feature' of WPI, you use the 'shutdown -f -r -t xx' command...why not a vb script that acts like a 'native reboot'

Below, I found from somewhere on the net and I use it in my own scripts and it is equivalent to 'Startmenu - > shutdown -> restart'

Function displayRebootConfirmation()

Ret=Msgbox ("Setup needs to restart in order to complete installation. Would you like to restart now?",VBYesNo,"Restart Now?")

If Ret=6 then
Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery ("select * from Win32_OperatingSystem where Primary=true")

for each OpSys in OpSysSet
OpSys.Reboot()
next
end if

End Function

Just a couple of thoughts. Great work with this tool by the way, an absolute lifesaver!

Edited by JuMz
Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...