共用方式為


Msizap Examples

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

Msizap Examples

Example 1: Delete remnants of an active installation

The following command deletes the InProgress subkey and the indicators of an Msizap Remarks on the computer. Because the command does not specify an installation, Msizap searches all installations until it finds these objects.

In this command, the P parameter deletes the InProgress registry subkey and the S parameter deletes rollback data:

msizap PS

In response, Msizap lists the actions it took to comply with the command:

MsiZapInfo: Performing operations for user S-1-5-21-2127521184-1604012920-1887927527-00000

Searching for the Windows Installer InProgress key. . .
   Removed  \Software\Microsoft\Windows\CurrentVersion\Installer\InProgress
Searching for Installer files and folders associated with the product {ALL PRODUCTS}. . .
  Searching for rollback folders. . .
Searching for the Windows Installer Rollback key. . .
   Removed  \Software\Microsoft\Windows\CurrentVersion\Installer\Rollback

The list begins by identifying the user profile from which user-specific data is deleted. Unless the W parameter is used, only the SID of the current user appears.

The remaining elements in the list report objects deleted or changed by the command. Note that Msizap searches for all products because the command did not specify a product by name or product code.

Example 2: Remove installation data for a program

The following command deletes all Windows Installer configuration data for MyApp.exe, a fictitious program installed by the MyApp.msi package file.

The command identifies the program by using the fully qualified path to the Windows Installer package file for the program. It uses the T parameter to delete the folders, files, and registry subkeys that Windows Installer created for the package, and the P and S parameters to remove rollback data and the InProgress subkey, in case they remain in the system.

Finally, the command redirects the output to a text file (Msizap.log), so that the detailed output is recorded in the file:

msizap TPS "C:\Program Files\My Apps\MyApp.msi" > msizap.log

The resulting Msizap.log file begins by displaying the SID of the user profile from which Msizap deleted user-specific objects (in this case, the current user profile), followed by a complete log of the objects that it searched, deleted, and changed.

As expected for a command using the T parameter, the log ends with a search of the %WINDIR%\Installer folder. If this folder no longer contains any directories, then Msizap deletes the folder. In this case, the folder still contains data for other programs, so Msizap does not delete it.

Sample output

C:\myapp>msizap tps myapp.msi
MsiZapInfo: Performing operations for user S-1-5-21-2000000004-1000000000-1000000000-00000

Searching for the Windows Installer InProgress key. . .
Searching for Installer files and folders associated with the product {00000001-0001-0000-
0000-624474736554}. . .
  Searching for rollback folders. . .
Searching for the Windows Installer Rollback key. . .
Searching for the product {00000001-0001-0000-0000-624474736554} cached package. . .
   Removed file: C:\WINDOWS\Installer\56cb1ce.msi
Searching for install property data for product {00000001-0001-0000-0000-624474736554}. ..
   Removed  \10000000100000000000264447375645\InstallProperties
Searching for product {00000001-0001-0000-0000-624474736554} data in the HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall key. . .
   Removed  \{00000001-0001-0000-0000-624474736554}
Searching user's global config location for product {00000001-0001-0000-0000-624474736554}
 data. . .
  Searching for product 10000000100000000000264447375645 upgrade codes in Software\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes...
   Removed upgrade code '10000000100000000000264447375645' at HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes
  Searching for patches for product 10000000100000000000264447375645 in Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-21-2000000004-1000000000-1000000000-00000
\Products\10000000100000000000264447375645\Patches
  Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-21-2000000004-1000000000-1000000000-00000\Products\10000000100000000000264447375645 for product
data. . .
   Removed  \Features
   Removed  \Usage
   Removed  \Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-21-2000000004-1000000000-1000000000-00000\Products\10000000100000000000264447375645
  Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-21-2000000004-1000000000-1000000000-00000\Features\10000000100000000000264447375645 for product
