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: Adding component using code?
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
‎May 29, 2012
08:16 AM
Adding component using code?
Is it possible to add component to exiting Msi using code (not by Install Shield \ Orca)? If so, which Msi methods should be used? In which sequence?
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 30, 2012
06:43 PM
Do you intend to add the component at build time, or some other time? For build time, there's the InstallShield Automation interface (about which see the InstallShield help topic "AddComponent Method") or the Windows Installer Automation interface (about which see the MSI help library).
Please keep in mind this might cause problems with future updates, if your component GUID is a random value each build...
Please keep in mind this might cause problems with future updates, if your component GUID is a random value each build...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 05, 2012
10:11 AM
Simple vbscript...
Set oInstaller = CreateObject("WindowsInstaller.Installer")
Dim sMSI
sMSI = ""
Set Database = oInstaller.OpenDatabase(sMSI,1)
Set TypeLib = CreateObject("Scriptlet.TypeLib")
Set View = Database.OpenView("INSERT INTO Component (`Component`,`ComponentId`,`Directory_`,`Attributes`,`Condition`,`KeyPath`)"_
" VALUES ('CompName','" & Left(TypeLib.Guid,38) & "','TARGETDIR','4','','Registry.0')")
View.Execute
View.Close
Database.Commit
Do not forget to add the Component to the FeatureComponent Table and to add your own error checking.
Set oInstaller = CreateObject("WindowsInstaller.Installer")
Dim sMSI
sMSI = "
Set Database = oInstaller.OpenDatabase(sMSI,1)
Set TypeLib = CreateObject("Scriptlet.TypeLib")
Set View = Database.OpenView("INSERT INTO Component (`Component`,`ComponentId`,`Directory_`,`Attributes`,`Condition`,`KeyPath`)"_
" VALUES ('CompName','" & Left(TypeLib.Guid,38) & "','TARGETDIR','4','','Registry.0')")
View.Execute
View.Close
Database.Commit
Do not forget to add the Component to the FeatureComponent Table and to add your own error checking.