During installation, my application will:
Step A, Look for C:\WebService directory. If found do following:
copy *.bat --> C:\WebService\
copy boost*.dll --> C:\WebService\libs\
copy myApp.dll --> C:\WebService\plugins\
Step B, If not found, do following:
copy *.bat --> [LocalAppData]\myApp\bin\
copy *.dll --> [LocalAppData]\myApp\libs\
How can I do this?
EDIT:
I had finished Step 2 by:
-
Create a source directory:
src\bin
src\libs -
Copy files to these subdirs
-
Use
heatto scan the src directory and generate group into wxs file.
The problem here is, looks like for Step A, I have to do the same again. But there are tons of *.dll, copying them again to another directory doesn’t look like a good idea.
Ok, finally worked it out.
In short, I do this by writing a C++ program to help.
Details follows..
My wxs starts like:
Now use
heatto harvest my source directory to generate another wxs file forcandleandlightto linkThen goes my C++ program, it was designed to
This new component group can be referenced to be installed conditionally, depends on whether there is a registry key, or whether the directory is found, in my case it is:
With these wxs files, the package can be installed into different places under different scenarios.