cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
x_Jon_x
Level 3

ReadOnly Database Session in Custom Action

Details:
* InstallShield 2010
* Basic MSI
* Custom Action
*** Windows Installer dynamic-link library (built using WiX C# CustomAction)
*** Immediate Execution
*** Called from DoAction in Dialog

My custom action:
* dynamically retrieves a list
* for each element in the list, adds a record to the MSI database ComboBox table

The issue:
The session.Database.OpenMode is ReadOnly and thus the "... add a record to the MSI database ... " fails.

Full Description:
I have a Windows Installer dynamic-link library (built using WiX C# CustomAction) which is called by a DoAction event when DialogA's Next button is clicked. The custom action is supposed to retrieve a list based on the user's choices made on DialogA. The custom action, after retrieving this list, is then supposed to modify the database by inserting the elements into the ComboBox table so the ComboBox control on DialogB will have the appropriate elements. The problem is that the database handle passed to the custom action via the Session object indicates that the database was open with ReadOnly privliges and thus the "... add a record to the MSI database ... " portion of my custom action is failing.
Labels (1)
0 Kudos
(1) Reply
x_Jon_x
Level 3

It is correct to instantiate a View object (view).


However, DON'T Insert into view ...

view.Insert(MYNEWRECORD);

... instead Modify ...

view.Modify(ViewModifyMode.InsertTemporary, MYNEWRECORD);



This doesn't change the Database state being ReadOnly, so, I'm still a bit confussed about this, but it works, so, go figure
0 Kudos