1

I have created a Windows Service Installer using WiX 3.8, everything works fine except that the service does not start upon installation, I have written a custom action which modifies the app.config with the user input values, the service fails to start because the app.config is not yet modified.

Is there a way I can schedule modifying App.config before the attempt to start the service is made?

Please help. Thanks in advance

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
user3453636
  • 77
  • 1
  • 9
  • 1
    In a rush, but your custom action must be scheduled before the StartServices action in the InstallExecuteSequence. – Stein Åsmul Jul 31 '14 at 07:41
  • Did that, but the custom action does not find the App.config file – user3453636 Jul 31 '14 at 08:03
  • You need a deferred mode custom action. – Stein Åsmul Jul 31 '14 at 08:07
  • I get this error Microsoft.Deployment.WindowsInstaller.InstallerException: Cannot access session details from a non-immediate custom action – user3453636 Jul 31 '14 at 08:11
  • This is a complicated topic, this may help: **[deferred mode execution](http://www.symantec.com/connect/articles/how-access-windows-installer-property-deferred-execution)**. And **[this SDK information](http://msdn.microsoft.com/en-us/library/aa370543(v=vs.85).aspx)**. And an [plainer language explanation](http://www.installworld.com/index.php?view=article&catid=40%3Awindows-installer&id=88%3Ahow-can-i-provide-data-to-my-deferred-custom-action&option=com_content&Itemid=136). – Stein Åsmul Jul 31 '14 at 08:15

1 Answers1

0

Make your custom action run deferred and schedule it to run after InstallFiles and before StartServices, for example:

<CustomAction Id="SomeAction"
            DllEntry="SomeEntry"
            Return="ignore"
            Execute="deferred"
            BinaryKey="CA.dll"/>

<InstallExecuteSequence>
    <Custom Action="SomeAction" After="InstallFiles"></Custom>
</InstallExecuteSequence>
IlirB
  • 1,410
  • 14
  • 19