I have a custom action setup in my MST which runs an exe after the Install finalize & copies few XML files in the Users AppDataFolder. I want my package to uninstall the XML files along with the package but its leaving those XML files behind.

In-Script Execution = Immediate Execution
Execution Scheduling = Always execute

Install Exec Sequence = After InstallFinalize
Intall Exec Condition = NOT Installed (Do i need to "" NOT Installed?)
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
I have a custom action setup in my MST which runs an exe after the Install finalize & copies few XML files in the Users AppDataFolder. I want my package to uninstall the XML files along with the package but its leaving those XML files behind.

I'm a bit confused, do you want to cleanup those XML files during installation or during uninstall of your package? Also, the CA you mention, does it take care of the installation or removal of said files?
Remember, any files you copy in a CA in an MSI, you'll have to make a matching CA for cleanup.
Answered 05/04/2010 by: pjgeutjens
Red Belt

Please log in to comment
0
I want to clean them up during Uninstall. Yea the Install takes care of the file but its only the uninstall which is leaving the files behind
Answered 05/04/2010 by: stabish
Orange Belt

Please log in to comment
0
Don't bother with a CA. Use the RemoveFile table.You can remove folders with that table. Check out MSDN for details.
Answered 05/04/2010 by: VBScab
Red Belt

Please log in to comment
0
ok,

now, like I added in my previous post, you'll have to add a matching CA to cleanup your file copies.
Another point is, if you want to copy files to the user profile for each user that logs in and uses your application, you'll want to look into Active Setup or Advertisement.

You would then have to write a script (let's say VBS) for a CA that, at uninstall time, runs through all the User Profiles on the machine and deletes any XML files that were copied. This CA would then be scheduled with a REMOVE ~="ALL" condition, so it only runs during uninstallation of your package.

Hope this helps. [:)]

PJ

EDIT

Don't bother with a CA. Use the RemoveFile table.You can remove folders with that table. Check out MSDN for details.

What Ian says is correct if we're talking cleanup for ONE user. IMHO for multi-user cleanup, things get more complicated...
Answered 05/04/2010 by: pjgeutjens
Red Belt

Please log in to comment
0
Thank you very much pjgeutjens for the feedback. I am actually using an ActiveSetup to copy the files for all users & yes i can create another custom action & call it with REMOVE=ALL condititon but i would like to play with RemoveFile Table & see if i can accomplish this instead of using a CA. Trying to find out what are some values for the

Removefile
Filekey=?
Component=COMPONENT1
FileName=abcXML
DirProperty=?
InstallMode=?
Answered 05/04/2010 by: stabish
Orange Belt

Please log in to comment
0
I created a BATCH file to run the del command @ uninstall. Just wondering instead of VB can a write a batch file to serach the all user profile & then delete the xml files?

%USERNAME% & %USERPROFILE% variables only delete the files for the user who is logged on.
Answered 05/04/2010 by: stabish
Orange Belt

Please log in to comment
0
Gotcha
cmd /c "c: & cd c:\docume~1 & del abc.xml /s"
Answered 05/04/2010 by: stabish
Orange Belt

Please log in to comment
0

Gotcha
cmd /c "c: & cd c:\docume~1 & del abc.xml /s"


And if "Documents and settings" not located in disc C:\
AND
Importantly you are delete all abc.xml files from all subdirectories, if any programme uses some file name.
Answered 05/05/2010 by: SpiritUA
Yellow Belt

Please log in to comment
0
How can i rescript this to delete the files from User's Appdata & LocalAppData?
Answered 05/05/2010 by: stabish
Orange Belt

Please log in to comment
0
I would abandon DOS batch script and find a VBS which uses a function to delete files in a folder whose name is passed to the function. That way, you can build in proper error-trapping (e.g. a test that the files were actually deleted) and avoid duplicate code. Start at http://www.computerperformance.co.uk which has loads of script samples.
Answered 05/05/2010 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity