azure-powershell-1/setup/azurecmd.wxs

114 строки
6.8 KiB
XML

<?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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YwB5ACAAYQBsAGwAcwBpAGcAbgBlAGQAIAAgAH0AIAA=" 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>