feature data. . .
Searching per-machine global config location for product {00000001-0001-0000-0000-62447473
6554} data. . .
  Searching for product 10000000100000000000264447375645 upgrade codes in Software\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes...
  Searching for patches for product 10000000100000000000264447375645 in Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\10000000100000000000264447375
645\Patches
  Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Pro
ducts\10000000100000000000264447375645 for product data. . .
  Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Fea
tures\10000000100000000000264447375645 for product feature data. . .
Searching old global config location for product {00000001-0001-0000-0000-624474736554} da
ta. . .
  Searching for product 10000000100000000000264447375645 upgrade codes in Software\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes...
  Searching for patches for product 10000000100000000000264447375645 in Software\Microsoft\Windows\CurrentVersion\Installer\Products\10000000100000000000264447375645\Patches
  Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\Products\100000001000
00000000264447375645 for product data. . .
  Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\Features\100000001000
00000000264447375645 for product feature data. . .
Searching per-machine location for product {00000001-0001-0000-0000-624474736554} data. ..
  Searching for product 10000000100000000000264447375645 upgrade codes in Software\Classes
\Installer\UpgradeCodes...
  Searching for patches for product 10000000100000000000264447375645 in Software\Classes\I
nstaller\Products\10000000100000000000264447375645\Patches
  Searching Software\Classes\Installer\Components for published component data for the pro
duct {00000001-0001-0000-0000-624474736554}. . .
  Searching HKLM\Software\Classes\Installer\Products\10000000100000000000264447375645 for
product data. . .
  Searching HKLM\Software\Classes\Installer\Features\10000000100000000000264447375645 for
product feature data. . .
Searching old per-user location for product {00000001-0001-0000-0000-624474736554} data. ..
  Searching for product 10000000100000000000264447375645 upgrade codes in Software\Classes
\Installer\UpgradeCodes...
  Searching for patches for product 10000000100000000000264447375645 in Software\Classes\I
nstaller\Products\10000000100000000000264447375645\Patches
  Searching Software\Classes\Installer\Components for published component data for the product {00000001-0001-0000-0000-624474736554}. . .
  Searching HKCU\Software\Classes\Installer\Products\10000000100000000000264447375645 for
product data. . .
  Searching HKCU\Software\Classes\Installer\Features\10000000100000000000264447375645 for
product feature data. . .
Searching per-user location for product {00000001-0001-0000-0000-624474736554} data. . .
  Searching for product 10000000100000000000264447375645 upgrade codes in Software\Microsoft\Installer\UpgradeCodes...
   Removed upgrade code '10000000100000000000264447375645' at HKCU\Software\Microsoft\Installer\UpgradeCodes
  Searching for patches for product 10000000100000000000264447375645 in Software\Microsoft\Installer\Products\10000000100000000000264447375645\Patches
  Searching Software\Microsoft\Installer\Components for published component data for the p
roduct {00000001-0001-0000-0000-624474736554}. . .
   Removed product's published component qualifier value Convertor for published component
 10000000400000000000264447375645
   Removed published component qualifier value Convertor
   Removed HKCU\Software\Microsoft\Installer\Components\10000000400000000000264447375645
  Searching HKCU\Software\Microsoft\Installer\Products\10000000100000000000264447375645 fo
r product data. . .
   Removed  \Media
   Removed  \Net
   Removed  \SourceList
   Removed  \Software\Microsoft\Installer\Products\10000000100000000000264447375645
  Searching HKCU\Software\Microsoft\Installer\Features\10000000100000000000264447375645 fo
r product feature data. . .
   Removed  \Software\Microsoft\Installer\Features\10000000100000000000264447375645
Searching for product {00000001-0001-0000-0000-624474736554} in per-user managed location.
  Searching for product 10000000100000000000264447375645 upgrade codes in Software\Microsoft\Windows\CurrentVersion\Installer\Managed\S-1-5-21-2000000004-1000000000-1000000000-00000\Installer\UpgradeCodes...
  Searching for patches for product 10000000100000000000264447375645 in Software\Microsoft\Windows\CurrentVersion\Installer\Managed\S-1-5-21-2000000004-1000000000-1000000000-00000\
