Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6471309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:12:33+00:00 2026-05-25T06:12:33+00:00

When uninstalling a previous installation (that I’d built using InstallShield 2009), I wanted to

  • 0

When uninstalling a previous installation (that I’d built using InstallShield 2009), I wanted to delete the entire folder that the program was in at the end of the uninstall. I couldn’t figure out how to do that using a Custom Aaction, so using the code below, I settled for deleting the file as soon as the installation starts. This works fine if the program was already installed… but if it wasn’t installed before, it throws an error 1701 because, obviously, the folder didn’t exist! I have no idea how to fix this issue and I know almost no VBScript. I started to do a try-catch to just gloss over the error, but apparently that doesn’t exist in VBScript.

Dim fso, Folder2Delete
Folder2Delete =  "C:\Program Files\MyProgramDir"
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFolder(Folder2Delete)

So either, How can I stick a Custom Action into an uninstall in InstallShield, or how can I set the VB script to only delete a file if it exists? Or last ditch, how can I get it to not show an error when it doesn’t exist… ?

Thanks a lot, this is driving me crazy!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:12:34+00:00Added an answer on May 25, 2026 at 6:12 am

    You can try this code:

    Dim fso, Folder2Delete
    Folder2Delete = Session.Property("CustomActionData")
    Set fso = CreateObject("Scripting.FileSystemObject")
    If fso.FolderExists(Folder2Delete) Then
      fso.DeleteFolder(Folder2Delete)
    End If
    

    For this custom action you can then set the action data (CustomActionData property) to:

    [INSTALLDIR]
    

    This way your action will delete whatever installation path your users set.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how can i delete storage directory instances or folder while uninstalling any air application.
Could any one clarify me that, when uninstalling I need to delete everything form
On install I copy some files in 'System32' folder. When uninstalling these files are
I have written a utility that requires an installation key for uninstallation to ensure
Problem I have an MSI that creates and starts a Windows service during installation
I am having troubles uninstalling a shared win32 SxS assembly using Wix3 on WinXP.
I'm uninstalling a service like this: using (AssemblyInstaller installer = new AssemblyInstaller(serviceFileName, new String[]
I am have an installer running for a shareware program that has a time
When uninstalling my application, I'd like to configure the Wix setup to remove all
I have updated to latest Django version 1.0.2 after uninstalling my old Django version.But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.