开发者

Deleting records from RemoveRegistry table

I've got some registry resources that need deleting on install, but not if there are other components on the target that need them. [Ideally I'd do this by associating the resources with shared components, but I don't have that option here].

I have some shared code to run SQL commands (including DELETE statements), which works fine everywhere else, but in the present case the DELETE statement appears to go through fine, but the records just don't get dropped. I've written a query to actually check the state of the table after the DELETE command runs and it looks like only the first element of the database record is actually getting deleted, with the rest of the fields in the record left intact. When I print out the table records, I get things like this, where the first field is empty

,2,SOFTWARE\xxxxxxxInstall,Version,yyyyyyy,,,

MSI (s) (A8!5C) [16:49:19:628]: Database string pool is corrupted.

I changed tack and rather than just executing a DELETE command, I did an MsiViewModify on each record with MSIMODIFY_DELETE, but I get the same issue.

In the end I've had to go with just editing the records so that they refer to a different value that I know won't exist,开发者_如何学编程 but I don't like that, for obvious reasons.

Anyone got any suggestions about this? There was a very old bug in MSI 1.0 related to string pools, but that related to MSI database files needing to be committed, which doesn't apply in the context of a custom action where you get the handle by calling GetActiveDatabase().


I'm pretty sure I recall reading somewhere that MSI SQL support for temp tables and rows is additive not subtractive. You'll notice in the SDK doco that only the INSERT INTO command has the TEMPORARY option, DELETE FROM does not.

You really need to look into organizing your components better so that your registry resources can be associated to all of the various features that have components with resources that have dependencies on the registry keys.

SQL Syntax

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