Directory Purge

Hello. How can I specify the path of the directory that I want to purge? I want to install the package at the root (E:\TEST) and only purge the app folder (E:\TEST\Test1). I created a variable called AppDir (please see the attached screen shot) and added an expression in the purge field. If I set the “Install To” parameter to E:\TEST\Test1 it will purge the app folder BUT it then installs the package to a nested directory E:\TEST\Test1\Test1

I have looked over your documentation but I don’t see anything that helps. can this be done? If so, please explain

Thanks in advance,

screenshots.doc (55 KB)

Hi Daniel,

The ‘purge’ option on the custom installation directory feature is just a Boolean true/false at this point; to purge your app dir you’ll need to use PowerShell.

To do this select Configure features, choose Custom PowerShell scripts, and enter the following into PreDeploy.ps1:

rm -Path "$AppDir\*" -Recurse -Force

Note, it would pay to a) ensure $AppDir is never blank or something unexpected like ‘.’ and b) test this first with your project settings on a non-critical machine just to make sure the path’s correct.

Best regards,