Installer\Products\10000000100000000000264447375645\Patches
  Searching Software\Microsoft\Windows\CurrentVersion\Installer\Managed\S-1-5-21-2000000004-1000000000-1000000000-00000\Installer\Components for published component data for the product {00000001-0001-0000-0000-624474736554}. . .
  Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\Managed\S-1-5-21-2000000004-1000000000-1000000000-00000\Installer\Products\10000000100000000000264447375645 for
 product data. . .
  Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\Managed\S-1-5-21-2000000004-1000000000-1000000000-00000\Installer\Features\10000000100000000000264447375645 for
 product feature data. . .
Searching for shared DLL counts for components tied to the product 10000000100000000000264
447375645. . .
Searching for shared DLL counts for components tied to the product 10000000100000000000264
447375645. . .
   Reduced shared DLL count to 1 for: C:\Test\myapp.EXE
  Searching for product 10000000100000000000264447375645 client info data. . .
   Removed client of component 30000000300000000000264447375645
   Removed client of component 40000000300000000000264447375645
   Removed client of component 50000000300000000000264447375645
   Removed client of component 51000000300000000000264447375645
   Removed client of component 71000000300000000000264447375645
   Removed client of component A0000000300000000000264447375645
  Searching for product 10000000100000000000264447375645 client info data. . .
Searching for Installer files and folders associated with the product {00000001-0001-0000-
0000-624474736554}. . .
  Searching for files and folders in the user's profile. . .
   Removed file: C:\Documents and Settings\user38.RESKIT\Application Data\Microsoft\Installer\{00000001-0001-0000-0000-624474736554}\advt.ico
   Removed file: C:\Documents and Settings\user38.RESKIT\Application Data\Microsoft\Installer\{00000001-0001-0000-0000-624474736554}\CD.ico
   Removed folder: C:\Documents and Settings\user38.RESKIT\Application Data\Microsoft\Installer\{00000001-0001-0000-0000-624474736554}
  Searching for files and folders in the %WINDIR%\Installer folder
   

Example 3: Change permissions to installation objects

The following command grants members of the Administrators group on the computer Full Control permission to the folders, files, and registry subkeys for the MyApp.msi installation. The command changes permissions only; it does not delete any installation data.

The command uses the A parameter to specify that it is changing permissions, and the T and W parameters to specify which permissions it is changing. The command changes permissions on objects that the T parameter would otherwise delete, that is, the permissions to all files, folders, and registry subkeys that Windows Installer maintains for the installation. The W parameter extends the permission changes to objects in all user profiles in the registry.

In this command, the MyApp.msi package is identified by its product code, enclosed in the required braces:

msizap ATW {00000001-0001-0000-0000-624474736554}

The resulting Msizap.log file is divided into sections for each user profile that Msizap changes. The log lists all the objects for which Msizap searched, and those on which it changed permissions.

As expected for a command using the A parameter, each section of the log ends with a search of the %WINDIR%\Installer folder.

Sample output

   ***** Adjusting ACLs on data for user S-1-5-18 for product
{00000001-0001-0000-0000-624474736554} *****

MsiZapInfo: Performing operations for user S-1-5-18
Searching for the product {00000001-0001-0000-0000-624474736554} cached package. . .
Searching for install property data for product {00000001-0001-0000-0000-624474736554}. . .
Searching user's global config location for product {00000001-0001-0000-0000-624474736554} data. . .
  Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Prod
ucts\10000000100000000000264447375645 for product data. . .
  Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Feat
ures\10000000100000000000264447375645 for product feature data. . .
Searching per-machine global config location for product {00000001-0001-0000-0000-624474736554} data. . .
  Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Prod
ucts\10000000100000000000264447375645 for product data. . .
  Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Feat
ures\10000000100000000000264447375645 for product feature data. . .
Searching old global config location for product {00000001-0001-0000-0000-624474736554} data. . .
  Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\Products\1000000010000
