Search code examples
.netwindows-installercustom-action

Copy possible files to location with msi/custom action


I'd like to be able to replace a file that is packaged in our msi with an external one that the user provides (It overrides some settings that are specific to the company installing the software) as well as copy over a folder of files (May or may not exist, the contents change frequently) into the destination folder.

My current approach was to have the folder and file together with the msi in a folder or on a CD and use a custom action to look for the folder and file in the same folder as the msi. This works OK as long as the installer is run from the local computer. When the installer is run from a networked location the custom action cannot get to the folder that the msi is in due to restricted permissions.

Is there a way to get around the permissions issue, or is there a better way of getting those files to their proper place?


Solution

  • My solution to this was to store the location of the msi in a file in the install directory during the custom action and then have the actual program use that location to find the external files and copy them across (as the program has access to them). It's not elegant but it seems to work for customers that have tried it.