当 Burn 检测到它的某个软件包已安装时,如何找到检测到的软件包的安装路径?
IBootstrapperApplication 上的所有事件似乎都没有暴露它,谷歌也没有发现任何东西。谢谢!
Too long for a comment—I'll edit this with answer content later...
Burn doesn't know (nor does it need to know) anything about a package installation other than what's in the *Package
element.
What do you mean by the "install path of the package"? Windows Installer can report the InstallLocation
of an MsiPackage
if it is set—see here.
For an ExePackage
, detection is just a bundle-defined yes/no check.
For an MsiPackage
, Windows Installer gives the yes/no answer but does have an API for other information that Burn doesn't need. Does your question relate to an MsiPackage
?
What problem are you trying to solve?
UPDATE:
A Windows Installer package doesn't actually have a installed location; Components have installed locations. It is a very common practice to organize the locations for all or most components into a common directory tree and to allow the root directory to be selected. Components can be grouped into different features and some installers allow selecting a different root directory for each feature, but the mechanism is the same. These root directories don't mean anything to Windows Installer once the directory for each component is computed.
If the directories are desired for maintenance, they must be saved—commonly to a vendor/application-specific location in the registry. A WiX Product can write this information and read it using a RegistrySearch. A Wix Bundle can read it using a util:RegistrySearch. If that doesn't get the specific information desired, a WiX Product can use a custom action and a WiX Bundle can use a custom BootstrapperApplication. Both can use the Windows Installer API via C, COM or .NET (using WiX's DTF library).
So, hopefully, you are currently authoring version "1" of the package and can make it record the location(s) you need using the built-in registry facilities.