0000000264447375645 for product data. . .
  Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\Features\1000000010000
0000000264447375645 for product feature data. . .
Searching per-machine location for product {00000001-0001-0000-0000-624474736554} data. . .
  Searching HKLM\Software\Classes\Installer\Products\10000000100000000000264447375645 for 
product data. . .
  Searching HKLM\Software\Classes\Installer\Features\10000000100000000000264447375645 for 
product feature data. . .
Searching for product {00000001-0001-0000-0000-624474736554} in per-user managed location. 
  Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\Managed\S-1-5-18\Insta
ller\Products\10000000100000000000264447375645 for product data. . .
  Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\Managed\S-1-5-18\Insta
ller\Features\10000000100000000000264447375645 for product feature data. . .
  Searching for product 10000000100000000000264447375645 client info data. . .
  Searching for product 10000000100000000000264447375645 client info data. . .
Searching for Installer files and folders associated with the product {00000001-0001-0000-0000-624474736554}. . .
  Searching for files and folders in the user's profile. . .
   Removed ACL on file: C:\Documents and Settings\user38.RESKIT\Application Data\Microsoft\Installer\{00000001-0001-0000-0000-624474736554}\advt.ico
   Removed ACL on file: C:\Documents and Settings\user38.RESKIT\Application Data\Microsoft\Installer\{00000001-0001-0000-0000-624474736554}\CD.ico
   Removed ACL on folder: C:\Documents and Settings\user38.RESKIT\Application Data\Microsoft\Installer\{00000001-0001-0000-0000-624474736554}
  Searching for files and folders in the %WINDIR%\Installer folder

***** Adjusting ACLs on data for user S-1-5-18 for product 
{00000001-0001-0000-0000-624474736554} *****
... (Data truncated)

_**** Adjusting ACLs on data for user S-1-5-21-2127521184-1604012920-1887927527-31305 for product {00000001-0001-0000-0000-624474736554} ****_
... (Data truncated)

_**** Adjusting ACLs on data for user S-1-5-21-2127521184-1604012920-1887927527-31305 for product {00000001-0001-0000-0000-624474736554} ****_
... (Data truncated)
  Searching for files and folders in the %WINDIR%\Installer folder
   

Example 4: Delete configuration data for another user

The following command deletes Windows Installer configuration data for MyApp.msi for all users of the computer. The command is intended to remove installer data from the profile of User21, a user who is not a member of the Administrators group on the computer. To assure that the user's profile is loaded in the registry, the command must run while User21 is logged on to the system. However, because Msizap runs only with Administrator permissions, an administrator must run this command. In this example, the administrator uses the Runas command extension to provide user credentials. For information about using the Runas command, see "Runas" in Help for Windows Server 2003.

The command uses the T parameter to specify that all Windows Installer files, folders, and registry subkeys for MyApp.msi are deleted. It also uses the W parameter to make certain that the profile of User21 is affected, because Runas can temporarily make the administrator the current user of the computer.

The command is run by the administrator while User21 is logged on to the computer.

runas /env /user:Computer21\Administrator msizap TW MyApp.msi

In response, Runas prompts the administrator for a password, and then Msizap responds to the command. All MyApp.exe installer configuration data for all users, including User21, is deleted.

Example 5: Delete all configuration data from the system

The following command deletes all Windows Installer configuration data for all programs on the system. Because this command can cause serious and irreparable harm, it is very rarely used.

The command uses the * ALLPRODUCTS parameters to extend the command to all products that Windows Installer installed on the system. It uses the W parameter to delete data from all user profiles. The only Windows Installer data that might remain in the system when the command completes is data that is stored in user profiles that are not present in the registry when the command runs.

msizap *W ALLPRODUCTS

See Also

Concepts

Msizap Overview
Msizap Remarks
Msizap Syntax
Alphabetical List of Tools
Windiff Overview
Remote Overview
Poolmon Overview
Msicuu Overview
Memsnap Overview
Gflags.exe
Devcon Overview