On Wed, 06 May 2009 18:41 -0700, "DONG LEE" <dongl...@gmail.com> wrote: > Hi guys, > > So I am trying to edit MSI tables (component table, file table, ...) from > a > custom action while the MSI is being run. > Following are the attempts I've made, and so far I have failed miserably. > And I am attempting this because > it needs to be customized after being shipped, in runtime based on > customer's computer settings. > > 1. MsiGetActiveDatabase() to get an active database of the installer. > 2. Use the following query string to open a view using > MsiDatabaseOpenView(). > "UPDATE `Component` SET `Component`.`Attributes`='SOME_CONSTANT WHERE > `Component`.`Component`=SOME_KEY_NAME"
This line is the problem. "UPDATE `Component` SET `Component`.`Attributes`='SOME_CONSTANT WHERE `Component`.`Component`=SOME_KEY_NAME" TEMPORARY will work, but you have to use the information before the installation stops. It is not saved for the repair/upgrade/uninstall. Use the registry for that. I ran into this problem, too, when I was writing a custom action to delete added files during an uninstall. Since I was adding RemoveFile entries during uninstall for the uninstall, TEMPORARY worked just fine. > 3. Execute the view using MsiViewExecute(), but I get a vague error of > ERROR_INSTALL_FAILURE from the function. > So is it possible at all to modify a database of a running MSI through a > custom action? To permanently modify it, no. Temporarily, yes. -- Curtis Jewell swords...@csjewell.fastmail.us %DCL-E-MEM-BAD, bad memory -VMS-F-PDGERS, pudding between the ears [I use PC-Alpine, which deliberately does not display colors and pictures in HTML mail] -- Curtis Jewell swords...@csjewell.fastmail.us %DCL-E-MEM-BAD, bad memory -VMS-F-PDGERS, pudding between the ears [I use PC-Alpine, which deliberately does not display colors and pictures in HTML mail] ------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users