Good day!
I am attempting to hide the AllUsersRadioGroup control on the FolderForm dialog by programatically setting it's Show condition in the ControlCondition table to 0 and it's Hide condition to 1.
Much to my frustration I am finding that calling MsiViewModify to update the appropriate record is consistently failing with ERROR_FUNCTION_FAILED.
The same code works fine for 20-odd records from various other tables in the database. I can successfully manually edit the fields in Orca.
The only difference that I can see between record updates that succeed and the ones int the ControlCondition table that don't is that this table has fields with names that are terminated with an underscore: Dialog_ and Control_... I have gleaned from documentation that this means they are external keys - I have absolutely no idea what this means however - I am new to sql/database programming! I do suspect however this is why I am unable to modify the record directly.
If anyone can shed any light on my problem I will be eternally grateful!!
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
MsiViewModify failure updating record
Started by
SirMorris
, Apr 19 2004 17:19
3 replies to this topic
Posted 19 April 2004 - 17:39
As far as I know changing records in the msi file is not supported and often doesn't work. Only adding temporary rows is allowed.
Why don't you use a property in the condition and set that property programmatically?
Why don't you use a property in the condition and set that property programmatically?
Stefan Krüger
InstallSite.org twitter facebook
Posted 19 April 2004 - 19:28
My apologies, I should have stated that I am doing the modifications to the database as a pre-process, not during install via a CA or what-not.
I have a standalone app which opens the database, performs modifications and then re-writes it like a kind of script-driven Orca.
As I said, all of the changes I make to the database except for those to the ControlCondition table work fine.
I have a standalone app which opens the database, performs modifications and then re-writes it like a kind of script-driven Orca.
As I said, all of the changes I make to the database except for those to the ControlCondition table work fine.
Edited by SirMorris, 19 April 2004 - 19:28.
Posted 19 April 2004 - 19:53
And indeed looking a little closer in msdn revealed the answer:
MSIMODIFY_UPDATE
Updates an existing record. Nonprimary keys only.
Referring to the table definition shows that indeed the field I am trying to change is a primary key.
Changing the modify mode to MSIMODIFY_REPLACE does the trick.
MSIMODIFY_REPLACE
[snip] .. Updates record if the primary keys are unchanged. Deletes old row and inserts new if primary keys have changed.
MSIMODIFY_UPDATE
Updates an existing record. Nonprimary keys only.
Referring to the table definition shows that indeed the field I am trying to change is a primary key.
Changing the modify mode to MSIMODIFY_REPLACE does the trick.
MSIMODIFY_REPLACE
[snip] .. Updates record if the primary keys are unchanged. Deletes old row and inserts new if primary keys have changed.
Edited by SirMorris, 19 April 2004 - 19:54.