I have a WIX install application and many source files:
...
<Directory Id="dirF21F1AE09DCD1D651EFCA4E6AD334FAC" Name="myservice">
<Component Id="cmp503CB14E95C2C333DCE9E73FC1BB2E9A" Guid="{29FDDCA4-E70D-41AA-B1C8-06AD9A07810D}">
<File Id="fil2FE62A0172300DF74F1725E28B7FA003" KeyPath="yes" Source="$(var.SourcePath)\myservice\common_base.dll" />
</Component>
</Directory>
...
And this files are copied by a ref:
<ComponentGroupRef Id="InstallSources"/>
I need to access common_base.dll in custom action before copying files. I want to copy it to temp folder for some manipulation:
private static void CopyCommonDll(Session session)
{
try
{
var dllPath = session["get path here"]; // or can I get dllPath the other way?
session.InfoLog("Dll path: {0}", dllPath);
var destPath = Path.Combine(Path.GetTempPath(), Path.GetFileName(dllPath));
session.InfoLog("destPath dll path: {0}", dllPath);
File.Copy(dllPath, destPath);
session.InfoLog("file copied!");
// some code here
File.Delete(destPath);
}
catch (Exception e)
{
session.ErrorLog(e);
}
}
How can I do this?