unistall - 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!

kumarkiranc
Posts: 85
Joined: Tue Sep 18, 2007 6:49 am

unistall

Hi,

While unistalling the application i want to ask the user he want to remove the database or not. If he say yes i want to take the backup and unistall the database and MSDE.

My problem is how to ask the user he want to keep the database or not.

The user will unistall the application from add and remove programs.

Thanks
Kiran
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

You can use a custom action under "Uninstall" which shows a message box for this. Here is an example:

Code: Select all

dim ans, question
question="Do you want to remove the database?"
ans=MsgBox(question,vbYesNo+vbQuestion, "Question")
if ans=vbYes then 
	'here you can place the code that will uninstall the database'
	MsgBox "Database will be deleted"
else
	MsgBox "Database will not be deleted"
end if
You can modify this custom action in order to execute the uninstall of the database when the "Yes" button is pressed.

Note that if you have a custom action which backs up and uninstalls the database you can set in the above custom action a property which will be used to condition it. In this case the above custom action will be set to "Immediate".

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kumarkiranc
Posts: 85
Joined: Tue Sep 18, 2007 6:49 am

Hi,

Thanks for ur early reply.

I have a custom action which backs up , uninstall the database and unistall the MSDE .How can I set in the above custom action a property which will be used to condition.

Thanks
Kiran
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

A public property can be set in a VBScript custom action by using the Session.Property method. For example:

Code: Select all

Session.Property("TEST")="Value"
You can read more about this here:
http://msdn2.microsoft.com/en-us/library/aa371681.aspx

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kumarkiranc
Posts: 85
Joined: Tue Sep 18, 2007 6:49 am

Hi,


dim ans, question
question="Do you want to remove the database?"
ans=MsgBox(question,vbYesNo+vbQuestion, "Question")
if ans=vbYes then
MsgBox "Database will be deleted"
Session.Property("TEST") = 1
else
MsgBox "Database will not be deleted"
end if

Iam setting the property to custom action in Expression Condition.

iam getting error. Where i have to set the pubilc property in adavance installer.


Thanks
Kiran
kumarkiranc
Posts: 85
Joined: Tue Sep 18, 2007 6:49 am

Hi,


dim ans, question
question="Do you want to remove the database?"
ans=MsgBox(question,vbYesNo+vbQuestion, "Question")
if ans=vbYes then
MsgBox "Database will be deleted"
Session.Property("TEST") = 1
else
MsgBox "Database will not be deleted"
end if

Iam setting the property to custom action in Expression Condition.

iam getting error. Where i have to set the pubilc property in adavance installer.


Thanks
Kiran
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

Please note that you need to use quotation marks (") for the value of the property, therefore it will look like this:

Code: Select all

Session.Property("TEST") = "1" 
Also, make sure that the custom actions are set to "Immendiate" in order to use the TEST property with them.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”