Reputation: 12235
I need to copy some files to the Application folder when installing with an msi. I was looking at using a launch condition to establish if the folder exists but I need to continue and install in an alternative folder if FALSE.
can I programatically set the Application Folder at installation
Upvotes: 0
Views: 424
Reputation: 11878
You can use file search or a custom action which checks whether one of the folders exists. Then you use mutually exclusive conditions on two custom actions, which will set the value of a property, PLUGINDIR
. Then you use this property as the target directory for plugin files.
You have to do it before MSI goes to InstallInitialize
action.
Upvotes: 1
Reputation: 917
First of all you should always let the user descide what the application folder should be.
Second: depending on the tool you use for creating the msi it must be possible to read the selected installation folder and copy file to it. e.g. When you use a Visual Studio Setup Project you can use [TARGETDIR] as a property in the File System view. With that you can ouput files in your solution to that folder.
Upvotes: 0