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!

samn93
Posts: 3
Joined: Wed Apr 30, 2014 2:08 pm

Remove files on un-install

My application is configured to install to the system drive, so in most cases (C:). - My actual application creates folders in the installation directory, however when removing using AI it deletes the application files/folders but won't remove the root folder that is configured as [MANUFACTURE]

My current install path
[WindowsVolume][Manufacturer]\[ProductName]

How, on uninstall can I get it to remove everything, including the [Manufacturer] folder?

I tried including a vbs script that deletes the directory, but AI deletes it and then tries to run it during the uninstall so it errors

Thanks
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Remove files on un-install

Hello and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

This may happen if the "[WindowsVolume][Manufacturer]" folder location already exists on target machine before installation. Please note that, on uninstall, Windows Installer removes only the resources (file, folders, registries, etc) created by the installation process.

In order to achieve what you want you can add your VBS custom action as a custom action with sequence scheduled (only on uninstall) after "Installed Execute Sequence -> Add Resources" actions group. Also, you should configure the custom action to run as deferred.

As another option you can use our "Uninstall Cleanup" support. Here are the steps to proceed:
- go to "Install Parameters" page and add a new property like this:
  • Name: MY_PROP
    Value: Your Value
- go to "Custom Actions" page and add a "Set Installer Property" custom action with sequence after "Wizard Dialogs Stage -> Searches" actions group like this:
  • Property: MY_PROP
    Value: [WindowsVolume][Manufacturer]
- select the above custom action and, while keeping [SHIFT] key pressed, drag it under "Install Execution Stage -> Searches" actions group (the custom action will be shared between the two installation stages)
- go to "Files and Folders" page and create a property-based folder using MY_PROP property
- select the MY_PROP property-based folder and from its context menu choose "Uninstall Cleanup..." option and go through the wizard
- build and run your project

If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
samn93
Posts: 3
Joined: Wed Apr 30, 2014 2:08 pm

Re: Remove files on un-install

Thanks for your reply,

I'm trying to use the second method but now when launching the installer it says it can't find the path and the installation exits... - Perhaps I got confused on your instructions.
  • I've created a property under install parameters called RM_DIR with the value [WindowsVolume][Manufacturer]
  • I've created a custom action that appears in my Existing Custom Actions tab called RM_DIR, the property is RM_DIR and the value is [WindowsVolume][Manufacturer]
  • In the Install Execution Stage this sits underneath Searches. (However I only need the folder to be removed on uninstall?)
  • The properties of my action are Execution Time = Immediately (I have no other options). - The Execution Stage Condition is only ticket on uninstall.
  • I've added a new Property based folder and selected RM_DIR ([[WindowsVolume][Manufacturer]) from the drop down list.
  • I've then right clicked this folder and selected uninstall cleanup, left all the options default and finished.
What am I missing?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Remove files on un-install

Hello,

First of all I apologize for my delayed reply. We had a couple of days off last week due to a national holiday.

Please keep in mind that during "Paths Resolution -> CostFinalize" standard action Windows Installer resolves all folder's paths from your project. Also, the "CostFinalize" action it is always executed no matter you are running on install or uninstall mode. Therefore, you should configure your "Set installer property" custom action to be always executed (i.e. "Install", "Uninstall" and "Maintenance") so your property-based folder (RM_DIR ) always be resolved to a valid path, otherwise the "CostFinalize" action will fail.

Also, please make sure your "Set installer property" custom action is scheduled exactly under "Searches" actions group from "Wizard Dialogs Stage" and "Install Execution Stage".

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
samn93
Posts: 3
Joined: Wed Apr 30, 2014 2:08 pm

Re: Remove files on un-install

Hmm, that still doesn't work. - It's the last stage the causes problems. If I add a new property based folder and then add the cleanup option, firstly I get a folder with a red cross in my "Files and Folders" but then on the install I get the error "Could not find network location C:\FolderName" Where C:\Foldername = [WindowsVolume]\[Manufacturer]
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Remove files on un-install

Hello,

Can you please send us the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”