Per-feature custom action and Repair option - 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!

bob30
Posts: 3
Joined: Wed Mar 18, 2009 5:43 pm

Per-feature custom action and Repair option

My installation project contains two features. For one of them (let's call it "Feature2") i must perform several checks (for example, ask user to close Firefox and wait him to do this). I implemented these checks through custom actions assigned to dialog buttons and they work ok.

But these checks don't work if user runs installer when software is already installed and selects "Repair". I need to determine whether Feature2 is installed to ask user to close Firefox when he press Repair. VBScript looks like this:

Code: Select all

Sub CheckFeature2()
	Dim ff
	ff = Session.FeatureRequestState("Feature2")
	If ff = 3 Or ff = 4 Then 
		Session.Property("FEATURE2_SELECTED") = "1"
	Else
		Session.Property("FEATURE2_SELECTED") = "0"		
		MsgBox ff, vbOKOnly
	End If
End Sub
So on install, if user enabled Feature2, the property FEATURE2_SELECTED gets value "1" and my conditions work OK. But on repair, even if Feature2 is installed, Session.FeatureRequestState("Feature2") returns "-1".

How do I determine if Feature2 is installed before Repair is performed?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Per-feature custom action and Repair option

Hi,

You are receiving this value because the custom action runs too early. Please try setting it for the "Repair" button on the "VerifyRepairDlg" dialog (as low as possible in the list). In this case it should return the value "5" which means the feature is reinstalled. You can see the possible values here.

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

Return to “Common Problems”