' Windows Installer utility to manage installer policy settings
' For use with Windows Scripting Host, CScript.exe or WScript.exe
' Copyright (c) 1999-2000, Microsoft Corporation
' Demonstrates the use of the installer policy keys
' Policy can be configured by an administrator using the NT Group Policy Editor
'
Option Explicit
Dim policies(13, 4)
policies(0, 0)="LM" : policies(0, 1)="HKLM" : policies(0, 2)="Logging" : policies(0, 3)="REG_SZ" : policies(0, 4) = "Logging modes if not supplied by install from set iwearucmpv"
policies(3, 0)="WT" : policies(3, 1)="HKLM" : policies(3, 2)="Timeout" : policies(3, 3)="REG_DWORD" : policies(3, 4) = " Wait timeout in seconds in case of no activity"
policies(4, 0)="DB" : policies(4, 1)="HKLM" : policies(4, 2)="DisableBrowse" : policies(4, 3)="REG_DWORD" : policies(4, 4) = " Disable user browsing of source locations if 1"
policies(5, 0)="DP" : policies(5, 1)="HKLM" : policies(5, 2)="DisablePatch" : policies(5, 3)="REG_DWORD" : policies(5, 4) = " Disable patch application to all products if 1"
policies(6, 0)="UC" : policies(6, 1)="HKLM" : policies(6, 2)="EnableUserControl" : policies(6, 3)="REG_DWORD" : policies(6, 4) = " Public properties sent to install service if 1"
policies(7, 0)="SS" : policies(7, 1)="HKLM" : policies(7, 2)="SafeForScripting" : policies(7, 3)="REG_DWORD" : policies(7, 4) = " Installer safe for scripting from browser if 1"
policies(8, 0)="EM" : policies(8, 1)="HKLM" : policies(8, 2)="AlwaysInstallElevated": policies(8, 3)="REG_DWORD" : policies(8, 4) = "System privileges if 1 and HKCU value also set"
policies(9, 0)="EU" : policies(9, 1)="HKCU" : policies(9, 2)="AlwaysInstallElevated": policies(9, 3)="REG_DWORD" : policies(9, 4) = "System privileges if 1 and HKLM value also set"
policies(10,0)="DR" : policies(10,1)="HKCU" : policies(10,2)="DisableRollback" : policies(10,3)="REG_DWORD" : policies(10,4) = " Disable rollback if 1 - use is not recommended"
policies(11,0)="TS" : policies(11,1)="HKCU" : policies(11,2)="TransformsAtSource" : policies(11,3)="REG_DWORD" : policies(11,4) = " Locate transforms at root of source image if 1"
policies(12,0)="TP" : policies(12,1)="HKCU" : policies(12,2)="TransformsSecure" : policies(12,3)="REG_DWORD" : policies(12,4) = " Pin secure tranforms in client-side-cache if 1"
policies(13,0)="SO" : policies(13,1)="HKCU" : policies(13,2)="SearchOrder" : policies(13,3)="REG_SZ" : policies(13,4) = "Search order of source types, set of n,m,u (default=nmu)"
Dim argCount:argCount = Wscript.Arguments.Count
Dim message, iPolicy, policyKey, policyValue, WshShell, policyCode
On Error Resume Next
' If no arguments supplied, then list all current policy settings
If argCount = 0 Then
Set WshShell = WScript.CreateObject("WScript.Shell") : CheckError
For iPolicy = 0 To UBound(policies)
policyValue = ReadPolicyValue(iPolicy)
If Not IsEmpty(policyValue) Then 'policy key present, else skip display
If Not IsEmpty(message) Then message = message & vbLf