Advanced installer: query result is not stored in property

182 views Asked by At

I want to run a query inside advanced installer and use its result in final stages of installation. The scenario is like this: In start of setup, using a query I insert a record in log table like this:

DECLARE @return_value int
DECLARE @UML_ID int
EXEC    @return_value = [Common].[UML_Insert_WebServiceInstaller]
        @UML_ToVersion = '$VERSION$',
        @UML_UpdateType = 1,
        @UML_ID = @UML_ID OUTPUT

SELECT @UML_ID AS UML_ID_PROP

Then at the end of installation I should update record given with returned as UML_ID_PROP.

I have defined my query to store its result in UML_ID_PROP like this:

enter image description here

And then I want to show the result stored in UML_ID_PROP in combobox but it does not show up and its default value is displayed only.

enter image description here

And here is the configuration for property UML_ID_PROP.

enter image description here

1

There are 1 answers

0
J.Tribbiani On

You are setting the property during Install Execution Stage. It's a Windows Installer limitation that property values cannot pass from Install Execution Stage to Wizard Dialogs Stage.

The workaround you have is to set the property through a custom action scheduled in the Wizard Dialogs Stage.

As I can see, you are trying to get the result of an SQL Query in a property and display that property on the ExitDialog. Note that you can easily execute the SQL Query on the Wizard Dialogs Stage, for details please check the Set MSI properties from SQL queries video.

Check the Windows Installer Custom Actions article for a better understanding of how custom actions/ standard actions are executed in the MSI.