views:

86

answers:

1

Hello --

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 UserAppDataPath 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!

A: 

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.

Franci Penov
thanks, I will look at WiX - to clarify : files are output from an Expression Web 3 Add-in that in turn need to be distributed by the Add-In user to other users. We don't want those end-users to have to worry about unpacking a zip file and then finding the right .exe, WSH script or other app to run. We wanted a pre-packed .exe that would simply extract the files and put them where they are supposed to go. The installer would not be built on the end-users machine but on the Add-In user's. Maybe thats clearer, maybe not.
Serexx
That actually makes the whole scenario more clear. I would suggest you update the question with this description. Also, it is still unclear whether the package that was prepared by the add-in user needs to be uninstallable and whether it should be visible to the end-final user in the Add/Remove Programs dialog. (In other words - what's your clean up scenario)
Franci Penov
The reason I am asking i because the WiX might be an overkill for your scenario, depending on the cleanup/uninstall scenario.
Franci Penov