-
Notifications
You must be signed in to change notification settings - Fork 3.9k
/
Copy pathazurecmd.wxs
119 lines (96 loc) · 6.71 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
114
115
116
117
118
119
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<?define productName="Microsoft Azure PowerShell - December 2017" ?>
<?define sourceDir="$(var.SolutionDir)..\src\Package\$(var.Configuration)" ?>
<?define caSourceDir="$(var.SolutionDir)setup\bin\$(var.Configuration)" ?>
<?define version="5.1.1" ?>
<Product Id="*"
Name="$(var.productName)"
Language="1033"
Version="$(var.version)"
Manufacturer="Microsoft Corporation"
UpgradeCode="EBC1AD5E-1BBE-45B5-9E8D-ACFC8951C252">
<Package InstallerVersion="200" Compressed="yes" Platform="x86" />
<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"/>
<!-- per machine install-->
<Property Id="PSCOMPATIBLEVERSION">
<RegistrySearch Id="PSCOMPATIBLEVERSION" Root="HKLM" Key="SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine" Name="PSCompatibleVersion" Type="raw" />
</Property>
<SetProperty Action="SetBase64" Id="BaseModulesFolder" Value="[ProgramFiles64Folder]WindowsPowerShell\Modules\" Before="AppSearch">
VersionNT64
</SetProperty>
<SetProperty Action="SetBase32" Id="BaseModulesFolder" Value="[ProgramFilesFolder]WindowsPowerShell\Modules\" Before="AppSearch">
NOT VersionNT64
</SetProperty>
<SetProperty Id="POWERSHELLEXE" Value="[WindowsFolder]System32\WindowsPowerShell\v1.0\powershell.exe" Before="AppSearch"/>
<util:CloseApplication Id="ClosePowerShellExe" Target="powershell.exe" ElevatedCloseMessage="yes" CloseMessage="yes" PromptToContinue="yes" Description="PowerShell must be closed to continue with this installation. Please close any PowerShell windows and click 'Retry', or click 'Cancel' to stop installation. If you click 'Ignore' the installer will attempt to close any open PowerShell window."/>
<util:CloseApplication Id="ClosePowerShellIseExe" Target="powershell_ise.exe" ElevatedCloseMessage="yes" CloseMessage="yes" PromptToContinue="yes" Description="PowerShell ISE must be closed to continue with this installation. Please close any PowerShell ISE windows and click 'Retry', or click 'Cancel' to stop installation. If you click 'Ignore' the installer will attempt to close any open PowerShell ISE window."/>
<Condition Message="This setup requires the Windows PowerShell 3.0 or compatible version to be installed.">
<!-- This condition will break if PowerShell has version x3.0 and it is not compatible with 3.0 -->
<![CDATA[Installed or (PSCOMPATIBLEVERSION >< "3.0")]]>
</Condition>
<PropertyRef Id="NETFRAMEWORK45" />
<Condition Message="This setup requires the .NET Framework 4.5.2 or higher to be installed.">
<!-- NETFRAMEWORK45 contains a DWORD with installed version key to versions is here: -->
<!-- https://msdn.microsoft.com/en-us/library/ee942965(v=vs.110).aspx#detect_net -->
<![CDATA[Installed or (NETFRAMEWORK45 >= "#379893") or ISVSINSTALL]]>
</Condition>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="MicrosoftSdkFolder" Name="Microsoft SDKs">
<Directory Id="AzureSdkFolder" Name="Azure">
<Directory Id="PowerShellFolder" Name="PowerShell"/>
</Directory>
</Directory>
</Directory>
</Directory>
<Property Id="POWERSHELLPATH">
<RegistrySearch Id="POWERSHELLPATH"
Type="raw"
Root="HKLM"
Key="SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine"
Name="ApplicationBase" />
</Property>
<DirectoryRef Id="PowerShellFolder">
<Component Id="PSModulePath.System" Guid="273525B9-7AAB-421A-90C8-8E50A1840B8D">
<CreateFolder />
<!-- Work around bug that PowerShell does not always consider default module paths. -->
<Environment Id="PSModulePath.SystemAppRoot" Action="set" Name="PSMODULEPATH" Part="last" Value="[BaseModulesFolder];[PowerShellFolder]ResourceManager\AzureResourceManager\;[PowerShellFolder]ServiceManagement\;[PowerShellFolder]Storage\" System="yes" />
</Component>
</DirectoryRef>
<DirectoryRef Id="PowerShellFolder">
<Component Id="AzureSdkExecutionPolicyScript" Guid="3d0d589a-b34c-4c48-9a4c-df78f286c6a3">
<File Id="AzureSdkExecutionPolicyScriptFile" KeyPath="yes" Source="$(var.SolutionDir)\Setup\SetExecutionPolicy.ps1" />
</Component>
</DirectoryRef>
<DirectoryRef Id="PowerShellFolder">
<Component Id="AzureSdkRemoveModulesScript" Guid="7d75fe67-88e4-40da-bc3d-874cb0438d30">
<File Id="AzureSdkRemoveModulesScriptFile" KeyPath="yes" Source="$(var.SolutionDir)\Setup\RemoveGalleryModules.ps1" />
</Component>
</DirectoryRef>
<Feature Id="azurecmd" Title="Microsoft Azure PowerShell" Level="1" Description="Windows PowerShell commandlets">
<ComponentGroupRef Id="azurecmdfiles" />
<ComponentRef Id="PSModulePath.System" />
<ComponentRef Id="AzureSdkExecutionPolicyScript" />
<ComponentRef Id="AzureSdkRemoveModulesScript" />
</Feature>
<Binary Id="CustomActions" SourceFile="$(var.caSourceDir)\Microsoft.WindowsAzure.Setup.CA.dll"/>
<CustomAction Id="SetExecutionPolicy" Property="POWERSHELLEXE" ExeCommand="-NoLogo -NoProfile -WindowStyle Hidden -NonInteractive -ExecutionPolicy Bypass -Command ". \"[PowerShellFolder]SetExecutionPolicy.ps1\""" Execute="deferred" Impersonate="no" Return="check"/>
<CustomAction Id="RemoveGalleryModules" Property="POWERSHELLEXE" ExeCommand="-NoLogo -NoProfile -WindowStyle Hidden -NonInteractive -ExecutionPolicy Bypass -Command ". \"[PowerShellFolder]RemoveGalleryModules.ps1\""" Execute="deferred" Impersonate="no" Return="check"/>
<InstallExecuteSequence>
<Custom Action="RemoveGalleryModules" After="CreateShortcuts">NOT Installed</Custom>
<Custom Action="SetExecutionPolicy" After="RemoveGalleryModules">NOT Installed</Custom>
</InstallExecuteSequence>
<WixVariable Id="WixUILicenseRtf" Value="$(var.ProjectDir)\media\License.rtf" />
<UIRef Id="WixUI_Minimal" />
<WixVariable Id="WixUIBannerBmp" Value="media\bannrbmp.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="media\dlgbmp.bmp" />
</Product>
<?include azurecmdfiles.wxi ?>
</Wix>