File: Product.wxs

package info (click to toggle)
azure-cli 2.82.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,359,416 kB
  • sloc: python: 1,910,381; sh: 1,343; makefile: 406; cs: 145; javascript: 74; sql: 37; xml: 21
file content (171 lines) | stat: -rw-r--r-- 7,519 bytes parent folder | download | duplicates (2)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

  <?define ProductVersion="$(env.CLI_VERSION)" ?>

  <?define ProductName = "Microsoft Azure CLI" ?>
  <?define ProductDescription = "Command-line tools for Azure." ?>
  <?define ProductAuthor = "Microsoft Corporation" ?>
  <?define ProductResources = ".\resources\" ?>
  <?define UpgradeCode32 = "dff82af0-3f95-4ac9-8efd-948604fdb028" ?>

  <?if $(var.Platform) = "x64" ?>
  <?define AzureCliRegistryGuid = "90b6367e-4e15-4313-af33-a0ef459a56fc" ?>
  <?define AzureCliSystemPathGuid = "12c8f0dc-0475-4814-93b6-fcbe82e89532" ?>
  <?define AzureCliVersionGuid = "4df4882f-4604-4cdc-a0b4-bffc4b8c5967" ?>
  <?define ProgramFilesFolder = "ProgramFiles64Folder" ?>
  <?define RemoveAzureCLIFolderGuid = "7ce8a521-7429-4ded-9cce-0948e393cc83" ?>
  <?define RemoveCLIFolderGuid = "59fb416c-91d0-49aa-a185-d4330c435a93" ?>
  <?define UpgradeCode = "90762fec-9554-4729-a107-c6a8ea316698" ?>
  <?define Architecture = "64-bit" ?>

  <?elseif $(var.Platform) = "x86" ?>
  <?define AzureCliRegistryGuid = "BDEEE50E-70D3-4990-BFF9-FCF8114AA701" ?>
  <?define AzureCliSystemPathGuid = "3B60CA67-DB92-465A-BC96-3CA6CAEFF41B" ?>
  <?define AzureCliVersionGuid = "A5647E93-02B7-4CED-802A-DDD7416E0231" ?>
  <?define ProgramFilesFolder = "ProgramFilesFolder" ?>
  <?define RemoveAzureCLIFolderGuid = "6AF97701-6A7A-4292-95D6-ED34CD4C97C0" ?>
  <?define RemoveCLIFolderGuid = "24DA394D-B03D-4623-A0D9-852DB51EF9F4" ?>
  <?define UpgradeCode = $(var.UpgradeCode32) ?>
  <?define Architecture = "32-bit" ?>

  <?else ?>
  <?error Unsupported platform "$(var.Platform)" ?>
  <?endif ?>

  <Product Id="*"
           Name="$(var.ProductName) ($(var.Architecture))"
           Language="1033"
           Version="$(var.ProductVersion)"
           Manufacturer="$(var.ProductAuthor)"
           UpgradeCode="$(var.UpgradeCode)">

    <Package InstallerVersion="200"
             Compressed="yes"
             InstallScope="perMachine" />

    <Upgrade Id="$(var.UpgradeCode)">
      <UpgradeVersion Property="WIX_UPGRADE_DETECTED" Maximum="$(var.ProductVersion)" IncludeMaximum="no" MigrateFeatures="yes" />
      <UpgradeVersion Property="WIX_DOWNGRADE_DETECTED" Minimum="$(var.ProductVersion)" IncludeMinimum="no" OnlyDetect="yes" />
    </Upgrade>
    <InstallExecuteSequence>
      <RemoveExistingProducts After="InstallExecute" />
    </InstallExecuteSequence>

    <!-- New product architectures should upgrade the original x86 product - even of the same version. -->
    <?if $(var.UpgradeCode) != $(var.UpgradeCode32) ?>
    <Upgrade Id="$(var.UpgradeCode32)">
      <UpgradeVersion Property="WIX_X86_UPGRADE_DETECTED" Maximum="$(var.ProductVersion)" IncludeMaximum="yes" MigrateFeatures="yes" />
      <UpgradeVersion Property="WIX_X86_DOWNGRADE_DETECTED" Minimum="$(var.ProductVersion)" IncludeMinimum="no" OnlyDetect="yes" />
    </Upgrade>
    <Condition Message="A newer version of $(var.ProductName) is already installed.">NOT (WIX_DOWNGRADE_DETECTED OR WIX_X86_DOWNGRADE_DETECTED)</Condition>
    <?else ?>
    <Condition Message="A newer version of $(var.ProductName) is already installed.">NOT WIX_DOWNGRADE_DETECTED</Condition>
    <?endif ?>

    <Media Id="1" Cabinet="WindowsAzureCLI.cab" EmbedCab="yes" CompressionLevel="high" />

    <Icon Id="AzureIcon" SourceFile="$(var.ProductResources)windowsazure.ico" />

    <Property Id="ARPPRODUCTICON" Value="AzureIcon" />
    <Property Id="ARPHELPLINK" Value="https://learn.microsoft.com/cli/azure" />
    <Property Id="ARPURLINFOABOUT" Value="https://learn.microsoft.com/cli/azure/overview" />
    <Property Id="ARPURLUPDATEINFO" Value="https://learn.microsoft.com/cli/azure/overview" />
    <Property Id="MSIFASTINSTALL" Value="7" />
    <Property Id="ApplicationFolderName" Value="Microsoft SDKs\Azure" />
    <Property Id="WixAppFolder" Value="WixPerMachineFolder" />

    <Feature Id="ProductFeature"
             Title="Microsoft Azure CLI"
             Level="1"
             AllowAdvertise="no">
      <ComponentGroupRef Id="ProductComponents" />
    </Feature>

    <!--Custom action to propagate path env variable change-->
    <CustomActionRef Id="WixBroadcastEnvironmentChange" />

    <!-- User Interface -->
    <WixVariable Id="WixUILicenseRtf" Value="$(var.ProductResources)CLI_LICENSE.rtf"/>
    <WixVariable Id="WixUIDialogBmp" Value="$(var.ProductResources)Dialog.bmp" />
    <WixVariable Id="WixUIBannerBmp" Value="$(var.ProductResources)Banner.bmp" />

    <UIRef Id="WixUI_Minimal"/>
    <UIRef Id="WixUI_ErrorProgressText"/>

    <!-- Show message to restart any terminals only if the PATH is changed -->
    <CustomAction Id="Set_WIXUI_EXITDIALOGOPTIONALTEXT" Property="WIXUI_EXITDIALOGOPTIONALTEXT" Value="Please close and reopen any active terminal window to use Azure CLI." />
    <InstallUISequence>
      <Custom Action="Set_WIXUI_EXITDIALOGOPTIONALTEXT" After="CostFinalize">NOT Installed AND NOT WIX_UPGRADE_DETECTED</Custom>
    </InstallUISequence>

  </Product>

  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="$(var.ProgramFilesFolder)">
        <Directory Id="SDKFOLDER" Name="Microsoft SDKs">
          <Directory Id="AZUREFOLDER" Name="Azure">
            <Directory Id="AZURECLIFOLDER" Name="CLI2">
              <Directory Id="DynamicCliDir"/>
              <Directory Id="BIN" Name="Bin" />
            </Directory>
          </Directory>
        </Directory>
      </Directory>
    </Directory>
  </Fragment>

  <Fragment>
    <ComponentGroup Id="AzureCliSettingsGroup">
      <Component Id="RemoveCLIFolder"
                 Directory="DynamicCliDir"
                 Guid="$(var.RemoveCLIFolderGuid)">
        <RemoveFolder Id="DynamicCliDir" On="uninstall" />
      </Component>
      <Component Id="RemoveAzureCLIFolder"
                 Directory="AZURECLIFOLDER"
                 Guid="$(var.RemoveAzureCLIFolderGuid)">
        <RemoveFolder Id="AZURECLIFOLDER" On="uninstall" />
      </Component>
      <Component Id="AzureCliSystemPath"
                 Directory="DynamicCliDir"
                 Guid="$(var.AzureCliSystemPathGuid)">
        <Environment Id="AzureCliAddedToPATH"
                     Name="PATH"
                     Value="[DynamicCliDir]wbin"
                     Permanent="no"
                     Part="first"
                     Action="set"
                     System="yes" />
        <CreateFolder />
      </Component>
      <Component Id="AzureCliRegistry"
                 Directory="DynamicCliDir"
                 Guid="$(var.AzureCliRegistryGuid)">
        <RegistryValue Root="HKCU"
                       Key="Software\Microsoft\$(var.ProductName)"
                       Name="installed"
                       Type="integer"
                       Value="1"
                       KeyPath="yes"/>
      </Component>
      <Component Id="AzureCliVersion"
                 Directory="DynamicCliDir"
                 Guid="$(var.AzureCliVersionGuid)">
        <RegistryValue Root="HKLM"
                       Key="Software\Microsoft\$(var.ProductName)"
                       Name="version"
                       Type="string"
                       Value="$(var.ProductVersion)"
                       KeyPath="yes"/>
      </Component>
    </ComponentGroup>

    <ComponentGroup Id="ProductComponents">
      <ComponentGroupRef Id="AzureCliComponentGroup"/>
      <ComponentGroupRef Id="AzureCliSettingsGroup"/>
    </ComponentGroup>

  </Fragment>
</Wix>