cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
cerede2000
Level 2

Dynamic copy file if present in source directory

Hi everybody,

I want dynamic copy file if present in sourcedir (MSI dir at run install).

With custom property SRC for file name (or folder name).

With Powershell embedded script is ok :
$src = Get-Property -Name SRC
$dst = Get-Property -Name DST

$src = Join-Path (get-property -name SOURCEDIR) $src

if((Test-Path "$src")) {
Copy-Item "$src\" "$dst" -Recurse
}

But it's possible without script ?
Nativley with MoveFiles action ?

Thanks 🙂
Labels (1)
0 Kudos
(1) Reply
chad_petersen
Level 9

Have you tried the Dynamic Linking? It allows you to specify a "Source folder" and optionally subfolders. You can specify if you want it to include all files (*.*) or you can include and exclude files based on wild-card patterns.

I do not recommend Dynamic Linking in general for all the files in your project since you lose a lot of control and Microsoft does not support Dynamic Linking, but for an individual file like this that may or may not be present in the source folder might make sense to look into it.

Chad
0 Kudos