enthu.rao
Posts: 13
Joined: Tue Jul 15, 2014 9:20 am

How to uninstall SQL database at application Uninstall

I am licenced user of Advance Installer .
I have tried to search this issue in FAQs but I was not able to find.
I want to drop my sql database at application uninstall.
I have created separate silent exe for dropping database,but I dont know how to run it at application uninstall.
Please anyone can guide me to how to do it.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to uninstall SQL database at application Uninstall

Hi and welcome to Advanced Installer forums.

It is not necessary to create a separate EXE package in order to drop your database at uninstall. To achieve this, you can simply create an "Inline SQL script" in the "SQL Databases" page which drops your database and set it to be executed only "at uninstall".

Let us know if this helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
enthu.rao
Posts: 13
Joined: Tue Jul 15, 2014 9:20 am

Re: How to uninstall SQL database at application Uninstall

Where Is SQL Databases Page ? Sorry but I cant locate it

I written "DROP DATABASE [DBEIAQUANT]" at Uninstall using this command line where I install SQL Server and tried install ,uninstall setup but it does not
delete the database

I tried by creating custom action and writing VB script for deleting database.But it does not work.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to uninstall SQL database at application Uninstall

Hi,

The "SQL Databases" page can be found in your main project, under the "Server" section from the left pane. The "SQL Databases" feature is available only in an " Enterprise" or higher project type and you may not see it if you use a project type that does not include this feature. To check this, you can go to "Home -> Options -> Project Type" tab.
I written "DROP DATABASE [DBEIAQUANT]" at Uninstall using this command line where I install SQL Server and tried install ,uninstall setup but it does not
delete the database

I tried by creating custom action and writing VB script for deleting database.But it does not work.
I'm not sure if the database can be deleted using a command line or a VBScript custom action, but I would not recommend you this approach.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
enthu.rao
Posts: 13
Joined: Tue Jul 15, 2014 9:20 am

Re: How to uninstall SQL database at application Uninstall

Ohh my project type is professional thats via option is unavailable
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to uninstall SQL database at application Uninstall

Hi,

In this case you can upgrade your project to "Enterprise" from the "Home -> Options -> Project Type" tab.

If you do not have an "Enterprise" license for the Advanced Installer product, I'm afraid that you should create your own custom action to remove your database.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
enthu.rao
Posts: 13
Joined: Tue Jul 15, 2014 9:20 am

Re: How to uninstall SQL database at application Uninstall

I have professional license so I have to create Custom Action,but I dont know how to execute custom action,I found it does not get executed.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to uninstall SQL database at application Uninstall

Hi,

Depending on the type of your custom action (EXE, DLL, VBS), you can add it in the "Custom Actions" page, using one of the "Launch attached file", "Launch installed file", "Launch file", "Call function from attached native DLL" predefined custom actions type.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
enthu.rao
Posts: 13
Joined: Tue Jul 15, 2014 9:20 am

Re: How to uninstall SQL database at application Uninstall

Will you please tell me how can I call EXE after uninstall using custom action ?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to uninstall SQL database at application Uninstall

Hi,

In order to achieve this, you can add a "Launch attached file" custom action after the "Install Execution Stage -> Add Resources" action group and check the "deferred" with "no impersonation" option for it. From the "Execution Stage Condition" select only the "Uninstall" option.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”