0

我创建了一个程序(C# dotnet),它使用 ISWiAuto18.ISWiProject 更新我的 MSI(Installshield 2009)项目的不同属性(如路径变量)

 for (int count = 1; count <= m_ISWiProj.ISWiPathVariables.Count; count++)
                {
                    if (m_ISWiProj.ISWiPathVariables[count].Name == pathVar)
                    {
                        m_ISWiProj.ISWiPathVariables[count].Value = pathvarvalue;
                        m_ISWiProj.IswiAutoUpgradeEntries
                    }
        }

但是现在我无法找到使用 ISWiAuto18.ISWiProject 更新 Installshield 项目的我的注册表项值的方法?有没有办法更新注册表值?

4

1 回答 1

0

The ISWiProject object has a ISWiComponents collection that allows you to get a reference to a ISWiComponent object. Once you do that you can use the ImportRegFile method to load additional registry data into the component. That's about the extent of the abilities of the automation interface.

If I understood what you were doing better I could give more advice. You might want to consider using a [PROPERTY] in your registry table of the ISM and then pass property values into the build. This would be a simple way of getting the variation points you might need.

Another approach is to use the ISWiProject object's UseXMLProjectFormat method to convert the ISM from XML to/from Binary and then either use an XML DOM to manipulate the ISM (DTD is rough but doable) or Windows Installer SQL queries if binary format. (WiX's DTF library Microsoft.Deployment.WindowsInstaller is sweet for this )

于 2012-09-20T12:31:29.520 回答