Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Properties and Deferred CA's


3 replies to this topic

Scott Mayham

Scott Mayham
  • Full Members
  • 54 posts

Posted 28 November 2001 - 20:16

Properties and Deferred CA's

(context: IPWI 2.03)

I am having a similar problem to that of several other folks who have
posted to this forum.  I suspect we are all suffering from a fundamental
misunderstanding, so, while asking in detail about my situation, I will
try to do so in a way that everyone can benefit.

My problem comes in getting a property, defined during the UI via a
dialog box, to a deferred CA running late in the EX.  

Some months ago, with some help from this forum, I was able to get
INSTALLDIR to such a CA.  To do this, I used a pair of CA's: One named
Save_Install_DIr, and one named Get_Install_Dir.  Get_Install_Dir ran
an InstallScript function named GetInstallDir.  They were set up as
follows:

CA Name:              Save_Install_Dir
Type:                 51   (immediate)
       Source:               Get_Install_Dir
Target:               [INSTALLDIR]
Sequence:             Installation > Execute
                             (right after InstallInitialize)

CA Name:              Get_Install_Dir
Type:                 66560   (deferred)
Source:               GetInstallDir  (an InstallScript function)
Target:               none
Sequence:             Installation > Execute
                     (right before InstallFinalize)

This all works perfectly.  The GetInstallDir function calls
MsiGetProperty to get it's CustomActionData (which contains the
value of INSTALLDIR), and then passes it to some configuration
programs called via LaunchAppAndWait.

Well, now a new requirement came up: to capture a new property, which
defines whether a certain SQL database used by our product is to be
found on the local machine (on which the installation is taking place)
or on some other machine on the network.  This information is to be
used to vary the behavior of one of the configuration programs.

Based on my experience with INSTALLDIR, I figured all I needed to do
was to create a new dialog box, along with a new pair of CA's, a
Property, and an InstallScript function, all of which would mimic those
which worked so well before.

So, I went to the Property Manager, created a new property called
"SQLLocation", and gave it a default value of "Local".  I then created
a new InstallScript Function, "GetSQLLocation", which calls
MsiGetProperty, getting CustomActionData, and then setting a global
variable sSQLLocation, for use by another CA-driven function.

To get the "Local" versus "Remote" information, I created a simple
dialog box with a pair of Radio Buttons.  The property associated with
the Radio Button Group was the one I created in the property table,
SQLLocation.  The two buttons were labelled simply, "LOCAL" and
"REMOTE", and the values were set to "Local" and "Remote",
respectively, and their tab sequence to 1 and 2, respectively.  This
dialog box I inserted in the Installation UI, between CustomSetup and
ReadyToInstall, taking care to properly set the Events associated with
the Back and Next buttons for that dialog and those before and after
it in the UI sequence.

Finally, I created a pair of CA's, similar to the ones described above:

CA Name:              Save_SQL_Location
Type:                 51   (immediate)
       Source:               Get_SQL_Location
Target:               [SQLLocation]
Sequence:             Installation > Execute
                             (right after Save_Install_Dir)

CA Name:              Get_SQL_Location
Type:                 66560   (deferred)
Source:               GetSQLLocation (an InstallScript function)
Target:               none
Sequence:             Installation > Execute
                     (right after Get_Install_Dir)


They don't seem to work!  The dialog box appears and functions as
expected.  However, the Get_SQL_Location CA always gets the same value
in it's CustomActionData: "Local", which is the default set in the
Property Table.  Even if the user clicks the "REMOTE" button in the
dialog box, "Local" always comes out the other end of the process.

What's wrong here?  I suppose I've missed something, but no amount of
review and tweaking seems to have any (beneficial) effect.  

I apologize for the detail, but I think that if I get a definitive
answer to this problem, it might serve to help others with similar
issues.

Regards,


Irina

Irina
  • Members
  • 227 posts

Posted 03 December 2001 - 19:48

HI Scott,
Try upper case for the property: SQLLOCATION. I guess it should be public property.

Scott Mayham

Scott Mayham
  • Full Members
  • 54 posts

Posted 03 December 2001 - 20:01

Irina,

DUH!   I'll try that.  Now that you have me thinking about it, one of the only differences between the pair of CAs that worked, and the pair that did not, was the fact that the pair which worked communicated a Public (all caps) property, INSTALLDIR.

Why a public property would be necessary escapes me, but I'll try what you suggest.  Watch this space.

Thanks,


Scott Mayham

Scott Mayham
  • Full Members
  • 54 posts

Posted 03 December 2001 - 20:12

Irina,

DUH!   I'll try that.  Now that you have me thinking about it, one of the only differences between the pair of CAs that worked, and the pair that did not, was the fact that the pair which worked communicated a Public (all caps) property, INSTALLDIR.

Why a public property would be necessary escapes me, but I'll try what you suggest.  Watch this space.

Thanks,