Sunday, May 16, 2010

ERROR: GetHHCodePackages reported: HHCM_DEVICE_NOT_SUPPORTED

Issue
Below error is received in BlackBerry Manager console when trying to deploy applications to handheld device.

GetHHCodePackages reported: HHCM_DEVICE_NOT_SUPPORTED Upgrade your copy of device.xml

Cause
BlackBerry Enterprise Server does not recognise the handset version.

Solution
Update Device.xml and Vendor.xml on all BES instances.

Complete the following steps:
  1. Download the updated device.xml and vendor.xml files from the following web sites:
    https://www.blackberry.com/Desktop/Download/XML/Device.xml

    https://www.blackberry.com/Desktop/Download/XML/Vendor.xml
  2. Copy these files to the following folder: C:\Program Files\Common Files\Research In Motion\AppLoader.
Note: There is no need to restart any services.

Source:
http://www.blackberryforums.com.au/forums/general-bes-discussion/2551-how-update-device-xml-file.html

Friday, May 14, 2010

Enumerate the Windows Uninstall key

Recently I created an application install script where I needed to scan for the existence of another MSI based install and remove it (if found) before installing a newer version. This script uses the StdRegProv object to create an array of subkeys in SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall.

============================
Option Explicit

Const blnDebug = False
Const HKEY_LOCAL_MACHINE = &H80000002

Dim sSystemFolder, sUserProfile, sQuickLaunch, sComputer, oReg
Dim strKeyPath, subkey, arrSubKeys
Dim oWSH : Set oWSH = CreateObject("WScript.Shell")
Dim oFSO : Set oFSO = CreateObject("Scripting.FileSystemObject")
Dim oNET : Set oNET = CreateObject("WScript.Network")
sUserProfile = oWSH.ExpandEnvironmentStrings("%USERPROFILE%")
sQuickLaunch = sUserProfile & "\Application Data\Microsoft\Internet Explorer\Quick Launch"
sSystemFolder = oFSO.GetSpecialFolder(1)
sComputer = oNET.ComputerName

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & sComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys

For Each subkey In arrSubKeys
If subkey = "{ProductGUID#1}" Or subkey = "{ProductGUID#2}" Then
'WScript.Echo subkey & " Application found, removing it now..."
oWSH.Run "MSIEXEC.EXE /X" & subkey & " /qn", 1, False
End If
Next

InstallMSIMST "\\servername\Packages\appname\appversion", "Setup.msi", "\\servername\Packages\appname\appversion", "Setup.mst", " /qn /norestart"

