This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: How can I delete folders and shortcuts from a users profile?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 10, 2008
12:44 AM
How can I delete folders and shortcuts from a users profile?
Hi I am trying to delete files and folders from a users desktop and start menu through installscript and custom action
I cannot get it to work.
I'm using:
function ExFn_RemoveFile(hMSI)
begin
//DeleteFile("C:\\Documents & Settings\\*\\Desktop\\orderprints*") ;
//DeleteDir( "C:\\Documents & Settings\\*\Start Menu\Programs\\Picture Organiser',ALLCONTENTS) ;
end;
Do I need to call a value for USERPROFILE instead of using this?
How can I get this to work? Thanks.
I cannot get it to work.
I'm using:
function ExFn_RemoveFile(hMSI)
begin
//DeleteFile("C:\\Documents & Settings\\*\\Desktop\\orderprints*") ;
//DeleteDir( "C:\\Documents & Settings\\*\Start Menu\Programs\\Picture Organiser',ALLCONTENTS) ;
end;
Do I need to call a value for USERPROFILE instead of using this?
How can I get this to work? Thanks.
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 10, 2008
12:53 AM
Note: I have removed the // when trying to test it
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 10, 2008
10:07 AM
I'm not sure that DeleteFile supports wild card characters in the path provided. Have you determined what the return values from DeleteFile & DeleteDir are?
More specifically, based on the function prototype, this is a custom action. Is there a specific reason you're opting to not use the RemoveFile table? And possibly more specifically you can't guarantee that you've actually deleted the shortcuts. Typically, it's best to leave per-user data behind. You may want to install the shortcuts for all users if, in fact, your installation installs for all users. This way, Windows Installer will clean up your shortcuts for you and you won't have this problem.
These types of patterns usually fail on corporate systems and especially have issues with AD systems that use roaming profiles.
More specifically, based on the function prototype, this is a custom action. Is there a specific reason you're opting to not use the RemoveFile table? And possibly more specifically you can't guarantee that you've actually deleted the shortcuts. Typically, it's best to leave per-user data behind. You may want to install the shortcuts for all users if, in fact, your installation installs for all users. This way, Windows Installer will clean up your shortcuts for you and you won't have this problem.
These types of patterns usually fail on corporate systems and especially have issues with AD systems that use roaming profiles.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 10, 2008
07:35 PM
The problem is I'm cleaning up old installs I didn't create so have to try and clean up these shortcuts.
Thanks for advice on removefile table, i'll look into it.
How do I force it to install for all users??
Thanks for advice on removefile table, i'll look into it.
How do I force it to install for all users??
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 11, 2008
08:14 AM
You can do so by setting the ALLUSERS property:
http://msdn2.microsoft.com/en-us/library/aa367559(VS.85).aspx
By default it's done for you.
http://msdn2.microsoft.com/en-us/library/aa367559(VS.85).aspx
By default it's done for you.