summaryrefslogtreecommitdiff
path: root/windows/ovs-windows-installer/CustomActions.wxs
blob: cc1b80eff5f9cf8556400801a1de87dff5246db8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?xml version="1.0" encoding="UTF-8"?>
<!--
  <copyright company="Cloudbase Solutions Srl">
    Copyright 2015 Cloudbase Solutions Srl

    Licensed under the Apache License, Version 2.0 (the "License"); you may
    not use this file except in compliance with the License.You may obtain
    a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the
    License for the specific language governing permissions and limitations
    under the License.
  </copyright>
-->
<?if $(var.Platform) = x64 ?>
  <?define NetcfgFolder = "[System64Folder]" ?>
<?else ?>
  <?define NetcfgFolder = "[WindowsFolder]Sysnative" ?>
<?endif ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Fragment>
    <Binary Id="OVSActions" SourceFile="Actions\OVSActions.js" />

    <CustomAction Id="GenerateConfDB_Prop" Property="GenerateConfDB"
                  Value='"[BINARIESDIR]ovsdb-tool.exe" create "[CONFDIR]conf.db" "[CONFDIR]vswitch.ovsschema"|0|ovsdb-tool failed to create the conf.db database'
                  Execute="immediate" />
    <CustomAction Id="GenerateConfDB"
              BinaryKey="OVSActions"
              JScriptCall="runCommandAction" Execute="deferred" Return="check" Impersonate="no" />

    <CustomAction Id="InitializeDB_Prop" Property="InitializeDB"
                  Value='"[BINARIESDIR]ovs-vsctl.exe" --no-wait --db=unix:"[APPDATADIR]db.sock" init|0|ovs-vsctl failed to initialize the database'
                  Execute="immediate" />
    <CustomAction Id="InitializeDB"
              BinaryKey="OVSActions"
              JScriptCall="runCommandAction" Execute="deferred" Return="check" Impersonate="no" />

    <CustomAction Id="InstallOpenVSwitchDriver_Prop" Property="InstallOpenVSwitchDriver"
                  Value='"$(var.NetcfgFolder)\netcfg.exe" -l "[DRIVERDIR]\ovsext.inf" -c s -i ovsext|0|netcfg failed to install the Open vSwitch Hyper-V switch extension'
                  Execute="immediate" />
    <CustomAction Id="InstallOpenVSwitchDriver"
              BinaryKey="OVSActions"
              JScriptCall="runCommandAction" Execute="deferred" Return="check" Impersonate="no" />

    <CustomAction Id="UninstallOpenVSwitchDriver_Prop" Property="UninstallOpenVSwitchDriver"
                  Value='"$(var.NetcfgFolder)\netcfg.exe" -u ovsext|0|netcfg failed to uninstall the Open vSwitch Hyper-V switch extension'
                  Execute="immediate" />
    <CustomAction Id="UninstallOpenVSwitchDriver"
              BinaryKey="OVSActions"
              JScriptCall="runCommandAction" Execute="deferred" Return="check" Impersonate="no" />

    <CustomAction Id="RestartOvsdbServerService_Prop" Return="check" Property="ChangeOvsdbServerService"
                  Value="ovsdb-server||Restart" />
    <CustomAction Id="StartOvsdbServerService_Prop" Return="check" Property="ChangeOvsdbServerService"
                  Value="ovsdb-server||Start" />
    <CustomAction Id="ChangeOvsdbServerService"
              BinaryKey="OVSActions"
              JScriptCall="changeServiceAction" Execute="deferred" Return="check" Impersonate="no" />

    <CustomAction Id="RestartOvsVSwitchdService_Prop" Return="check" Property="ChangeOvsVSwitchdService"
                  Value="ovs-vswitchd||Restart" />
    <CustomAction Id="StartOvsVSwitchdService_Prop" Return="check" Property="ChangeOvsVSwitchdService"
                  Value="ovs-vswitchd||Start" />
    <CustomAction Id="ChangeOvsVSwitchdService"
              BinaryKey="OVSActions"
              JScriptCall="changeServiceAction" Execute="deferred" Return="check" Impersonate="no" />
    <CustomAction Id="AddTriggerToOvsVswitchdService_Prop" Property="AddTriggerToOvsVswitchdService"
                  Value='"[System64Folder]sc.exe" triggerinfo ovs-vswitchd "start/strcustom/6066F867-7CA1-4418-85FD-36E3F9C0600C/VmmsWmiEventProvider"|0|failed to add triggerinfo to ovs-vswitchd service'
                  Execute="immediate" />
    <CustomAction Id="AddTriggerToOvsVswitchdService"
              BinaryKey="OVSActions"
              JScriptCall="runCommandAction" Execute="deferred" Return="check" Impersonate="no" />
  </Fragment>
</Wix>