With a windows MSI file, is there a way to grab all the possible installation paramet开发者_如何学JAVAers in .NET code? I need to make a generic user interface to configure multiple MSI files not known until run-time – then install them together in one go.
As technically you can provide any public property on the command line, no. You could also update private properties using a MSI transform. You can enumerate existing properties (public or private), but there is no way of knowing what the installer itself does with them.
If you want to know how, download the Windows SDK. Included are a very large number of VBS scripts which show how to use the Windows Installer API. From there you can just use normal SQL, e.g. Select * from Properties
Windows Installer packages are database that can be easily reflected. WiX DTF has a Microsoft.Deployment.WindowsInstaller namespace with classes that can accomplish that. From there you just write your .NET code to handle all your requirements and just be very reflective/plug-in oriented in the way you do this.
There are some bootstrapper projects out there (CodePlex) that do this but use pre-generated XML files to describe the MSI's.
精彩评论