Converting MSI to WSI￼
- April 12, 2022
- Posted by: Laraonline2020
- Category: End User Computing
The following steps describe the conversion of MSI to WSI: (Converting MSI to WSI)
(Converting MSI to WSI) Step 1) Open the MSI with Windows Installer Editor
Steps 2) under the tools menu select MSI to WSI conversion:
Step 3) Click on next for selecting new source directory:
Step 4) Click Next …
Step 5) Click Next
Click Finish Installation.
This completes the MSI to WSI conversion
MSI Cabinets and Compressed source
A cabinet is a single file, usually with a .cab extension, that stores compressed files in a file library. The cabinet format is an efficient way to package multiple files because compression is performed across file boundaries, which significantly improves the compression ratio.
Package authors can reduce the size of their installation packages by compressing the source files and including them in cabinet files. The source file image can be compressed, uncompressed, or a mixture of both types.
A source consisting entirely of compressed files should include the compressed flag bit in the Word Count Summary Property. The compressed source files must be stored in cabinet files located in a data stream inside the .msi file or in a separate cabinet file located at the root of the source tree. All of the cabinets in the source must be listed in the Media table.
A source consisting entirely of uncompressed source files should omit the compressed flag bit from the Word Count Summary Property. All of the uncompressed files in the source must exist in the source tree specified by the Directory table.
To mix compressed and uncompressed source files in the same package, override the Word Count Summary property default by setting the msidbFileAttributesCompressed or msidbFileAttributesNoncompressed bit flags on particular files. These bit flags are set in the Attributes column of the File table if the compression state of the file does not match the default specified by the Word Count Summary property.
For example, if the Word Count Summary property has the compressed flag bit set, all files are treated as compressed into a cabinet. Any uncompressed files in the source must include msidbFileAttributesNoncompressed in the Attributes column of the File table. The uncompressed files must be located at the root of the source tree. If the Word Count Summary property has the uncompressed flag set, files are treated as uncompressed by default and any compressed files must include msidbFileAttributesCompressed in the Attributes column of the File table. All of the compressed files must be stored in cabinet files located in a data stream inside the .msi file or in a separate cabinet file located at the root of the source tree.
Including a Cabinet File in an Installation
For including a Cabinet File in installation follow these steps:
Step 1) Use a cabinet creation tool to compress the source files into a cabinet file. The cabinet file must either be located in a data stream inside the .msi file or in a separate cabinet file located at the root of the source tree specified by the Directory Table. Determine whether the source is to be a compressed type or a mixed type that has both uncompressed and compressed files. Depending on the type of source image, set the compressed or uncompressed flag bits of the Word Count Summary Property.
Step 2) Add a record to the File table for each of the files in the cabinet. Enter a file key in the File column that exactly matches the file key of the file in the cabinet. The file keys are case-sensitive. The file installation sequence in the File table and the cabinet must also be the same. The file sequence is specified by the sequence number in the Sequence column. To arrive at the sequence number for the first file in the cabinet, do the following. Find the existing record in the Media table having the greatest value in the DiskID column. The LastSequence field of this record gives the last file sequence number used on the media. In the File table, assign the first file of the new cabinet a sequence number that is greater than this. Assign sequence numbers to all of the remaining files in the same order as in the cabinet file.
Step 3) Add a record to the Media table for the cabinet. Specify a value in the DiskID field of this new record that is greater than the largest DiskID value already existing in the table. Put the name of the cabinet into the Cabinet field. This name must be in the form of a Cabinet data type. Prefix the name with a number sign “#” if the cabinet is a data stream stored in the .msi file. Note that if the cabinet is a data stream, the name of the cabinet is case-sensitive. If the cabinet is a separate file, the name of the file is not case-sensitive.
Step 4) Determine the greatest file sequence number in the new cabinet by checking the Sequence column of the updated File table. Enter a value that is greater than this into the LastSequence field of the new record of the Media table.
Msidb.exe (Tool) can be used to store the cabinet file in the installation package or by using the installer’s Database Functions. The following four steps explain how to add the cabinet from a program by using the database functions. To add the cabinet to the installation package from a program open a view on the _Streams table of the database using MsiDatabaseOpenView.
- Use MsiRecordSetString to set the Name column of the _Streams table to the name appearing in the cabinet column of the Media table. Omit the number sign: #.
- Use MsiRecordSetStream to set the Data column of the of the _Streams table to the cabinet’s data.
- Use MsiViewModify to update the record in the _Streams table.
- To use Msidb.exe to add the cabinet file Mycab.cab to the installation package named Mydatabase.msi, use the following command line:
Msidb.exe -d mydatabase.msi -a mycab.cab. In this case, the Cabinet column of the Media table should contain the string: #mycab.cab.
Ordering File Sequence Numbers
The File table contains a complete list of all the source files for the installation. Files can be stored on the source media as individual files or compressed within cabinet files. The sequence numbers in the Sequence column of the File table, together with the LastSequence field of the Media table, specify both the order of installation for files and the source media on which each file is located. Each record in the Media table identifies the source disk containing all the files with sequence numbers less than or equal to the value shown in the LastSequence column and greater than the LastSequence value of the previous disk.
Digital Signatures and External cabinet files
The Windows Installer version 2.0 uses digital signatures to detect corrupted resources. A signer certificate may be compared to the signer certificate of an external resource to be installed by the package.
With Windows Installer version 2.0, digital signatures can be used with Windows Installer packages, transforms, patches, merge modules, and external cabinet files. Windows Installer version 2.0 is integrated with Software Restriction Policy on Microsoft® Windows XP. Policies can be created to allow or prevent installations based upon different criteria, including a particular signer certificate or publisher. The Windows Installer version 2.0 can perform signature validation of external cabinet files on all platforms where CryptoAPI version 2.0 is installed.
Performing an administrative installation removes the digital signature from the package. An administrative installation modifies the installation package in order to add the AdminProperties stream, which would invalidate the original digital signature. An administrator can resign the package.
Applying a patch to an administrative installation also removes the digital signature from the package. The reason is because the changes persist in the patched installation package of the administrative installation. An administrator can resign the package.
Cabinet Data Types
If the cabinet name is preceded by the number sign, the cabinet is stored as a data stream inside the package. The character string which follows the # is an Identifier for this data stream. Note that if the cabinet is stored as a data stream, the name of a cabinet is case-sensitive. If the cabinet name is not preceded by the number sign #, the cabinet is stored in a separate file located at the root of the source tree specified by the Directory Table. The cabinet file must use the short file name syntax consisting of an eight character name, a period, and a three character extension. The Cabinet data type cannot use the short|longname syntax for file names. If the cabinet file is stored as a separate file, the name of the cabinet file is not case-sensitive. To conserve disk space, the installer removes any cabinets embedded in the .msi file before caching the installation package on the user’s computer.