I Want to remove the folder before starting "file copying" steps. I tried with install script it's not deleting the folder due to UAC Settings.So i dont know how to solve the issue.

Can you help me in this regards.. 
0 Comments   [ - ] Hide Comments


Please log in to comment

Answer this question or Comment on this question for clarity



Use the RemoveFile table.

The situation is more complicated if the files are in the user's profile, of course.

Answered 05/18/2015 by: VBScab
Red Belt

Please log in to comment
We really need to know where the folder is located and also what context the MSI will run in.
Running a script as a "user account" will inevitably launch the UAC, but running the same script as the local system account will not.  Additionally, if any of the files in the folder(s) you are trying to delete are locked "in use", they cannot be deleted.
As VBScab states above, the RemoveFile table is the logical tool to use, and it accepts wildcards, but you need to know the directory structure if there is more than one directory in the tree as they need to be emptied and deleted from the bottom of the tree.
An alternative solution is to look for a vbscript that does a "deltree" operation and run this deferred ahead of the InstallFiles action in the InstallExecute sequence. This code can then be equipped with sufficient error trapping so that you can decide on whether to continue the install if the folder is not empty, or rollback.
Answered 05/18/2015 by: EdT
Red Belt

Please log in to comment
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja