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

Using the Formatted Data type


4 replies to this topic

Neo

Neo
  • Members
  • 48 posts

Posted 07 December 2003 - 06:14

How do I use the formatted datatype in my custom table. I need some property values to be available for my custom action executing in the Deferred execution mode.

This is the scenario now. I am trying to create multiple sites. I would like all the data to be available in a table for my VBScript(ADSI) custom action. The table structure is similar to that Installshield Developer uses for creating virtual directories. Each site is associated with a condition and its root is based on the destination of a particular feature. I would like to have the custom action deferred, as further maintanance might be performed by non-privileged users(though unlikely).

Formatted column type seems to be the obvious solution but I dont know how to get it working. So I decided to run a custom action in the immediate mode to process the contents of the table and to change the values in the database. I used the Modify method of the Session object. But it failed to modify. The database object returned from the Session.Database statement seems to be read-only.

I am stuck with this. sad.gif

Any help will be appreciated. Code samples are welcome. If this custom action works, I can share my code with the rest of the Installer community. smile.gif

After all, there are people who beleive in Open Source even on Microsoft platforms. cool.gif

Neo.

Neo

Neo
  • Members
  • 48 posts

Posted 11 December 2003 - 12:40

I dont know if this might work but I am now trying to write the settings as strings onto the registry in the Immediate mode and use it in the deferred mode.

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 12 December 2003 - 08:54

Neo, I am on "shaky ground" here I am afraid... However, I believe I read somewhere that you can pass public properties to deferred execution actions by adding the properties you need to the SecureCustomProperties property. Here is from the SDK:

SecureCustomProperties Property: The SecureCustomProperties is a list of public properties delimited by semi-colons. These properties are included with the default list of restricted public properties that the installer can pass to the server side when doing a managed installation with elevated privileges.

Regards
-Stein Åsmul

Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 12 December 2003 - 10:08

If you want to modify a record the active database, you must delete it, and insert a temporary record. Note that the changes do not persist, so you've got to do it all over again on uninstall, repair, change etc.

If you want to use a deferred CA, you'll need to rethink it all over again: You cannot access the active database in a deferred or rollback CA. You can't do a lot of other things either.

I suggest the following direction:
You need two CAs, an immediate execution CA and a deferred CA.
Schedule a normal CA just before InstallInitialize. It reads your table, and creates a temporary file with the necessary information. Conditions are evaluated in this CA as well. The name of the temporary file is stored in a property - the name of this property is exactly the same as the name of the deferred CA.
The deferred CA reads property "CustomActionData", which now contains the temporary file name, as created in previous CA. Using this file name, the CA does its creation work. Finally it destroys the file.
If you want to create a perfect setup, also create a rollback CA, that destroys the file as well. The immediate CA should pass the filename to this CA as well.

One note on ADSI: By default, it's not available on Win9x/Me/NT4. If you install it as well, you'll probably need a reboot before you can use it.

Neo

Neo
  • Members
  • 48 posts

Posted 15 December 2003 - 07:40

thanx a ton. smile.gif