Wix: Deploying a file in multiple directories being detected at runtime
This is related to Wix:
I have a situation in which I have to deploy a file into multiple directories whose values being fetched from registry. Now these directories could be from 1 to many.
And I don't want to create too many Directory entries whose values would be determined at runtime.
Can we call a custom action in a loop which would be detecting the target Directories and setting-up our target folder values?
I know we can do such copying inside a Custom Action. But I'm looking for a way to do this via WIX entries.
I was reading about DuplicateFiles Action but not getting some proper methodolo开发者_JAVA百科gy to achieve my goal.
Thanks a lot
The WiX element CopyFile maps to the DuplicateFiles action. You can use AppSearch to set properties and then use CopyFile to duplicate a file to a directory. DuplicateFiles is smart enough to not do anything if the property is null.
If the number of copies is known when you create your installer you can just do that. If you think it's going to somehow be more dynamic at runtime, you can write a custom action that emits temporary rows to the DuplicateFile table that way DuplicateFiles and RemoveDuplicateFiles still does the heavy lifting.
You can use the principals described at Dynamic Windows Installer UI.
精彩评论