Вопрос

I've got a Wix situation that seems like its solution might be the combination of several steps. I just don't know what the steps are or how to contruct them.

My installation depends on a certain version of another program being install (e.g. OtherApp v2.1.6). I need to specify that as a Launch condition.

The tricky part is that the only place that version is specified in the OtherApp installation is in a textfile (version.dat). So I need to write a custom action to read that version string from the dat file and assign it to a property or condition, all before Launch Conditions.

I've tried a batch file to open that textfile and compare the version found with one that is passed into the batch file as an argument. The batch file would returns 0 if the version is the same or higher (assuming backward compatibility), and 1 if the version is older. However, I couldn't get the custom action to execute the batch file correctly.

I've also tried different ways of using a VBScript without success.

Can anyone give any insight as to how I should set up this scenario? I thought I knew, but I've found that I haven't a clue.

Thanks for any help!

Это было полезно?

Решение

You're on the right way. The custom action to read the TXT file must be immediate and run before LaunchCondition standard action. You should schedule this custom action in both sequences, InstallUISequence and InstallExecuteSequence - in case your installation runs in quiet or basic UI mode, only InstallExecuteSequence is considered, otherwise both sequences run. That custom action should read the version from the file, and set an MSI property. This property should be used later in launch condition.

The language you create your custom action with doesn't really matter. So, feel free to choose the technology convenient to you. However, remember that VBScript custom actions suck. :-)

If your application is a .NET application, this means that .NET is a prerequisite for your installation and therefore you can take advantage of the option to create custom actions in C#. The DTF (API to talk to MSI database shipped with WiX) is very convenient. For instance, in order to set a property, you can use the following syntax:

session["OTHER_APP_IS_INSTALLED"] = 1;
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top