TomGarrett
Posts: 25
Joined: Fri Nov 16, 2007 12:44 pm

Deleting files from multiple User Accounts, How?

Hi guys, after many weeks of error free use we've hit a snag in the processing that I implemented.
We have a set of platforms that we install to, each with multiple accounts. For some reason, the predecessor to our Installer seemed to add files with different names to different accounts. I intended to delete each of these files during install so that our machine was upgraded and "cleaned".

Well, I was using the path prefix of [AppDataFolder] in order to find the folder "Microsoft\Internet Explorer\Quick Launch\". Once found the Installer deletes the relevant Quick Launch applications. Now, the problem here is that AppDataFolder transforms into "..\Documents And Settings\All Users\Application Data" but what we need is some way to point to each individual user.

I'm quite sure the user accounts will remain persistent, so we could just write 3 deletes for each file (i.e. delete "..\Documents And Settings\User1\Application Data\Microsoft\Internet Explorer\Quick Launch\file" and so on for each user). It's a bit sloppy though, and with the fact that we have 10 different files (filenames) to kill off, we'll be hitting 30 actions to do this.

What other approaches would you recommend? A batch file that takes the command and simply replicates it for each user?

Looking forward to your reply!

Tom
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Deleting files from multiple User Accounts, How?

Hi,

Since an installation process uses the configuration of the current user, the recommended way to remove these files is through a custom action. Basically, this custom action will find out the names of all the users on the machine and remove the files for each of them.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”