mystack
mystack

Reputation: 5492

Edit a msi database table

how can i add or delete entry of a msi database table using msidb.exe rather than using the orca.Is there any commandline like below

msidb.exe [msipath][importingFilepath]

Once the file is added the corresponding entries in the msi tables should be updated

Thanks,

Upvotes: 4

Views: 4116

Answers (2)

Mark Rovetta
Mark Rovetta

Reputation: 691

Although tools such as msidb.exe are capable of exporting and importing text archive files, text archive files should only be used for the following specific purposes.

  • Text archive files can be used with version control systems.
  • To remove wasted storage space and reduce the final size of .msi files.
  • To add localization information to an installation database.
  • To determine the code page of a database.
  • To set the code page of a database.
  • To increase the limit of a database column. Authors cannot change the column data types, nullability, or localization attributes of any columns in standard tables.

A text archive file for a Windows Installer database carries an .idt file name extension and is in the Archive File Format.

You should use a Windows Installer table editing tool, such as Orca or a third-party tool, to create and modify an installation package.

Upvotes: 1

Christopher Painter
Christopher Painter

Reputation: 55581

I'll assume you want to do this in C# since you included the C# tag. WiX has a component called Deployment Tools Foundation (DTF - you'll find and SDK chm in the start menu ) that provides an excellent MSI interop.

Consider this:

using Microsoft.Deployment.WindowsInstaller;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            using( var database = new Database(@"C:\test.msi", DatabaseOpenMode.Direct))
            {
            }
        }
    }
}

That gives you the starting point to do anything you want to the database via SQL queries.

Upvotes: 6

Related Questions