Meha Posted December 24, 2008 Posted December 24, 2008 (edited) mritter,Here is a small bug.getOSver() returns "NOT_FOUND" for Windows Server ® 2008.*****if (ver.indexOf("Windows7") != -1) szOSVerCache="Win7";if (ver.indexOf("Server 2008") != -1) -> will not work as it returns info as "Windows Server ® 2008" szOSVerCache="08";if (ver.indexOf("Vista") != -1) szOSVerCache="Vista";*****Better use Build no. Version 6.0.6000 Build 6000 -> for Vista Version 6.0.6001 Build 6001 -> for Windows 2008for time being, I changed this as if (ver.indexOf("2008") != -1) szOSVerCache="08";Hope this helps. Edited December 24, 2008 by Meha
Kelsenellenelvian Posted December 24, 2008 Author Posted December 24, 2008 Minor code revision.WPI no no longer sees USB drives as CD\DVD drives. It will now write to them again.
Kelsenellenelvian Posted December 24, 2008 Author Posted December 24, 2008 @ Meha = Thats too confusing as my Vista is build 6002 now....Thats a variable that changes too much.
mritter Posted December 25, 2008 Posted December 25, 2008 @Meha: I changed the code to yourif (ver.indexOf("2008") != -1)szOSVerCache="08";I have never installed Server '08; was relying on other people's input. I probably should do the same for Server 2003.
Meha Posted December 26, 2008 Posted December 26, 2008 (edited) mritter,Following is the modified version of WMI section of getOSver()I have tested this on XP, 2003, Vista and 2008 and returns correct value.I don't have Windows 7, Windows 2000 Pro and 2000 Server test machines. Hope somebody elseWill test it on these platforms and give you the feed back.This is adapted from GetNativeSystemInfo(ref SYSTEM_INFO lpSystemInfo) using OSVERSIONINFOEX *****************************************************objWMIService=GetObject("winmgmts:\\\\" + "." + "\\root\\CIMV2");colItems=objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly);enumItems=new Enumerator(colItems);objItem=enumItems.item();ver = objItem.Version.substr(0,3);prodType = objItem.ProductType; if ( ver == "6.1" ) // please confirm version no. on Windows 7 { if ( prodType == 1 ) { sVersionID = "Win7"; // Windows 7 } else { sVersionID = "08R2"; // Windows Server 2008 R2 -> next server version based on Windows 7 } } else if ( ver == "6.0" ) { if ( prodType == 1 ) { szOSVerCache = "Vista"; } else { szOSVerCache = "08"; } } else if ( ver =="5.2" ) { if ( prodType == 1 ) { szOSVerCache = "XP"; // 64 bit version as per MSDN doc. not tested by me } else { szOSVerCache = "03"; } } else if ( ver =="5.1" ) { szOSVerCache = "XP"; } else if ( ver =="5.0" ) // Not sure about reliability of WMI on Win 2000. Just for completeness. Need not go for 2KP & 2KS { if ( prodType == 1 ) { szOSVerCache = "2KP"; } else { szOSVerCache = "2KS"; } }*****************************************************Here are the possible product types.wProductType Any additional information about the system. This member can be one of the following values.Value Meaning VER_NT_DOMAIN_CONTROLLER0x0000002 The system is a domain controller and the operating system is Windows Server 2008, Windows Server 2003, or Windows 2000 Server.VER_NT_SERVER0x0000003 The operating system is Windows Server 2008, Windows Server 2003, or Windows 2000 Server.Note that a server that is also a domain controller is reported as VER_NT_DOMAIN_CONTROLLER, not VER_NT_SERVER.VER_NT_WORKSTATION0x0000001 The operating system is Windows Vista, Windows XP Professional, Windows XP Home Edition, or Windows 2000 Professional.*****************************************************MSDN library link to OSVERSIONINFOEX Structurehttp://msdn.microsoft.com/en-us/library/ms724833(VS.85).aspxIf you like, you can even have IsServer() and IsWorkstation() functions as conditions.prodType == 1 for WorkstationprodType > 1 for ServerHope this will settle getOSVersion() issues.Meha Edited December 26, 2008 by Meha
mritter Posted December 27, 2008 Posted December 27, 2008 Thanks, Meha. I will give it run through. I do like the idea of isServer() and isWorkstation().
jcbrief Posted December 28, 2008 Posted December 28, 2008 Is there a way to determine the difference between XP Home and XP Pro?,Virtual PC 2007 only works on pro, not home.thanksJoe
mritter Posted December 28, 2008 Posted December 28, 2008 Well......for XP it is a little difficult. I will make a way to do it. 7.3.0 will have it.
jcbrief Posted December 28, 2008 Posted December 28, 2008 (edited) Thanks, will keep checking back,OBTW seeming simular to what is done to determine which OS, etc is this site (I think with .net).http://www.codeproject.com/KB/system/osver...roducttype.aspxBut from what I can tell, there are differences. Got lost at that point.Joe Edited December 28, 2008 by jcbrief
kalikanzaros Posted December 29, 2008 Posted December 29, 2008 found 3 problems/bugs in 7.22 ( wpi running from hdd/flash-drive on completely installed Win XP SP3 eng + RyanVM's Post-SP3 Update Pack or at Win XP SP2 rus + all updates via automatiс update service)1. not working command like: %extract% "%WPIPATH%\Install\5xx.media\530.vlc\*.7z" "%programfiles%"in 6.4.1 it's woks fine2. folder with WPI.hta have got name "WPI_722" and placing in the root of usb flash drive (i:\WPI_722\WPI.hta) can't save changing in config.js or/and useroptions.js as "can't save to cd/dvd" why????in 6.4.1 it's woks fine3. all versions have foll bug: thera are 4 folders with wpi:i:\WPI_722\WPI.hta (version 7.2.2) usb flash diski:\WPI\WPI.hta (version 6.4.1) usb flash diskf:\WPI\WPI.hta (version 6.4.1) hdd diskf:\WPI_722-01\WPI.hta (version 7.2.2) hdd diskafter working with 7.2.2 from usb (i:\WPI_722\WPI.hta), try to run wpi 6.4.1 from hdd or from flash-drive, wpi 6.4.1 using useroptions.js from 7.2.2!!!!and not works, as at 6.4.1 using Orange_mood theme, 7.2.2 using CorporateIT, and wpi 6.4.1 don't contain theme CorporateIT after rename foder with 7.2.2 can start 6.4.1 normally with using own useroptions.jsthe same situation with 7.2.2:after working with 7.2.2 from usb (i:\WPI_722\WPI.hta), run wpi 7.2.2 from hdd, made changes in config.js and useroptions.js pressed save and exit application, how i was surprised found that all changes saved at wpi folider located at flash disk!!!
Kelsenellenelvian Posted December 29, 2008 Author Posted December 29, 2008 #2 Is fixed redownload (It was done as a silent update like 4 days ago)#3 WPI leaves reg entry for remembering the last location in the case of reboots and such. So to fix that you need to add the following regfile to your execute after:Windows Registry Editor Version 5.00[-HKEY_CURRENT_USER\Software\WPI]Like so: Regedit /S %wpipath%\install\Clean.reg Remeber to look at your path and file name!
kalikanzaros Posted December 31, 2008 Posted December 31, 2008 (edited) 2 Kelsenellenelvianthanks, what abt #1in the previous version user can save several files with extension 7z (for example) in one folder, and all of them will be extracted using one command, in 7.2.2 it's not working...may be better to add #3 as option to useroptions.js in next version? and give to user chance to choice - keep in registry last location of config files or not? Edited December 31, 2008 by kalikanzaros
Kelsenellenelvian Posted December 31, 2008 Author Posted December 31, 2008 That one I have to leave up to mritter he changed the extract proccess a bit ago.
mritter Posted December 31, 2008 Posted December 31, 2008 @Kalikanzaros: I did update the extract command, but only by making the code internal instead of external. I will give it a test today and see what's up.
mritter Posted December 31, 2008 Posted December 31, 2008 @Kalikanzaros: In your log file, does it say this at the extract command?*** Error: Extract FileExists() ***If so, then consider it fixed. If not, post that section of the log so I can see what it says.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now