This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- ReadOnly Database Session in Custom Action
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Aug 11, 2009
12:53 PM
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.
* 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.
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Aug 17, 2009
01:42 PM
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
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