Does anyone know how I can Dynamically create an installation package that installs files into a folder that is determined at installation-runtime, not by the user, but by obtaining the UserAppDataPat开发者_StackOverflow中文版h for that specific user on that specific PC.
By dynamically I mean that I must create the installation package programatically as part of another process.
Any help ideas greatly appreciated!
To build the installer package, you can use the WiX toolset
. Your app could build the .wxs source file for it in the user's temp folder and invoke candle.exe (the WiX compiler) and light.exe (the WiX linker) to produce the proper .msi.
To get the location of the user's appdata path, use the Environment.GetFolderPath
method with the ApplicationData
parameter.
It does sound strange to me that you want to build the installer package on the user's machine. Unless you are building a tool that the user can use to generate installer packages from content they generated, there's no reason for you to do that. MSI (and the WiX toolset) allows you to build an installer package on your machine that would target the installing user's app data folder on their machine.
精彩评论