forked from Azure/azure-powershell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azurecmd.wxs
113 lines (97 loc) · 6.78 KB
/
azurecmd.wxs
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
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" >
<Product Id="*"
Name="$(var.productName)"
Language="1033"
Version="$(var.version)"
Manufacturer="Microsoft Corporation"
UpgradeCode="EBC1AD5E-1BBE-45B5-9E8D-ACFC8951C253">
<Package InstallerVersion="200" Compressed="yes" />
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
<MajorUpgrade AllowSameVersionUpgrades="yes"
DowngradeErrorMessage="A later version of Microsoft Azure PowerShell is already installed. Setup will now exit." />
<Icon Id="icon.ico" SourceFile="media\WAIcon.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
<Property Id="ALLUSERS" Value="1" />
<Property Id="ISVSINSTALL" Secure="yes"/>
<Property Id="POWERSHELLEXE">c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe</Property>
<WixVariable Id="WixUILicenseRtf" Value="$(sys.SOURCEFILEDIR)\media\License.rtf" />
<UIRef Id="WixUI_Minimal" />
<WixVariable Id="WixUIBannerBmp" Value="media\bannrbmp.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="media\dlgbmp.bmp" />
<!-- per machine install-->
<Property Id="PSCOMPATIBLEVERSION">
<RegistrySearch Id="PSCOMPATIBLEVERSION" Root="HKLM" Key="SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine" Name="PSCompatibleVersion" Type="raw" />
</Property>
<!-- This condition will break if PowerShell has less than version x5.0 -->
<Condition Message="This setup requires the Windows PowerShell 5.1 or compatible version to be installed.">
<![CDATA[Installed or (PSCOMPATIBLEVERSION >< "5.1")]]>
</Condition>
<?define NetFx472MinRelease = 461808 ?>
<Property Id="NETFRAMEWORK472" Value="0" Secure="yes">
<RegistrySearch
Id="RegSearch"
Root="HKLM"
Key="SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full"
Name="Release"
Type="raw" />
</Property>
<Condition Message="This setup requires the .NET Framework version 4.7.2 or greater to be installed.">
<![CDATA[NETFRAMEWORK472 >= "#$(var.NetFx472MinRelease)"]]>
</Condition>
<Binary Id="InstallerChecks.CA.dll"
src="InstallerChecks.CA.dll" />
<CustomAction Id="InstallerChecks"
Return="check"
Execute="immediate"
BinaryKey="InstallerChecks.CA.dll"
DllEntry="CheckForAzureRm" />
<InstallExecuteSequence>
<Custom Action="InstallerChecks" Before="LaunchConditions" />
</InstallExecuteSequence>
<Directory Id="TARGETDIR" Name="SourceDir">
<!-- x64 files -->
<?if $(sys.BUILDARCH) = "x64" ?>
<Directory Id="ProgramFiles64Folder">
<Directory Id="WindowsPowerShellx64" Name="WindowsPowerShell">
<Directory Id="Modulesx64" Name="Modules" />
</Directory>
</Directory>
<?endif?>
<!-- x86 files -->
<Directory Id="ProgramFilesFolder">
<Directory Id="WindowsPowerShellx86" Name="WindowsPowerShell">
<Directory Id="Modulesx86" Name="Modules" />
</Directory>
</Directory>
</Directory>
<Feature Id="azurecmd" Title="Microsoft Azure PowerShell" Level="1" Description="Azure PowerShell cmdlets">
<?if $(sys.BUILDARCH) = "x64" ?>
<ComponentGroupRef Id="azurecmdfilesx64" />
<?endif?>
<ComponentGroupRef Id="azurecmdfilesx86" />
</Feature>
<InstallExecuteSequence>
<Custom Action='ExecutionPolicy' Before='InstallFiles'/>
</InstallExecuteSequence>
<?if $(sys.BUILDARCH) = "x64" ?>
<!--
# to regenerate the EncodedCommand, run this (x64):
$command = 'if( (get-executionpolicy -scope localmachine) -eq "undefined" ) { & "$env:windir\system32\windowspowershell\v1.0\powershell.exe" -noprofile -nologo -noninteractive -executionpolicy allsigned -command set-executionpolicy allsigned ; & "$env:windir\syswow64\windowspowershell\v1.0\powershell.exe" -noprofile -nologo -noninteractive -executionpolicy allsigned -command set-executionpolicy allsigned } '
[Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($command))
-->
<CustomAction Id='ExecutionPolicy' Execute='deferred' Property="POWERSHELLEXE" ExeCommand="-noprofile -nologo -noninteractive -EncodedCommand aQBmACgAIAAoAGcAZQB0AC0AZQB4AGUAYwB1AHQAaQBvAG4AcABvAGwAaQBjAHkAIAAtAHMAYwBvAHAAZQAgAGwAbwBjAGEAbABtAGEAYwBoAGkAbgBlACkAIAAtAGUAcQAgACIAdQBuAGQAZQBmAGkAbgBlAGQAIgAgACkAIAB7ACAAJgAgACIAJABlAG4AdgA6AHcAaQBuAGQAaQByAFwAcwB5AHMAdABlAG0AMwAyAFwAdwBpAG4AZABvAHcAcwBwAG8AdwBlAHIAcwBoAGUAbABsAFwAdgAxAC4AMABcAHAAbwB3AGUAcgBzAGgAZQBsAGwALgBlAHgAZQAiACAALQBuAG8AcAByAG8AZgBpAGwAZQAgAC0AbgBvAGwAbwBnAG8AIAAtAG4AbwBuAGkAbgB0AGUAcgBhAGMAdABpAHYAZQAgAC0AZQB4AGUAYwB1AHQAaQBvAG4AcABvAGwAaQBjAHkAIABhAGwAbABzAGkAZwBuAGUAZAAgAC0AYwBvAG0AbQBhAG4AZAAgAHMAZQB0AC0AZQB4AGUAYwB1AHQAaQBvAG4AcABvAGwAaQBjAHkAIABhAGwAbABzAGkAZwBuAGUAZAAgADsAIAAgACYAIAAiACQAZQBuAHYAOgB3AGkAbgBkAGkAcgBcAHMAeQBzAHcAbwB3ADYANABcAHcAaQBuAGQAbwB3AHMAcABvAHcAZQByAHMAaABlAGwAbABcAHYAMQAuADAAXABwAG8AdwBlAHIAcwBoAGUAbABsAC4AZQB4AGUAIgAgAC0AbgBvAHAAcgBvAGYAaQBsAGUAIAAtAG4AbwBsAG8AZwBvACAALQBuAG8AbgBpAG4AdABlAHIAYQBjAHQAaQB2AGUAIAAtAGUAeABlAGMAdQB0AGkAbwBuAHAAbwBsAGkAYwB5ACAAYQBsAGwAcwBpAGcAbgBlAGQAIAAtAGMAbwBtAG0AYQBuAGQAIABzAGUAdAAtAGUAeABlAGMAdQB0AGkAbwBuAHAAbwBsAGkAYwB5ACAAYQBsAGwAcwBpAGcAbgBlAGQAIAAgAH0AIAA=" Impersonate="no" Return='asyncNoWait'/>
<?else ?>
<!--
# to regenerate the EncodedCommand, run this (x86):
$command = 'if( (get-executionpolicy -scope localmachine) -eq "undefined" ) { & "$env:windir\system32\windowspowershell\v1.0\powershell.exe" -noprofile -nologo -noninteractive -executionpolicy allsigned -command set-executionpolicy allsigned } '
[Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($command))
-->
<CustomAction Id='ExecutionPolicy' Execute='deferred' Property="POWERSHELLEXE" ExeCommand="-noprofile -nologo -noninteractive -EncodedCommand aQBmACgAIAAoAGcAZQB0AC0AZQB4AGUAYwB1AHQAaQBvAG4AcABvAGwAaQBjAHkAIAAtAHMAYwBvAHAAZQAgAGwAbwBjAGEAbABtAGEAYwBoAGkAbgBlACkAIAAtAGUAcQAgACIAdQBuAGQAZQBmAGkAbgBlAGQAIgAgACkAIAB7ACAAJgAgACIAJABlAG4AdgA6AHcAaQBuAGQAaQByAFwAcwB5AHMAdABlAG0AMwAyAFwAdwBpAG4AZABvAHcAcwBwAG8AdwBlAHIAcwBoAGUAbABsAFwAdgAxAC4AMABcAHAAbwB3AGUAcgBzAGgAZQBsAGwALgBlAHgAZQAiACAALQBuAG8AcAByAG8AZgBpAGwAZQAgAC0AbgBvAGwAbwBnAG8AIAAtAG4AbwBuAGkAbgB0AGUAcgBhAGMAdABpAHYAZQAgAC0AZQB4AGUAYwB1AHQAaQBvAG4AcABvAGwAaQBjAHkAIABhAGwAbABzAGkAZwBuAGUAZAAgAC0AYwBvAG0AbQBhAG4AZAAgAHMAZQB0AC0AZQB4AGUAYwB1AHQAaQBvAG4AcABvAGwAaQBjAHkAIABhAGwAbABzAGkAZwBuAGUAZAAgAH0AIAA=" Impersonate="no" Return='asyncNoWait'/>
<?endif ?>
</Product>
<?if $(sys.BUILDARCH) = "x64" ?>
<?include azurecmdfiles-x64.wxi ?>
<?endif ?>
<?include azurecmdfiles-x86.wxi ?>
</Wix>