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
- :
- Re: MsiGetActiveDatabase() vs. Session.Database
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
‎Feb 03, 2010
04:37 AM
MsiGetActiveDatabase() vs. Session.Database
Hi,
I am trying to convert an old VBScript custom action to InstallScript or managed code. The VBScript CA modifies the RemoveFile table at runtime during uninstallation to remove files created by the installed application.
Now I tried to perform the same action with InstallScript but it looks like that MsiDatabaseCommit does not work inside a IScript CA. I found this old post but no answer.
Why does VBScript work and InstallScript not?
Holger
I am trying to convert an old VBScript custom action to InstallScript or managed code. The VBScript CA modifies the RemoveFile table at runtime during uninstallation to remove files created by the installed application.
Now I tried to perform the same action with InstallScript but it looks like that MsiDatabaseCommit does not work inside a IScript CA. I found this old post but no answer.
Why does VBScript work and InstallScript not?
Holger
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 03, 2010
01:44 PM
Perhaps see the help topic "Windows Installer API Functions Example" and this ancient newsletter tip (PDF) http://www.flexerasoftware.com/webdocuments/PDF/msiaccess.pdf. You should be able to get away without MsiDatabaseCommit, since you're editing the in-memory database and not the database file...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 03, 2010
08:07 PM
Since you are willing to consider managed code, you should look at WiX DTF. The object model is very similar to the automation interface used in VBScript except that it goes further to support things like disposal. It will make porting your code alot easier then porting it to InstallScript where you suddenly have to think like the Win32 API.
Check out the following link to get a feel for what database manipulation would look like in C# with DTF:
http://blog.deploymentengineering.com/2008/07/dynamic-windows-installer-ui.html
Check out the following link to get a feel for what database manipulation would look like in C# with DTF:
http://blog.deploymentengineering.com/2008/07/dynamic-windows-installer-ui.html
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 04, 2010
09:11 AM
RobertDickau wrote:
Perhaps see the help topic "Windows Installer API Functions Example" and this ancient newsletter tip (PDF) http://www.flexerasoftware.com/webdocuments/PDF/msiaccess.pdf. You should be able to get away without MsiDatabaseCommit, since you're editing the in-memory database and not the database file...
Thanks Robert.
Christopher Painter wrote:
Since you are willing to consider managed code, you should look at WiX DTF. The object model is very similar to the automation interface used in VBScript except that it goes further to support things like disposal. It will make porting your code alot easier then porting it to InstallScript where you suddenly have to think like the Win32 API.
Check out the following link to get a feel for what database manipulation would look like in C# with DTF:
http://blog.deploymentengineering.com/2008/07/dynamic-windows-installer-ui.html
Thanks Christopher, I just tried that DynamicUI DTF CA and it works nice. That motivates me more to make use of DTF CAs and to get familiar with C# 🙂
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 04, 2010
02:34 PM
Cool. I'm not sure what your .NET experience is, but VB.NET and C# both compile to the same intermediate language so strategically they are equivilant. You can easily write DTF CA's using VB.NET if you choose... I don't. 🙂