Function InstallMSIMST(szMSIPath, szMSIFile, szMSTPath, szMSTFile, szParams)
oWSH.Run (sSystemFolder & "\msiexec.exe /i " & Chr(34) & szMSIPath & "\" & szMSIFile & Chr(34) & " TRANSFORMS=" & Chr(34) & szMSTPath & "\" & szMSTFile & Chr(34) & szParams), 0, True
End Function

============================

Mitch

Sunday, May 9, 2010

ERROR: STOP 0x7B Error Message on Windows XP Sysprep Images

When you start Windows XP Setup after you copy an image to a new target computer, you may receive the following error message:

STOP 0x0000007B
INACCESSABLE_BOOT_DEVICE

--------------------------------------------------------------------------------
To preinstall a mass-storage device

  1. In the \$OEM$ subfolder of the configuration set, create the \Textmode subfolder.
  2. Copy the files from the disks supplied by the device vendor to the \Textmode subfolder. These files normally include:
    • Driver.sys
    • Driver.dll
    • Driver.inf
    • Driver.cat
    • Txtsetup.oem

    where Driver is the driver name.

    Notes

    • You must also copy the driver files to the location you specified in the OemPnPDriversPath entry in the answer file(s). For example:
      OemPnPDriversPath = drivers\storage 
    • Some drivers, such as SCSI miniport drivers, may not include a .dll file.
    • A catalog file (Driver.cat) must be included with mass-storage device drivers if it is listed in Txtsetup.oem.

      For more information about catalog files, see Using Signed Drivers. Also see the Microsoft Windows Driver Development Kit (DDK), which you can read in the MSDN Library (http://msdn.microsoft.com/library/): Select Windows Development, and then select Driver Development Kit.

  3. In the Unattend.txt file, create a [MassStorageDrivers] section, and then type any driver entries in that section. For example, a possible entry in the [MassStorageDrivers] section is:
    "Adaptec 2940..." = "OEM"

    Obtain the information for this section from the [SCSI] section of the Txtsetup.oem file provided by the hardware manufacturer.

    Note

    • You must use signed drivers. Unsigned drivers are not installed during an unattended installation.
  4. In the Unattend.txt file, create an [OEMBootFiles] section, and in it type a list of the files in the \$OEM$\Textmode folder. For example:
    [OEMBootFiles]
    Driver.sys
    Driver.dll
    Driver.inf
    Driver.cat
    Txtsetup.oem

    where Driver is the driver name.

    Important

    • Add driver entries only to the [MassStorageDrivers] and [OEMBootFiles] sections for bootable mass-storage devices. Do not include secondary mass-storage devices. Instead, add the drivers for secondary mass-storage devices to the folder specified by the OemPnPDriversPath entry in your unattended Setup answer file. Including drivers for non-bootable mass-storage devices in the [MassStorageDrivers] or [OEMBootFiles] sections causes an error during Setup.
  5. If your mass-storage device is a Plug and Play device, verify that a Hardware Identification section and the name of the catalog file for the driver (Driver.cat) exist in the Txtsetup.oem file. For more information, see the Microsoft Windows Driver Development Kit in the MSDN Library (http://msdn.microsoft.com/library/): Select Windows Development, and then select Driver Development Kit.

If the Hardware Identification section does not exist, you must add [HardwareIds.scsi.yyyyy] to the Txtsetup.oem file and verify that the following information is included:

id = "xxxxx" , "yyyyy"

where xxxxx represents the device ID, and yyyyy represents the service associated with the device.

For example, to preinstall the Symc810 driver, which has a device ID of PCI\VEN_1000&DEV_0001, verify that your Txtsetup.oem file contains the following additional section:

[HardwareIds.scsi.symc810]
id = "PCI\VEN_1000&DEV_0001","symc810"

You must remove drive and path references from Txtsetup.oem. For example, instead of this text, use the NTFS or FAT32 examples that follow:

[disks]
d1 = "Windows XP Driver Set v1.00", \w2kdsk1, \win2000\smy810\

For NTFS installations, use this text:

[disks]
d1 = "Windows XP Driver Set v1.00", \w2kdsk1, \

Note the trailing slash at the end of the line.

For FAT32 installations, use this text:

[disks]
d1 = "Windows XP Driver Set v1.00", w2kdsk1, .

Note the lack of a backslash; also note the trailing period at the end of the line.

Selecting and Loading the Correct Mass-Storage Driver

If you are including new or updated drivers for mass-storage devices, you must add the new driver to both of these folders:

  • \$OEM$\Textmode
  • The location specified in the OemPnPDriversPath entry in the Unattend.txt file.

    For example: \$OEM$\$1\Pnpdrvrs\storage

Loading Mass-Storage Drivers During Text-mode Setup

If the driver for the mass-storage device is included with Windows XP, the Windows XP driver is chosen before any drivers in \$OEM$\Textmode.

However, the driver you place in \$OEM$\Textmode is the first driver chosen during text-mode Setup only if:

  • The driver that ships with Windows XP does not boot.
  • The driver does not ship with Windows XP.

Other Material:
http://support.microsoft.com/kb/303786/
Seach for "Txtsetup.oem" in Microsoft Windows Corporate Deployment Tools User's Guide. deploy.chm from the Windows XP Deployment Tools

Friday, May 7, 2010

Howto: Add a local account to a local group using WMI

I had to write this script to add an account generated by Sophos AV to the local Users group in order for it to download software updates from the AV server post build.

Option Explicit

Dim oNET : Set oNET = CreateObject("WScript.Network")
Dim sComputer, objWMIService, colItems, objItem, objLocalUser, objUserGroup
sComputer = oNET.ComputerName

Set objWMIService = GetObject("winmgmts:\\" & sComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Account Where LocalAccount = True AND Name like '%partialusername%'",,48)
For Each objItem in colItems
Set objLocalUser = GetObject("WinNT://" & objItem.Name)
Set objUserGroup = GetObject("WinNT://" & sComputer & "/Users,group")
objUserGroup.Add(objLocalUser.ADsPath)
Next

WScript.Quit

Mitch