I'm creating a windows insaller for app that wll write some files to home folder (results). Uninstall need to delete thid data, but since app is installed "for all users" uninstaller can delete app data from home folders of all users. Is it any way in Windows to enumerate all home folders?
Asked
Active
Viewed 143 times
1 Answers
1
What kind is your application. For VB6 there is wizard for generating installer: tools / Package and Deployment Wizard). For .Net there is a kind of project for generating Installers: Other project type/Visual Studio Installers/Setup Wizard or SetUp project.
In the other hand for .Net you can use the System.SpecialFolder structure for enumerating the special folders.
By using the Win32 API you can use SHGetSpecialFolderPath:
// String buffer for holding the path.
TCHAR strPath[ MAX_PATH ];
// Get the special folder path.
SHGetSpecialFolderPath(
0, // Hwnd
strPath, // String buffer.
CSIDL_DESKTOPDIRECTORY, // CSLID of folder
FALSE ); // Create if doesn't exists?

ArBR
- 4,032
- 2
- 23
- 29
-
Yes, but CSIDL_DESKTOPDIRECTORY will return folder for CURRENT user. But how to get CSIDL_DESKTOPDIRECTORY for all users? Impersonalize each one? – grigoryvp Dec 21 '10 at 21:30
-
Take a look at this: http://stackoverflow.com/questions/1059460/shgetfolderpath-for-a-specific-user; http://stackoverflow.com/questions/198124/how-can-i-get-the-path-of-a-windows-special-folder-for-a-specific-user – ArBR Dec 21 '10 at 21:57
-
Nullsoft installer create .exe and i need .msi :( – grigoryvp Dec 22 '10 at 08:44