Unistalling Shortcuts and folders - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

cmonteir
Posts: 5
Joined: Mon Nov 13, 2006 7:15 pm

Unistalling Shortcuts and folders

I am banging my head against the wall...Sorry to sounds completely ignorant on this.

I am trying to uninstall two folders from:
“C:\Program Files” and “C:\Documents and Settings\All Users\Start Menu\Programs”
and a Shortcuts from “C:\Documents and Settings\All Users\Desktop”

I am trying to include this part of my MSI package?
Anyone out there with good instructions on how to do this?

I have tried to follow some of existing information...and my head is actually spinning!


HELP PLEASE!


Thanks!
:?:
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,
I am trying to uninstall two folders from:
“C:\Program Files” and “C:\Documents and Settings\All Users\Start Menu\Programs”
and a Shortcuts from “C:\Documents and Settings\All Users\Desktop”
Could you please give me more details about this? How exactly those folders and shortcuts are created? by your package, with a custom action?

Also please try to reproduce this behavior on other computers.

Waiting for more details.

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
cmonteir
Posts: 5
Joined: Mon Nov 13, 2006 7:15 pm

These folders and shortcuts were created before and no information were entered in the registry. Now I only want to delete the folders and shortcuts.


Ok this is where I am now...

I have created few searches to find shortcuts and folders.
I now want to have the custom action delete these shortcuts and folders if found.

I have tested the search and it works...how can I delete these folders and shortcuts using the custom action?
And how can it be create with my MSI package?


Thank you!
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,
I have tested the search and it works...how can I delete these folders and shortcuts using the custom action?
You can create a VBS custom action that deletes those folders and shortcuts. Switch to "Custom Actions" page and add a "New Attached Custom Action" under "InstallExecuteSequence->AppSearch" (make "AppSearch" visible from "Show Standard Action" toolbar menu). Use (Not Installed) as execution condition for the custom action.

Here is some VBS code that can helps you (copy this code to a .vbs file and use it for the custom action above):

Code: Select all

' delete a file indicated by the MY_FILE property, resulted from a search
Set fso = CreateObject("Scripting.FileSystemObject")
Set aFile = fso.GetFile(Session.Property("MY_FILE"))
aFile.Delete

'delete a folder indicated by the MY_FOLDER property, resulted from a search
fso.DeleteFolder Session.Property("MY_FOLDER"), true
Hope this helps.

Regards,
Gigi
_______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
cmonteir
Posts: 5
Joined: Mon Nov 13, 2006 7:15 pm

I have a text file that wil be run under the custom action.
Would this work?


cmd /c del [SHORTCUTDIR]\["shortcuts".lnk]
cmd /c del [SHORTCUTDIR]\["shortcut".lnk]
cmd /c del [DesktopFolder]\["shortcut 8.1".lnk]
cmd /c del [DesktopFolder]\["shortcut".lnk]


cmd /c rd /s [APPDIR][program]
cmd /c rd /s [APPDIR][program]
cmd /c rd /s [ProgramMenuFolder]["program"]
cmd /c rd /s [ProgramMenuFolder]["program"]


cmd /c rd /s [ProgramFilesFolder]["program"]
cmd /c rd /s [ProgramFilesFolder]["program"]


please le t me know
cmonteir
Posts: 5
Joined: Mon Nov 13, 2006 7:15 pm

What is it so hard to simply delete folder using this tool...
IT really has been a pain to try to do this.

Why?
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,
These folders and shortcuts were created before and no information were entered in the registry
These folders and shortcuts were created before by how? Please give me more details, maybe there is a simple way to solve the problem.

You have an older package that was create with other tool than AI? If this is the situation then you need to uninstall the older package before you install the one created with AI. Is not a good practice to just remove it's shortcuts and folders. Because informations about this package are still remain in the "Add/Remove" list.

On how to remove an older package that is not created with AI please see:
http://www.advancedinstaller.com/forums ... php?t=1485

Please let me know if this not helps.

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
cmonteir
Posts: 5
Joined: Mon Nov 13, 2006 7:15 pm

creating a condition

Thank you,

for your support.

I have a quick question
how can this installation only happen if a previous version
exists or if a particular folder exists?

how can i create this condition?

thank you!

Return to “Common Problems”