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

Sequencing headache


4 replies to this topic

Gareth at Serif

Gareth at Serif
  • Full Members
  • 85 posts

Posted 14 May 2007 - 16:34

Hi guys,

I have a problem that I'd like to install file and use it as part of a CA, but before the registry is written. Initially this seemed easy enough by sequencing the CA within the InstallExecute sequence somewhere between InstallFiles and WriteRegistryValues, but in this scenario the CA tries to execute on the Client side, but the actual files aren't available until the Server side reaches the InstallFiles action. The obvious alternative I could think of was to execute my CA with the 'Commit' attribute, but this causes it to run after the registry values are written... which is too late.

Has anyone got experience of executing a CA after the fiels are copied, but before the registry is written?

Many thanks,
Gareth

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 15 May 2007 - 09:49

I think you are almost there, but you need to run the custom action in deferred mode rather than immediate mode. Doing so will also require that you write all required properties into the execution scripts since Session.Property and MsiGetProperty won't work in deferred mode. I made a test MSI that does this using a VBScript - I have attached a zip of it, maybe it helps. It will install a single file, then pause for 15 seconds and then write a single registry entry.

Attached Files


Regards
-Stein Åsmul

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 16 May 2007 - 01:16

I forgot to mention that the VBScript custom action that is included runs in deferred mode to illustrate the use of the CustomActionData feature (search for this in the MSI SDK for more info). The script itself just writes the INSTALLDIR value from deferred mode execution to a file on the C:\ drive.
Regards
-Stein Åsmul

Gareth at Serif

Gareth at Serif
  • Full Members
  • 85 posts

Posted 18 May 2007 - 15:02

Deferred seems to do it right, thanks. I assummed this'd make it happen after the registry is written, but this doesn't seem to be the case. I must say, that sequencing is my main weakness in MSI technology...

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 18 May 2007 - 18:43

I wrote an article to explain the sequencing:
Installation Phases and In-Script Execution Options for Custom Actions in Windows Installer
http://www.installsi...00108/index.htm