xref: /openbmc/qemu/qga/installer/qemu-ga.wxs (revision 01fdadde)
166ae13bbSYossi Hindin<?xml version="1.0" encoding="UTF-8"?>
266ae13bbSYossi Hindin<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
366ae13bbSYossi Hindin  <?ifndef env.QEMU_GA_VERSION ?>
466ae13bbSYossi Hindin    <?error Environment variable QEMU_GA_VERSION undefined?>
566ae13bbSYossi Hindin  <?endif?>
666ae13bbSYossi Hindin
766ae13bbSYossi Hindin  <?ifndef env.QEMU_GA_DISTRO ?>
866ae13bbSYossi Hindin    <?error Environment variable QEMU_GA_DISTRO undefined?>
966ae13bbSYossi Hindin  <?endif?>
1066ae13bbSYossi Hindin
1166ae13bbSYossi Hindin  <?ifndef env.QEMU_GA_MANUFACTURER ?>
1266ae13bbSYossi Hindin    <?error Environment variable QEMU_GA_MANUFACTURER undefined?>
1366ae13bbSYossi Hindin  <?endif?>
1466ae13bbSYossi Hindin
1566ae13bbSYossi Hindin  <?ifndef var.Arch?>
1666ae13bbSYossi Hindin    <?error Define Arch to 32 or 64?>
1766ae13bbSYossi Hindin  <?endif?>
1866ae13bbSYossi Hindin
1966ae13bbSYossi Hindin  <?ifndef var.Mingw_bin?>
2066ae13bbSYossi Hindin    <?if $(var.Arch) = "64"?>
2166ae13bbSYossi Hindin      <?define Mingw_bin=/usr/x86_64-w64-mingw32/sys-root/mingw/bin ?>
2266ae13bbSYossi Hindin    <?endif?>
2366ae13bbSYossi Hindin    <?if $(var.Arch) = "32"?>
2466ae13bbSYossi Hindin      <?define Mingw_bin=/usr/i686-w64-mingw32/sys-root/mingw/bin ?>
2566ae13bbSYossi Hindin    <?endif?>
2666ae13bbSYossi Hindin  <?endif?>
2766ae13bbSYossi Hindin
2866ae13bbSYossi Hindin  <?if $(var.Arch) = "64"?>
2966ae13bbSYossi Hindin    <?define ArchLib=libgcc_s_seh-1.dll?>
3066ae13bbSYossi Hindin    <?define GaProgramFilesFolder="ProgramFiles64Folder" ?>
3166ae13bbSYossi Hindin  <?endif?>
3266ae13bbSYossi Hindin
3366ae13bbSYossi Hindin  <?if $(var.Arch) = "32"?>
3466ae13bbSYossi Hindin    <?define ArchLib=libgcc_s_sjlj-1.dll?>
3566ae13bbSYossi Hindin    <?define GaProgramFilesFolder="ProgramFilesFolder" ?>
3666ae13bbSYossi Hindin  <?endif?>
3766ae13bbSYossi Hindin
3866ae13bbSYossi Hindin  <?ifndef var.ArchLib ?>
3966ae13bbSYossi Hindin    <?error Unexpected Arch value $(var.Arch)?>
4066ae13bbSYossi Hindin  <?endif?>
4166ae13bbSYossi Hindin
4266ae13bbSYossi Hindin  <Product
4366ae13bbSYossi Hindin    Name="QEMU guest agent"
44*01fdaddeSLeonid Bloch    Id="{DF9974AD-E41A-4304-81AD-69AA8F299766}"
451d394fb7SLeonid Bloch    UpgradeCode="{EB6B8302-C06E-4BEC-ADAC-932C68A3A98D}"
4666ae13bbSYossi Hindin    Manufacturer="$(env.QEMU_GA_MANUFACTURER)"
4766ae13bbSYossi Hindin    Version="$(env.QEMU_GA_VERSION)"
4866ae13bbSYossi Hindin    Language="1033">
4966ae13bbSYossi Hindin    <?if $(var.Arch) = 32 ?>
5066ae13bbSYossi Hindin    <Condition Message="Error: 32-bit version of Qemu GA can not be installed on 64-bit Windows.">NOT VersionNT64</Condition>
5166ae13bbSYossi Hindin    <?endif?>
5266ae13bbSYossi Hindin    <Package
5366ae13bbSYossi Hindin      Manufacturer="$(env.QEMU_GA_MANUFACTURER)"
5466ae13bbSYossi Hindin      InstallerVersion="200"
5566ae13bbSYossi Hindin      Languages="1033"
5666ae13bbSYossi Hindin      Compressed="yes"
5766ae13bbSYossi Hindin      InstallScope="perMachine"
5866ae13bbSYossi Hindin      />
5966ae13bbSYossi Hindin    <Media Id="1" Cabinet="qemu_ga.$(env.QEMU_GA_VERSION).cab" EmbedCab="yes" />
6066ae13bbSYossi Hindin    <Property Id="WHSLogo">1</Property>
61848849ddSLeonid Bloch    <MajorUpgrade
62848849ddSLeonid Bloch      DowngradeErrorMessage="Error: A newer version of QEMU guest agent is already installed."
63848849ddSLeonid Bloch      />
6466ae13bbSYossi Hindin
6566ae13bbSYossi Hindin    <Directory Id="TARGETDIR" Name="SourceDir">
6666ae13bbSYossi Hindin      <Directory Id="$(var.GaProgramFilesFolder)" Name="QEMU Guest Agent">
6766ae13bbSYossi Hindin        <Directory Id="qemu_ga_directory" Name="Qemu-ga">
681d394fb7SLeonid Bloch          <Component Id="qemu_ga" Guid="{908B7199-DE2A-4DC6-A8D0-27A5AE444FEA}">
69decdfbd2SLeonid Bloch            <File Id="qemu_ga.exe" Name="qemu-ga.exe" Source="$(env.BUILD_DIR)/qemu-ga.exe" KeyPath="yes" DiskId="1"/>
7066ae13bbSYossi Hindin            <ServiceInstall
7166ae13bbSYossi Hindin              Id="ServiceInstaller"
7266ae13bbSYossi Hindin              Type="ownProcess"
7366ae13bbSYossi Hindin              Vital="yes"
7466ae13bbSYossi Hindin              Name="QEMU-GA"
7566ae13bbSYossi Hindin              DisplayName="QEMU Guest Agent"
7666ae13bbSYossi Hindin              Description="QEMU Guest Agent"
7766ae13bbSYossi Hindin              Start="auto"
7866ae13bbSYossi Hindin              Account="LocalSystem"
7966ae13bbSYossi Hindin              ErrorControl="ignore"
8066ae13bbSYossi Hindin              Interactive="no"
8166ae13bbSYossi Hindin              Arguments="-d"
8266ae13bbSYossi Hindin              >
8366ae13bbSYossi Hindin            </ServiceInstall>
8466ae13bbSYossi Hindin            <ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="QEMU-GA" Wait="no" />
8566ae13bbSYossi Hindin          </Component>
865e994f94SLeonid Bloch          <?ifdef var.InstallVss?>
875e994f94SLeonid Bloch          <Component Id="qga_vss_dll" Guid="{CB19C453-FABB-4BB1-ABAB-6B74F687BFBB}">
88decdfbd2SLeonid Bloch            <File Id="qga_vss.dll" Name="qga-vss.dll" Source="$(env.BUILD_DIR)/qga/vss-win32/qga-vss.dll" KeyPath="yes" DiskId="1"/>
895e994f94SLeonid Bloch          </Component>
905e994f94SLeonid Bloch          <Component Id="qga_vss_tlb" Guid="{D8D584B1-59C2-4FB7-A91F-636FF7BFA66E}">
91decdfbd2SLeonid Bloch            <File Id="qga_vss.tlb" Name="qga-vss.tlb" Source="$(env.BUILD_DIR)/qga/vss-win32/qga-vss.tlb" KeyPath="yes" DiskId="1"/>
925e994f94SLeonid Bloch          </Component>
935e994f94SLeonid Bloch          <?endif?>
94f2b608abSYuri Pudgorodskiy          <?if $(var.Arch) = "32"?>
95f2b608abSYuri Pudgorodskiy          <Component Id="gspawn-helper-console" Guid="{446185B3-87BE-43D2-96B8-0FEFD9E8696D}">
96f2b608abSYuri Pudgorodskiy            <File Id="gspawn-win32-helper-console.exe" Name="gspawn-win32-helper-console.exe" Source="$(var.Mingw_bin)/gspawn-win32-helper-console.exe" KeyPath="yes" DiskId="1"/>
97f2b608abSYuri Pudgorodskiy          </Component>
9844c6e00cSYuri Pudgorodskiy          <Component Id="gspawn-helper" Guid="{CD67A5A3-2DB1-4DA1-A67A-8D71E797B466}">
9944c6e00cSYuri Pudgorodskiy            <File Id="gspawn-win32-helper.exe" Name="gspawn-win32-helper.exe" Source="$(var.Mingw_bin)/gspawn-win32-helper.exe" KeyPath="yes" DiskId="1"/>
10044c6e00cSYuri Pudgorodskiy          </Component>
101f2b608abSYuri Pudgorodskiy          <?endif?>
102f2b608abSYuri Pudgorodskiy          <?if $(var.Arch) = "64"?>
103f2b608abSYuri Pudgorodskiy          <Component Id="gspawn-helper-console" Guid="{9E615A9F-349A-4992-A5C2-C10BAD173660}">
104f2b608abSYuri Pudgorodskiy            <File Id="gspawn-win64-helper-console.exe" Name="gspawn-win64-helper-console.exe" Source="$(var.Mingw_bin)/gspawn-win64-helper-console.exe" KeyPath="yes" DiskId="1"/>
105f2b608abSYuri Pudgorodskiy          </Component>
10644c6e00cSYuri Pudgorodskiy          <Component Id="gspawn-helper" Guid="{D201AD22-1846-4E4F-B6E1-C7A908ED2457}">
10744c6e00cSYuri Pudgorodskiy            <File Id="gspawn-win64-helper.exe" Name="gspawn-win64-helper.exe" Source="$(var.Mingw_bin)/gspawn-win64-helper.exe" KeyPath="yes" DiskId="1"/>
10844c6e00cSYuri Pudgorodskiy          </Component>
109f2b608abSYuri Pudgorodskiy          <?endif?>
1105e994f94SLeonid Bloch          <Component Id="iconv" Guid="{35EE3558-D34B-4F0A-B8BD-430FF0775246}">
1115e994f94SLeonid Bloch            <File Id="iconv.dll" Name="iconv.dll" Source="$(var.Mingw_bin)/iconv.dll" KeyPath="yes" DiskId="1"/>
1125e994f94SLeonid Bloch          </Component>
1135e994f94SLeonid Bloch          <Component Id="libgcc_arch_lib" Guid="{ADD4D07D-4515-4AB6-AF3E-C904961B4BB0}">
1145e994f94SLeonid Bloch            <File Id="libgcc_arch_lib" Name="$(var.ArchLib)" Source="$(var.Mingw_bin)/$(var.ArchLib)" KeyPath="yes" DiskId="1"/>
1155e994f94SLeonid Bloch          </Component>
1165e994f94SLeonid Bloch          <Component Id="libglib" Guid="{D31BFD83-2773-4B65-B45A-E0D2ADA58679}">
1175e994f94SLeonid Bloch            <File Id="libglib_2.0_0.dll" Name="libglib-2.0-0.dll" Source="$(var.Mingw_bin)/libglib-2.0-0.dll" KeyPath="yes" DiskId="1"/>
1185e994f94SLeonid Bloch          </Component>
1195e994f94SLeonid Bloch          <Component Id="libintl" Guid="{A641BC2D-A907-4A94-9149-F30ED430878F}">
1205e994f94SLeonid Bloch            <File Id="libintl_8.dll" Name="libintl-8.dll" Source="$(var.Mingw_bin)/libintl-8.dll" KeyPath="yes" DiskId="1"/>
1215e994f94SLeonid Bloch          </Component>
1225e994f94SLeonid Bloch          <Component Id="libssp" Guid="{7880087B-02B4-4EF6-A5D3-D18F8E3D90E1}">
1235e994f94SLeonid Bloch            <File Id="libssp_0.dll" Name="libssp-0.dll" Source="$(var.Mingw_bin)/libssp-0.dll" KeyPath="yes" DiskId="1"/>
1245e994f94SLeonid Bloch          </Component>
1255e994f94SLeonid Bloch          <Component Id="libwinpthread" Guid="{6C117C78-0F47-4B07-8F34-6BEE11643829}">
1265e994f94SLeonid Bloch            <File Id="libwinpthread_1.dll" Name="libwinpthread-1.dll" Source="$(var.Mingw_bin)/libwinpthread-1.dll" KeyPath="yes" DiskId="1"/>
1275e994f94SLeonid Bloch          </Component>
1281d394fb7SLeonid Bloch          <Component Id="registry_entries" Guid="{D075D109-51CA-11E3-9F8B-000C29858960}">
12966ae13bbSYossi Hindin            <RegistryKey Root="HKLM"
13066ae13bbSYossi Hindin                         Key="Software\$(env.QEMU_GA_MANUFACTURER)\$(env.QEMU_GA_DISTRO)\Tools\QemuGA">
13166ae13bbSYossi Hindin              <RegistryValue Type="string" Name="ProductID" Value="fb0a0d66-c7fb-4e2e-a16b-c4a3bfe8d13b" />
13266ae13bbSYossi Hindin              <RegistryValue Type="string" Name="Version" Value="$(env.QEMU_GA_VERSION)" />
13366ae13bbSYossi Hindin            </RegistryKey>
13466ae13bbSYossi Hindin          </Component>
13566ae13bbSYossi Hindin        </Directory>
13666ae13bbSYossi Hindin      </Directory>
13766ae13bbSYossi Hindin    </Directory>
13866ae13bbSYossi Hindin
13966ae13bbSYossi Hindin    <Property Id="cmd" Value="cmd.exe"/>
140848849ddSLeonid Bloch    <Property Id="REINSTALLMODE" Value="amus"/>
14166ae13bbSYossi Hindin
14266ae13bbSYossi Hindin    <?ifdef var.InstallVss?>
14366ae13bbSYossi Hindin    <CustomAction Id="RegisterCom"
14466ae13bbSYossi Hindin              ExeCommand='/c "[qemu_ga_directory]qemu-ga.exe" -s vss-install'
14566ae13bbSYossi Hindin              Execute="deferred"
14666ae13bbSYossi Hindin              Property="cmd"
14766ae13bbSYossi Hindin              Impersonate="no"
14866ae13bbSYossi Hindin              Return="check"
14966ae13bbSYossi Hindin              >
15066ae13bbSYossi Hindin    </CustomAction>
15166ae13bbSYossi Hindin    <CustomAction Id="UnRegisterCom"
15266ae13bbSYossi Hindin              ExeCommand='/c "[qemu_ga_directory]qemu-ga.exe" -s vss-uninstall'
15366ae13bbSYossi Hindin              Execute="deferred"
15466ae13bbSYossi Hindin              Property="cmd"
15566ae13bbSYossi Hindin              Impersonate="no"
15666ae13bbSYossi Hindin              Return="check"
1570a18750fSLeonid Bloch              >
1580a18750fSLeonid Bloch    </CustomAction>
15966ae13bbSYossi Hindin    <?endif?>
16066ae13bbSYossi Hindin
16166ae13bbSYossi Hindin    <Feature Id="QEMUFeature" Title="QEMU Guest Agent" Level="1">
16266ae13bbSYossi Hindin      <ComponentRef Id="qemu_ga" />
1635e994f94SLeonid Bloch      <?ifdef var.InstallVss?>
1645e994f94SLeonid Bloch      <ComponentRef Id="qga_vss_dll" />
1655e994f94SLeonid Bloch      <ComponentRef Id="qga_vss_tlb" />
1665e994f94SLeonid Bloch      <?endif?>
167f2b608abSYuri Pudgorodskiy      <ComponentRef Id="gspawn-helper-console" />
16844c6e00cSYuri Pudgorodskiy      <ComponentRef Id="gspawn-helper" />
1695e994f94SLeonid Bloch      <ComponentRef Id="iconv" />
1705e994f94SLeonid Bloch      <ComponentRef Id="libgcc_arch_lib" />
1715e994f94SLeonid Bloch      <ComponentRef Id="libglib" />
1725e994f94SLeonid Bloch      <ComponentRef Id="libintl" />
1735e994f94SLeonid Bloch      <ComponentRef Id="libssp" />
1745e994f94SLeonid Bloch      <ComponentRef Id="libwinpthread" />
17566ae13bbSYossi Hindin      <ComponentRef Id="registry_entries" />
17666ae13bbSYossi Hindin    </Feature>
17766ae13bbSYossi Hindin
17866ae13bbSYossi Hindin    <InstallExecuteSequence>
17966ae13bbSYossi Hindin      <?ifdef var.InstallVss?>
18066ae13bbSYossi Hindin      <Custom Action="UnRegisterCom" After="StopServices">Installed</Custom>
181848849ddSLeonid Bloch      <Custom Action="RegisterCom" After="InstallServices">NOT REMOVE</Custom>
18266ae13bbSYossi Hindin      <?endif?>
18366ae13bbSYossi Hindin    </InstallExecuteSequence>
18466ae13bbSYossi Hindin  </Product>
18566ae13bbSYossi Hindin</Wix>
186