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!

benjy
Posts: 37
Joined: Mon Nov 02, 2009 12:25 pm

Conditionally removing an installed file

Hi,

I have a problem for which I would very much appreciate some help.

The product we are installing writes a default Access database to the installation folder (unless there is already one there, using the "Never Overwrite" option). Whilst I fully appreciate the advice given in one of the Tutorials ("How do I prevent a file or registry entry from being uninstalled or repaired?"), we know from experience that some of our users simply install the product to a network server and then share the folder containing the database. Whilst we strongly recommend they do *not* do this and give warnings in our UI, it is surprising how many people ignore it and carry on regardless :x

So, here's my question... I'd like to present the user with a dialog when the product is being uninstalled, asking them if they would like to leave or delete the existing database. I found this article:

http://www.advancedinstaller.com/forums ... val#p26263

This is kind of pointing me in the right direction, but I am having some difficulty in figuring out how to adopt the approach it shows (if it is the correct one) for my situation. I am thinking that perhaps I need to use a custom "file removal" option, but I am unsure as to how to condition this based on the response selected by the user in the dialog.

I would be most grateful for any help.

Best wishes,

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

Re: Conditionally removing an installed file

Hello Ben,

In order to achieve this you can proceed like this:
- Go to "Dialogs" page, select the "Maintenance -> MaintenanceTypeDlg -> InstallMode = "Remove"" tree node and from its context menu choose "New Dialog" option.
- Here add a static text control like this:
  • Text: Do you want to remove "Your_Filename"?
- Add a a radio button group with two radio buttons.
- Select the radio button group and set the "Property Name" field, from "Properties" right pane, to RADIO.
- Select the first radio button and set the "Value" field, from "Properties" right pane, to 1 and "Text" field to Yes.
- Select the second radio button and set the "Value" field, from "Properties" right pane, to 0 and "Text" field to No.
- Go to "Organization" page and mark the related file component as "Permanent".
- Go to "Files and Folders" view and select the folder of the related file. Here add a file removal operation like this:
  • Name: Your_Filename
    Component: ProductInformation
    Remove On: Component uninstall
    Condition: RADIO = "1"
- Build and run your project.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
benjy
Posts: 37
Joined: Mon Nov 02, 2009 12:25 pm

Re: Conditionally removing an installed file

Hi Daniel,

Thank you for your prompt reply. I have followed your instructions and it seems to be working well; if I have any further queries, I'll post another reply.

Thanks again :D

Ben
aqua
Posts: 37
Joined: Thu Oct 04, 2012 6:51 pm

Re: Conditionally removing an installed file

To add to the query, as a specific requirements from my side: Is it possible in advanced installer that after we have completely installed our package it may delete the installer itself or to display a message box for moving the installer to some other directory in the system.

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

Re: Conditionally removing an installed file

Hello,

In order to achieve this you can create your own custom action which will delete the installer package after the installation.

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

Return to “Building Installers”