Wix installer, make directory or files optional - wix

I am using Wix for our installer,
I am using and to copy or include files in the directory, however, I want a certain files or directory to be optional and only copy if the directory and files exists during compilation of the installer.

Related

Wix custom action to unzip a file

I've a zipped file which contains around 1000+ files.
I was able to bundle the zip file into msi.
But I would like to know how to unzip that file using any custom action
We had this requirement to unzip a file and place or the sub directories and files inside it at a particular location after installation.
Solution:
1. Create a exe (console app) that will unzip the file and place required files at required location.
2. Ship this exe with installer
3. Make this exe run (with execute sequence) while the application is installs.
This may add overhead, but this works.

How to copy directories/files in installed folder using wix

I have deployment files which are dynamic in nature. Sometimes I have 4 files and sometimes 5 files. I need to just copy those files in installed folder.
How to include those files in msi?
How to copy it in installed folder?
You include files in your msi by harvesting them with wix tool harvest tool set
Once you have proper msi file , you install it and that will copy your harvested files to the desired dir.

WiX Managed Bootstrapper “Failed to resolve source for file” for .cab files

I have an .msi package with 5 external .cab files in my bootstrapper application(not being compressed in my bootstrapper application, external) which installs well locally, and has DownloadUrl attribute for web-based installation.
But, when I execute my bootstrapper application without its .msi file and .cab files(not accompanied by them in the same folder, i.e., executed solely in a separate folder), it cannot download the .cab files although it can download the .msi file(log files says that).
So, I added <Payload> elements for each .cab file under <MsiPackage> element with DownloadUrl attributes set to their individual URL and Compressed attibutes set to no. And then, when I execute my boostrapper application solely, it downloads all its files well and installs well.
Should I manage all the <Payload> elements for .cab files in <MsiPakcage> manually? No automatic download for .cab files?
I had written only .msi file path in DownloadUrl attribute of MsiPackage element. But in the source code of Wix Setup BA there was a substitution '{2}' meaning the file name of payload. I followed that and it solved the problem.
For more info see this link.

WXS - How to modify installation directory to append extra folder to install directory in Wxs file

How to modify installation directory to append extra folder to install directory in Wxs file.
I am new to wxs file creation. Suppose my installation directory is **C:\Sample\Test** then I want to append one more directory path (example: **C:\Sample\Testz\data\install** ) to this location when we click on Next button on selecting installation directory. Any suggestion please.
You can use another property to fix it.
e.g.
<Property Id="AnotherDir" value="[FirstDir]\data\install" />

copy files from drop location to different file location

I have build definition for a project which outputs some MSI files and zip files with assembly version folder name to Drop folder. eg: 1.0.0.0 folder contains MSI and zip files.
Now my requirement at final step is to copy only MSI files from above drop folder and copy to different file location as part of build process.
How can i achieve this using build process template or post build script?
Thanks