/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


How to remove folder before file copying in basic MSI project

05/18/2015 3192 views
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   [ + ] Show comments

Comments


All Answers

1

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

1
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

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