View Full Version : Removing file/folder under \AllUsers folder?
alexzfirm
07-23-2007, 06:03 PM
What is the FolderID for following location (or any location under \All Users).
"C:\Documents and Settings\All Users\Start Menu\Programs\"
My tests show that [ProgramMenuFolder] points to the current user Start Menu... and I would like to remove some files under "All Users"
alexzfirm
07-24-2007, 06:39 PM
any ideas? I really do not want to write custom DLL for simple file removal...
Brett
07-24-2007, 09:19 PM
You still use [ProgramMenuFolder] but also set the property ALLUSERS to "1". See http://msdn2.microsoft.com/en-us/library/aa367559.aspx
alexzfirm
07-25-2007, 06:06 PM
Hmmm... But if I do that - how do I remove files/shortcuts under current user? I need to remove few files under both branches - current user and all users... Is there a sequence where I can set this variable value, remove few links, then set it to a different value, remove few other links, etc? Is there a sample script/sample project of that scenario?
Lorne
07-26-2007, 10:56 AM
Windows Installer has some standard folder properties for common locations, namely CommonAppDataFolder, CommonFilesFolder, and CommonFiles64Folder. However I don't know of any built-in way to differentiate between the all users and current user start menu locations, other than using ALLUSERS. (Which a user can override on the command line when they run the .msi btw.)
You might be able to use a folder search to locate the all users path and use a remove file action to remove it.
How did you install the shortcuts to both locations, btw? Were they created by the app itself? Or was it installed using a different installer technology (not MSI)?
alexzfirm
07-26-2007, 03:24 PM
ALLUSERS. (Which a user can override on the command line when they run the .msi btw.)
What do you mean by "ALLUSERS" ? When I go to the File Operations \ Remove Files \ Folder list - there is no folder with name "ALLUSERS".
How did you install the shortcuts to both locations, btw? Were they created by the app itself? Or was it installed using a different installer technology (not MSI)?
These shortcuts were made by non-MSI technology
Lorne
07-26-2007, 03:47 PM
ALLUSERS isn't a folder. It's a Windows Installer property. Setting it to 0, 1 or 2 is what controls whether the Windows Installer will install everything for the current user, or for all users. (Also referred to as "per-user" and "per-machine.")
There are many different ways to set it. You can add a property named ALLUSERS in project settings and set its value to 0, 1, or 2. You can use a custom action. You can use the UserProfile dialog to let the user set it. You can set it on the command line, e.g. msiexec /i setup.msi ALLUSERS=1.
As Brett already suggested, see:
http://msdn2.microsoft.com/en-us/library/aa367559.aspx
alexzfirm
07-26-2007, 04:35 PM
ALLUSERS isn't a folder. It's a Windows Installer property. Setting it to 0, 1 or 2 is what controls whether the Windows Installer will install everything for the current user, or for all users. (Also referred to as "per-user" and "per-machine.")
As Brett already suggested, see:
http://msdn2.microsoft.com/en-us/library/aa367559.aspx
Ahh.... that ALLUSERS... That does not help me. I need access to the current user profile and all users profiles at the same time... Will have to write custom DLL then... Sad... I was trying to avoid that...
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.